1 /* Generated by Cython 0.29.23 */
2 
3 /* BEGIN: Cython Metadata
4 {
5     "distutils": {
6         "depends": [
7             "gssapi/raw/python_gssapi.h"
8         ],
9         "extra_compile_args": [
10             "-DHAS_GSSAPI_EXT_H"
11         ],
12         "extra_link_args": [
13             "-Wl,-z,relro",
14             "-Wl,--as-needed",
15             "-Wl,-z,now"
16         ],
17         "include_dirs": [
18             "gssapi/raw",
19             "./gssapi/raw"
20         ],
21         "libraries": [
22             "gssapi_krb5",
23             "krb5",
24             "k5crypto",
25             "com_err"
26         ],
27         "name": "gssapi.raw.sec_contexts",
28         "sources": [
29             "gssapi/raw/sec_contexts.pyx"
30         ]
31     },
32     "module_name": "gssapi.raw.sec_contexts"
33 }
34 END: Cython Metadata */
35 
36 #ifndef PY_SSIZE_T_CLEAN
37 #define PY_SSIZE_T_CLEAN
38 #endif /* PY_SSIZE_T_CLEAN */
39 #include "Python.h"
40 #ifndef Py_PYTHON_H
41     #error Python headers needed to compile C extensions, please install development version of Python.
42 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
43     #error Cython requires Python 2.6+ or Python 3.3+.
44 #else
45 #define CYTHON_ABI "0_29_23"
46 #define CYTHON_HEX_VERSION 0x001D17F0
47 #define CYTHON_FUTURE_DIVISION 0
48 #include <stddef.h>
49 #ifndef offsetof
50   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
51 #endif
52 #if !defined(WIN32) && !defined(MS_WINDOWS)
53   #ifndef __stdcall
54     #define __stdcall
55   #endif
56   #ifndef __cdecl
57     #define __cdecl
58   #endif
59   #ifndef __fastcall
60     #define __fastcall
61   #endif
62 #endif
63 #ifndef DL_IMPORT
64   #define DL_IMPORT(t) t
65 #endif
66 #ifndef DL_EXPORT
67   #define DL_EXPORT(t) t
68 #endif
69 #define __PYX_COMMA ,
70 #ifndef HAVE_LONG_LONG
71   #if PY_VERSION_HEX >= 0x02070000
72     #define HAVE_LONG_LONG
73   #endif
74 #endif
75 #ifndef PY_LONG_LONG
76   #define PY_LONG_LONG LONG_LONG
77 #endif
78 #ifndef Py_HUGE_VAL
79   #define Py_HUGE_VAL HUGE_VAL
80 #endif
81 #ifdef PYPY_VERSION
82   #define CYTHON_COMPILING_IN_PYPY 1
83   #define CYTHON_COMPILING_IN_PYSTON 0
84   #define CYTHON_COMPILING_IN_CPYTHON 0
85   #undef CYTHON_USE_TYPE_SLOTS
86   #define CYTHON_USE_TYPE_SLOTS 0
87   #undef CYTHON_USE_PYTYPE_LOOKUP
88   #define CYTHON_USE_PYTYPE_LOOKUP 0
89   #if PY_VERSION_HEX < 0x03050000
90     #undef CYTHON_USE_ASYNC_SLOTS
91     #define CYTHON_USE_ASYNC_SLOTS 0
92   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
93     #define CYTHON_USE_ASYNC_SLOTS 1
94   #endif
95   #undef CYTHON_USE_PYLIST_INTERNALS
96   #define CYTHON_USE_PYLIST_INTERNALS 0
97   #undef CYTHON_USE_UNICODE_INTERNALS
98   #define CYTHON_USE_UNICODE_INTERNALS 0
99   #undef CYTHON_USE_UNICODE_WRITER
100   #define CYTHON_USE_UNICODE_WRITER 0
101   #undef CYTHON_USE_PYLONG_INTERNALS
102   #define CYTHON_USE_PYLONG_INTERNALS 0
103   #undef CYTHON_AVOID_BORROWED_REFS
104   #define CYTHON_AVOID_BORROWED_REFS 1
105   #undef CYTHON_ASSUME_SAFE_MACROS
106   #define CYTHON_ASSUME_SAFE_MACROS 0
107   #undef CYTHON_UNPACK_METHODS
108   #define CYTHON_UNPACK_METHODS 0
109   #undef CYTHON_FAST_THREAD_STATE
110   #define CYTHON_FAST_THREAD_STATE 0
111   #undef CYTHON_FAST_PYCALL
112   #define CYTHON_FAST_PYCALL 0
113   #undef CYTHON_PEP489_MULTI_PHASE_INIT
114   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115   #undef CYTHON_USE_TP_FINALIZE
116   #define CYTHON_USE_TP_FINALIZE 0
117   #undef CYTHON_USE_DICT_VERSIONS
118   #define CYTHON_USE_DICT_VERSIONS 0
119   #undef CYTHON_USE_EXC_INFO_STACK
120   #define CYTHON_USE_EXC_INFO_STACK 0
121 #elif defined(PYSTON_VERSION)
122   #define CYTHON_COMPILING_IN_PYPY 0
123   #define CYTHON_COMPILING_IN_PYSTON 1
124   #define CYTHON_COMPILING_IN_CPYTHON 0
125   #ifndef CYTHON_USE_TYPE_SLOTS
126     #define CYTHON_USE_TYPE_SLOTS 1
127   #endif
128   #undef CYTHON_USE_PYTYPE_LOOKUP
129   #define CYTHON_USE_PYTYPE_LOOKUP 0
130   #undef CYTHON_USE_ASYNC_SLOTS
131   #define CYTHON_USE_ASYNC_SLOTS 0
132   #undef CYTHON_USE_PYLIST_INTERNALS
133   #define CYTHON_USE_PYLIST_INTERNALS 0
134   #ifndef CYTHON_USE_UNICODE_INTERNALS
135     #define CYTHON_USE_UNICODE_INTERNALS 1
136   #endif
137   #undef CYTHON_USE_UNICODE_WRITER
138   #define CYTHON_USE_UNICODE_WRITER 0
139   #undef CYTHON_USE_PYLONG_INTERNALS
140   #define CYTHON_USE_PYLONG_INTERNALS 0
141   #ifndef CYTHON_AVOID_BORROWED_REFS
142     #define CYTHON_AVOID_BORROWED_REFS 0
143   #endif
144   #ifndef CYTHON_ASSUME_SAFE_MACROS
145     #define CYTHON_ASSUME_SAFE_MACROS 1
146   #endif
147   #ifndef CYTHON_UNPACK_METHODS
148     #define CYTHON_UNPACK_METHODS 1
149   #endif
150   #undef CYTHON_FAST_THREAD_STATE
151   #define CYTHON_FAST_THREAD_STATE 0
152   #undef CYTHON_FAST_PYCALL
153   #define CYTHON_FAST_PYCALL 0
154   #undef CYTHON_PEP489_MULTI_PHASE_INIT
155   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
156   #undef CYTHON_USE_TP_FINALIZE
157   #define CYTHON_USE_TP_FINALIZE 0
158   #undef CYTHON_USE_DICT_VERSIONS
159   #define CYTHON_USE_DICT_VERSIONS 0
160   #undef CYTHON_USE_EXC_INFO_STACK
161   #define CYTHON_USE_EXC_INFO_STACK 0
162 #else
163   #define CYTHON_COMPILING_IN_PYPY 0
164   #define CYTHON_COMPILING_IN_PYSTON 0
165   #define CYTHON_COMPILING_IN_CPYTHON 1
166   #ifndef CYTHON_USE_TYPE_SLOTS
167     #define CYTHON_USE_TYPE_SLOTS 1
168   #endif
169   #if PY_VERSION_HEX < 0x02070000
170     #undef CYTHON_USE_PYTYPE_LOOKUP
171     #define CYTHON_USE_PYTYPE_LOOKUP 0
172   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
173     #define CYTHON_USE_PYTYPE_LOOKUP 1
174   #endif
175   #if PY_MAJOR_VERSION < 3
176     #undef CYTHON_USE_ASYNC_SLOTS
177     #define CYTHON_USE_ASYNC_SLOTS 0
178   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
179     #define CYTHON_USE_ASYNC_SLOTS 1
180   #endif
181   #if PY_VERSION_HEX < 0x02070000
182     #undef CYTHON_USE_PYLONG_INTERNALS
183     #define CYTHON_USE_PYLONG_INTERNALS 0
184   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
185     #define CYTHON_USE_PYLONG_INTERNALS 1
186   #endif
187   #ifndef CYTHON_USE_PYLIST_INTERNALS
188     #define CYTHON_USE_PYLIST_INTERNALS 1
189   #endif
190   #ifndef CYTHON_USE_UNICODE_INTERNALS
191     #define CYTHON_USE_UNICODE_INTERNALS 1
192   #endif
193   #if PY_VERSION_HEX < 0x030300F0
194     #undef CYTHON_USE_UNICODE_WRITER
195     #define CYTHON_USE_UNICODE_WRITER 0
196   #elif !defined(CYTHON_USE_UNICODE_WRITER)
197     #define CYTHON_USE_UNICODE_WRITER 1
198   #endif
199   #ifndef CYTHON_AVOID_BORROWED_REFS
200     #define CYTHON_AVOID_BORROWED_REFS 0
201   #endif
202   #ifndef CYTHON_ASSUME_SAFE_MACROS
203     #define CYTHON_ASSUME_SAFE_MACROS 1
204   #endif
205   #ifndef CYTHON_UNPACK_METHODS
206     #define CYTHON_UNPACK_METHODS 1
207   #endif
208   #ifndef CYTHON_FAST_THREAD_STATE
209     #define CYTHON_FAST_THREAD_STATE 1
210   #endif
211   #ifndef CYTHON_FAST_PYCALL
212     #define CYTHON_FAST_PYCALL 1
213   #endif
214   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
215     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
216   #endif
217   #ifndef CYTHON_USE_TP_FINALIZE
218     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
219   #endif
220   #ifndef CYTHON_USE_DICT_VERSIONS
221     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
222   #endif
223   #ifndef CYTHON_USE_EXC_INFO_STACK
224     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
225   #endif
226 #endif
227 #if !defined(CYTHON_FAST_PYCCALL)
228 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
229 #endif
230 #if CYTHON_USE_PYLONG_INTERNALS
231   #include "longintrepr.h"
232   #undef SHIFT
233   #undef BASE
234   #undef MASK
235   #ifdef SIZEOF_VOID_P
236     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
237   #endif
238 #endif
239 #ifndef __has_attribute
240   #define __has_attribute(x) 0
241 #endif
242 #ifndef __has_cpp_attribute
243   #define __has_cpp_attribute(x) 0
244 #endif
245 #ifndef CYTHON_RESTRICT
246   #if defined(__GNUC__)
247     #define CYTHON_RESTRICT __restrict__
248   #elif defined(_MSC_VER) && _MSC_VER >= 1400
249     #define CYTHON_RESTRICT __restrict
250   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
251     #define CYTHON_RESTRICT restrict
252   #else
253     #define CYTHON_RESTRICT
254   #endif
255 #endif
256 #ifndef CYTHON_UNUSED
257 # if defined(__GNUC__)
258 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
259 #     define CYTHON_UNUSED __attribute__ ((__unused__))
260 #   else
261 #     define CYTHON_UNUSED
262 #   endif
263 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
264 #   define CYTHON_UNUSED __attribute__ ((__unused__))
265 # else
266 #   define CYTHON_UNUSED
267 # endif
268 #endif
269 #ifndef CYTHON_MAYBE_UNUSED_VAR
270 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)271      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
272 #  else
273 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
274 #  endif
275 #endif
276 #ifndef CYTHON_NCP_UNUSED
277 # if CYTHON_COMPILING_IN_CPYTHON
278 #  define CYTHON_NCP_UNUSED
279 # else
280 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
281 # endif
282 #endif
283 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
284 #ifdef _MSC_VER
285     #ifndef _MSC_STDINT_H_
286         #if _MSC_VER < 1300
287            typedef unsigned char     uint8_t;
288            typedef unsigned int      uint32_t;
289         #else
290            typedef unsigned __int8   uint8_t;
291            typedef unsigned __int32  uint32_t;
292         #endif
293     #endif
294 #else
295    #include <stdint.h>
296 #endif
297 #ifndef CYTHON_FALLTHROUGH
298   #if defined(__cplusplus) && __cplusplus >= 201103L
299     #if __has_cpp_attribute(fallthrough)
300       #define CYTHON_FALLTHROUGH [[fallthrough]]
301     #elif __has_cpp_attribute(clang::fallthrough)
302       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
303     #elif __has_cpp_attribute(gnu::fallthrough)
304       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
305     #endif
306   #endif
307   #ifndef CYTHON_FALLTHROUGH
308     #if __has_attribute(fallthrough)
309       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
310     #else
311       #define CYTHON_FALLTHROUGH
312     #endif
313   #endif
314   #if defined(__clang__ ) && defined(__apple_build_version__)
315     #if __apple_build_version__ < 7000000
316       #undef  CYTHON_FALLTHROUGH
317       #define CYTHON_FALLTHROUGH
318     #endif
319   #endif
320 #endif
321 
322 #ifndef CYTHON_INLINE
323   #if defined(__clang__)
324     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
325   #elif defined(__GNUC__)
326     #define CYTHON_INLINE __inline__
327   #elif defined(_MSC_VER)
328     #define CYTHON_INLINE __inline
329   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
330     #define CYTHON_INLINE inline
331   #else
332     #define CYTHON_INLINE
333   #endif
334 #endif
335 
336 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
337   #define Py_OptimizeFlag 0
338 #endif
339 #define __PYX_BUILD_PY_SSIZE_T "n"
340 #define CYTHON_FORMAT_SSIZE_T "z"
341 #if PY_MAJOR_VERSION < 3
342   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
343   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
344           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
345   #define __Pyx_DefaultClassType PyClass_Type
346 #else
347   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
348 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
349   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
350           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
351 #else
352   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
353           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
354 #endif
355   #define __Pyx_DefaultClassType PyType_Type
356 #endif
357 #ifndef Py_TPFLAGS_CHECKTYPES
358   #define Py_TPFLAGS_CHECKTYPES 0
359 #endif
360 #ifndef Py_TPFLAGS_HAVE_INDEX
361   #define Py_TPFLAGS_HAVE_INDEX 0
362 #endif
363 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
364   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
365 #endif
366 #ifndef Py_TPFLAGS_HAVE_FINALIZE
367   #define Py_TPFLAGS_HAVE_FINALIZE 0
368 #endif
369 #ifndef METH_STACKLESS
370   #define METH_STACKLESS 0
371 #endif
372 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
373   #ifndef METH_FASTCALL
374      #define METH_FASTCALL 0x80
375   #endif
376   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
377   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
378                                                           Py_ssize_t nargs, PyObject *kwnames);
379 #else
380   #define __Pyx_PyCFunctionFast _PyCFunctionFast
381   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
382 #endif
383 #if CYTHON_FAST_PYCCALL
384 #define __Pyx_PyFastCFunction_Check(func)\
385     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
386 #else
387 #define __Pyx_PyFastCFunction_Check(func) 0
388 #endif
389 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
390   #define PyObject_Malloc(s)   PyMem_Malloc(s)
391   #define PyObject_Free(p)     PyMem_Free(p)
392   #define PyObject_Realloc(p)  PyMem_Realloc(p)
393 #endif
394 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
395   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
396   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
397   #define PyMem_RawFree(p)             PyMem_Free(p)
398 #endif
399 #if CYTHON_COMPILING_IN_PYSTON
400   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
401   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
402 #else
403   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
404   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
405 #endif
406 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
407   #define __Pyx_PyThreadState_Current PyThreadState_GET()
408 #elif PY_VERSION_HEX >= 0x03060000
409   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
410 #elif PY_VERSION_HEX >= 0x03000000
411   #define __Pyx_PyThreadState_Current PyThreadState_GET()
412 #else
413   #define __Pyx_PyThreadState_Current _PyThreadState_Current
414 #endif
415 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
416 #include "pythread.h"
417 #define Py_tss_NEEDS_INIT 0
418 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)419 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
420   *key = PyThread_create_key();
421   return 0;
422 }
PyThread_tss_alloc(void)423 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
424   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
425   *key = Py_tss_NEEDS_INIT;
426   return key;
427 }
PyThread_tss_free(Py_tss_t * key)428 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
429   PyObject_Free(key);
430 }
PyThread_tss_is_created(Py_tss_t * key)431 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
432   return *key != Py_tss_NEEDS_INIT;
433 }
PyThread_tss_delete(Py_tss_t * key)434 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
435   PyThread_delete_key(*key);
436   *key = Py_tss_NEEDS_INIT;
437 }
PyThread_tss_set(Py_tss_t * key,void * value)438 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
439   return PyThread_set_key_value(*key, value);
440 }
PyThread_tss_get(Py_tss_t * key)441 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
442   return PyThread_get_key_value(*key);
443 }
444 #endif
445 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
446 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
447 #else
448 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
449 #endif
450 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
451   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
452   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
453 #else
454   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
455   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
456 #endif
457 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
458 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
459 #else
460 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
461 #endif
462 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
463   #define CYTHON_PEP393_ENABLED 1
464   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
465                                               0 : _PyUnicode_Ready((PyObject *)(op)))
466   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
467   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
468   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
469   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
470   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
471   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
472   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
473   #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
474   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
475   #else
476   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
477   #endif
478 #else
479   #define CYTHON_PEP393_ENABLED 0
480   #define PyUnicode_1BYTE_KIND  1
481   #define PyUnicode_2BYTE_KIND  2
482   #define PyUnicode_4BYTE_KIND  4
483   #define __Pyx_PyUnicode_READY(op)       (0)
484   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
485   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
486   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
487   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
488   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
489   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
490   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
491   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
492 #endif
493 #if CYTHON_COMPILING_IN_PYPY
494   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
495   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
496 #else
497   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
498   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
499       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
500 #endif
501 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
502   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
503 #endif
504 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
505   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
506 #endif
507 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
508   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
509 #endif
510 #define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
511 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
512 #if PY_MAJOR_VERSION >= 3
513   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
514 #else
515   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
516 #endif
517 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
518   #define PyObject_ASCII(o)            PyObject_Repr(o)
519 #endif
520 #if PY_MAJOR_VERSION >= 3
521   #define PyBaseString_Type            PyUnicode_Type
522   #define PyStringObject               PyUnicodeObject
523   #define PyString_Type                PyUnicode_Type
524   #define PyString_Check               PyUnicode_Check
525   #define PyString_CheckExact          PyUnicode_CheckExact
526 #ifndef PyObject_Unicode
527   #define PyObject_Unicode             PyObject_Str
528 #endif
529 #endif
530 #if PY_MAJOR_VERSION >= 3
531   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
532   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
533 #else
534   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
535   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
536 #endif
537 #ifndef PySet_CheckExact
538   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
539 #endif
540 #if PY_VERSION_HEX >= 0x030900A4
541   #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
542   #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
543 #else
544   #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
545   #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
546 #endif
547 #if CYTHON_ASSUME_SAFE_MACROS
548   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
549 #else
550   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
551 #endif
552 #if PY_MAJOR_VERSION >= 3
553   #define PyIntObject                  PyLongObject
554   #define PyInt_Type                   PyLong_Type
555   #define PyInt_Check(op)              PyLong_Check(op)
556   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
557   #define PyInt_FromString             PyLong_FromString
558   #define PyInt_FromUnicode            PyLong_FromUnicode
559   #define PyInt_FromLong               PyLong_FromLong
560   #define PyInt_FromSize_t             PyLong_FromSize_t
561   #define PyInt_FromSsize_t            PyLong_FromSsize_t
562   #define PyInt_AsLong                 PyLong_AsLong
563   #define PyInt_AS_LONG                PyLong_AS_LONG
564   #define PyInt_AsSsize_t              PyLong_AsSsize_t
565   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
566   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
567   #define PyNumber_Int                 PyNumber_Long
568 #endif
569 #if PY_MAJOR_VERSION >= 3
570   #define PyBoolObject                 PyLongObject
571 #endif
572 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
573   #ifndef PyUnicode_InternFromString
574     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
575   #endif
576 #endif
577 #if PY_VERSION_HEX < 0x030200A4
578   typedef long Py_hash_t;
579   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
580   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
581 #else
582   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
583   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
584 #endif
585 #if PY_MAJOR_VERSION >= 3
586   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
587 #else
588   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
589 #endif
590 #if CYTHON_USE_ASYNC_SLOTS
591   #if PY_VERSION_HEX >= 0x030500B1
592     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
593     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
594   #else
595     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
596   #endif
597 #else
598   #define __Pyx_PyType_AsAsync(obj) NULL
599 #endif
600 #ifndef __Pyx_PyAsyncMethodsStruct
601     typedef struct {
602         unaryfunc am_await;
603         unaryfunc am_aiter;
604         unaryfunc am_anext;
605     } __Pyx_PyAsyncMethodsStruct;
606 #endif
607 
608 #if defined(WIN32) || defined(MS_WINDOWS)
609   #define _USE_MATH_DEFINES
610 #endif
611 #include <math.h>
612 #ifdef NAN
613 #define __PYX_NAN() ((float) NAN)
614 #else
__PYX_NAN()615 static CYTHON_INLINE float __PYX_NAN() {
616   float value;
617   memset(&value, 0xFF, sizeof(value));
618   return value;
619 }
620 #endif
621 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
622 #define __Pyx_truncl trunc
623 #else
624 #define __Pyx_truncl truncl
625 #endif
626 
627 #define __PYX_MARK_ERR_POS(f_index, lineno) \
628     { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
629 #define __PYX_ERR(f_index, lineno, Ln_error) \
630     { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
631 
632 #ifndef __PYX_EXTERN_C
633   #ifdef __cplusplus
634     #define __PYX_EXTERN_C extern "C"
635   #else
636     #define __PYX_EXTERN_C extern
637   #endif
638 #endif
639 
640 #define __PYX_HAVE__gssapi__raw__sec_contexts
641 #define __PYX_HAVE_API__gssapi__raw__sec_contexts
642 /* Early includes */
643 #include <stdint.h>
644 #include "python_gssapi.h"
645 #include <string.h>
646 #include <stdlib.h>
647 #ifdef _OPENMP
648 #include <omp.h>
649 #endif /* _OPENMP */
650 
651 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
652 #define CYTHON_WITHOUT_ASSERTIONS
653 #endif
654 
655 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
656                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
657 
658 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
659 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
660 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
661 #define __PYX_DEFAULT_STRING_ENCODING ""
662 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
663 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
664 #define __Pyx_uchar_cast(c) ((unsigned char)c)
665 #define __Pyx_long_cast(x) ((long)x)
666 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
667     (sizeof(type) < sizeof(Py_ssize_t))  ||\
668     (sizeof(type) > sizeof(Py_ssize_t) &&\
669           likely(v < (type)PY_SSIZE_T_MAX ||\
670                  v == (type)PY_SSIZE_T_MAX)  &&\
671           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
672                                 v == (type)PY_SSIZE_T_MIN)))  ||\
673     (sizeof(type) == sizeof(Py_ssize_t) &&\
674           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
675                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)676 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
677     return (size_t) i < (size_t) limit;
678 }
679 #if defined (__cplusplus) && __cplusplus >= 201103L
680     #include <cstdlib>
681     #define __Pyx_sst_abs(value) std::abs(value)
682 #elif SIZEOF_INT >= SIZEOF_SIZE_T
683     #define __Pyx_sst_abs(value) abs(value)
684 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
685     #define __Pyx_sst_abs(value) labs(value)
686 #elif defined (_MSC_VER)
687     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
688 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
689     #define __Pyx_sst_abs(value) llabs(value)
690 #elif defined (__GNUC__)
691     #define __Pyx_sst_abs(value) __builtin_llabs(value)
692 #else
693     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
694 #endif
695 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
696 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
697 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
698 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
699 #define __Pyx_PyBytes_FromString        PyBytes_FromString
700 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
701 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
702 #if PY_MAJOR_VERSION < 3
703     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
704     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
705 #else
706     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
707     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
708 #endif
709 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
710 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
711 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
712 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
713 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
714 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
715 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
716 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
717 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
718 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
719 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
720 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
721 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
722 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
723 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
724 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)725 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
726     const Py_UNICODE *u_end = u;
727     while (*u_end++) ;
728     return (size_t)(u_end - u - 1);
729 }
730 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
731 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
732 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
733 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
734 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
735 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
736 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
737 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
738 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
739 #define __Pyx_PySequence_Tuple(obj)\
740     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
741 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
742 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
743 #if CYTHON_ASSUME_SAFE_MACROS
744 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
745 #else
746 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
747 #endif
748 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
749 #if PY_MAJOR_VERSION >= 3
750 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
751 #else
752 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
753 #endif
754 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
755 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
756 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)757 static int __Pyx_init_sys_getdefaultencoding_params(void) {
758     PyObject* sys;
759     PyObject* default_encoding = NULL;
760     PyObject* ascii_chars_u = NULL;
761     PyObject* ascii_chars_b = NULL;
762     const char* default_encoding_c;
763     sys = PyImport_ImportModule("sys");
764     if (!sys) goto bad;
765     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
766     Py_DECREF(sys);
767     if (!default_encoding) goto bad;
768     default_encoding_c = PyBytes_AsString(default_encoding);
769     if (!default_encoding_c) goto bad;
770     if (strcmp(default_encoding_c, "ascii") == 0) {
771         __Pyx_sys_getdefaultencoding_not_ascii = 0;
772     } else {
773         char ascii_chars[128];
774         int c;
775         for (c = 0; c < 128; c++) {
776             ascii_chars[c] = c;
777         }
778         __Pyx_sys_getdefaultencoding_not_ascii = 1;
779         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
780         if (!ascii_chars_u) goto bad;
781         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
782         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
783             PyErr_Format(
784                 PyExc_ValueError,
785                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
786                 default_encoding_c);
787             goto bad;
788         }
789         Py_DECREF(ascii_chars_u);
790         Py_DECREF(ascii_chars_b);
791     }
792     Py_DECREF(default_encoding);
793     return 0;
794 bad:
795     Py_XDECREF(default_encoding);
796     Py_XDECREF(ascii_chars_u);
797     Py_XDECREF(ascii_chars_b);
798     return -1;
799 }
800 #endif
801 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
802 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
803 #else
804 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
805 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
806 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)807 static int __Pyx_init_sys_getdefaultencoding_params(void) {
808     PyObject* sys;
809     PyObject* default_encoding = NULL;
810     char* default_encoding_c;
811     sys = PyImport_ImportModule("sys");
812     if (!sys) goto bad;
813     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
814     Py_DECREF(sys);
815     if (!default_encoding) goto bad;
816     default_encoding_c = PyBytes_AsString(default_encoding);
817     if (!default_encoding_c) goto bad;
818     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
819     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
820     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
821     Py_DECREF(default_encoding);
822     return 0;
823 bad:
824     Py_XDECREF(default_encoding);
825     return -1;
826 }
827 #endif
828 #endif
829 
830 
831 /* Test for GCC > 2.95 */
832 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
833   #define likely(x)   __builtin_expect(!!(x), 1)
834   #define unlikely(x) __builtin_expect(!!(x), 0)
835 #else /* !__GNUC__ or GCC < 2.95 */
836   #define likely(x)   (x)
837   #define unlikely(x) (x)
838 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)839 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
840 
841 static PyObject *__pyx_m = NULL;
842 static PyObject *__pyx_d;
843 static PyObject *__pyx_b;
844 static PyObject *__pyx_cython_runtime = NULL;
845 static PyObject *__pyx_empty_tuple;
846 static PyObject *__pyx_empty_bytes;
847 static PyObject *__pyx_empty_unicode;
848 static int __pyx_lineno;
849 static int __pyx_clineno = 0;
850 static const char * __pyx_cfilenm= __FILE__;
851 static const char *__pyx_filename;
852 
853 
854 static const char *__pyx_f[] = {
855   "stringsource",
856   "gssapi/raw/sec_contexts.pyx",
857   "gssapi/raw/cython_converters.pxd",
858   "gssapi/raw/oids.pxd",
859   "gssapi/raw/creds.pxd",
860   "gssapi/raw/names.pxd",
861   "gssapi/raw/chan_bindings.pxd",
862 };
863 /* NoFastGil.proto */
864 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
865 #define __Pyx_PyGILState_Release PyGILState_Release
866 #define __Pyx_FastGIL_Remember()
867 #define __Pyx_FastGIL_Forget()
868 #define __Pyx_FastGilFuncInit()
869 
870 /* ForceInitThreads.proto */
871 #ifndef __PYX_FORCE_INIT_THREADS
872   #define __PYX_FORCE_INIT_THREADS 0
873 #endif
874 
875 
876 /*--- Type declarations ---*/
877 struct __pyx_obj_6gssapi_3raw_4oids_OID;
878 struct __pyx_obj_6gssapi_3raw_5creds_Creds;
879 struct __pyx_obj_6gssapi_3raw_5names_Name;
880 struct __pyx_obj_6gssapi_3raw_13chan_bindings_ChannelBindings;
881 struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext;
882 struct __pyx_opt_args_6gssapi_3raw_17cython_converters_c_create_oid_set;
883 
884 /* "gssapi/raw/cython_converters.pxd":13
885  * cdef gss_OID_set c_get_mech_oid_set(object mechs)
886  * cdef bint c_compare_oids(gss_OID a, gss_OID b)
887  * cdef object c_create_oid_set(gss_OID_set mech_set, bint free=*)             # <<<<<<<<<<<<<<
888  * cdef OID c_make_oid(gss_OID oid)
889  *
890  */
891 struct __pyx_opt_args_6gssapi_3raw_17cython_converters_c_create_oid_set {
892   int __pyx_n;
893   int free;
894 };
895 
896 /* "gssapi/raw/oids.pxd":4
897  *
898  *
899  * cdef class OID:             # <<<<<<<<<<<<<<
900  *     # NB(directxman12): this is a pointer, not a gss_OID_desc
901  *     cdef gss_OID_desc raw_oid
902  */
903 struct __pyx_obj_6gssapi_3raw_4oids_OID {
904   PyObject_HEAD
905   struct __pyx_vtabstruct_6gssapi_3raw_4oids_OID *__pyx_vtab;
906   gss_OID_desc raw_oid;
907   int _free_on_dealloc;
908 };
909 
910 
911 /* "gssapi/raw/creds.pxd":4
912  *
913  *
914  * cdef class Creds:             # <<<<<<<<<<<<<<
915  *     cdef gss_cred_id_t raw_creds
916  *     cdef bint _free_on_dealloc
917  */
918 struct __pyx_obj_6gssapi_3raw_5creds_Creds {
919   PyObject_HEAD
920   gss_cred_id_t raw_creds;
921   int _free_on_dealloc;
922 };
923 
924 
925 /* "gssapi/raw/names.pxd":3
926  * from gssapi.raw.cython_types cimport gss_name_t
927  *
928  * cdef class Name:             # <<<<<<<<<<<<<<
929  *     cdef gss_name_t raw_name
930  *     cdef bint _free_on_dealloc
931  */
932 struct __pyx_obj_6gssapi_3raw_5names_Name {
933   PyObject_HEAD
934   gss_name_t raw_name;
935   int _free_on_dealloc;
936 };
937 
938 
939 /* "gssapi/raw/chan_bindings.pxd":5
940  * from gssapi.raw.cython_types cimport *
941  *
942  * cdef class ChannelBindings:             # <<<<<<<<<<<<<<
943  *     cdef public object initiator_address_type
944  *     cdef public bytes initiator_address
945  */
946 struct __pyx_obj_6gssapi_3raw_13chan_bindings_ChannelBindings {
947   PyObject_HEAD
948   struct __pyx_vtabstruct_6gssapi_3raw_13chan_bindings_ChannelBindings *__pyx_vtab;
949   PyObject *initiator_address_type;
950   PyObject *initiator_address;
951   PyObject *acceptor_address_type;
952   PyObject *acceptor_address;
953   PyObject *application_data;
954 };
955 
956 
957 /* "gssapi/raw/sec_contexts.pxd":3
958  * from gssapi.raw.cython_types cimport gss_ctx_id_t
959  *
960  * cdef class SecurityContext:             # <<<<<<<<<<<<<<
961  *     cdef gss_ctx_id_t raw_ctx
962  *     cdef bint _free_on_dealloc
963  */
964 struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext {
965   PyObject_HEAD
966   gss_ctx_id_t raw_ctx;
967   int _free_on_dealloc;
968 };
969 
970 
971 
972 /* "gssapi/raw/oids.pxd":4
973  *
974  *
975  * cdef class OID:             # <<<<<<<<<<<<<<
976  *     # NB(directxman12): this is a pointer, not a gss_OID_desc
977  *     cdef gss_OID_desc raw_oid
978  */
979 
980 struct __pyx_vtabstruct_6gssapi_3raw_4oids_OID {
981   int (*_copy_from)(struct __pyx_obj_6gssapi_3raw_4oids_OID *, gss_OID_desc);
982   int (*_from_bytes)(struct __pyx_obj_6gssapi_3raw_4oids_OID *, PyObject *);
983 };
984 static struct __pyx_vtabstruct_6gssapi_3raw_4oids_OID *__pyx_vtabptr_6gssapi_3raw_4oids_OID;
985 
986 
987 /* "gssapi/raw/chan_bindings.pxd":5
988  * from gssapi.raw.cython_types cimport *
989  *
990  * cdef class ChannelBindings:             # <<<<<<<<<<<<<<
991  *     cdef public object initiator_address_type
992  *     cdef public bytes initiator_address
993  */
994 
995 struct __pyx_vtabstruct_6gssapi_3raw_13chan_bindings_ChannelBindings {
996   gss_channel_bindings_t (*__pyx___cvalue__)(struct __pyx_obj_6gssapi_3raw_13chan_bindings_ChannelBindings *);
997 };
998 static struct __pyx_vtabstruct_6gssapi_3raw_13chan_bindings_ChannelBindings *__pyx_vtabptr_6gssapi_3raw_13chan_bindings_ChannelBindings;
999 
1000 /* --- Runtime support code (head) --- */
1001 /* Refnanny.proto */
1002 #ifndef CYTHON_REFNANNY
1003   #define CYTHON_REFNANNY 0
1004 #endif
1005 #if CYTHON_REFNANNY
1006   typedef struct {
1007     void (*INCREF)(void*, PyObject*, int);
1008     void (*DECREF)(void*, PyObject*, int);
1009     void (*GOTREF)(void*, PyObject*, int);
1010     void (*GIVEREF)(void*, PyObject*, int);
1011     void* (*SetupContext)(const char*, int, const char*);
1012     void (*FinishContext)(void**);
1013   } __Pyx_RefNannyAPIStruct;
1014   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1015   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1016   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1017 #ifdef WITH_THREAD
1018   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1019           if (acquire_gil) {\
1020               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1021               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1022               PyGILState_Release(__pyx_gilstate_save);\
1023           } else {\
1024               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1025           }
1026 #else
1027   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1028           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1029 #endif
1030   #define __Pyx_RefNannyFinishContext()\
1031           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1032   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1033   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1034   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1035   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1036   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1037   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1038   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1039   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1040 #else
1041   #define __Pyx_RefNannyDeclarations
1042   #define __Pyx_RefNannySetupContext(name, acquire_gil)
1043   #define __Pyx_RefNannyFinishContext()
1044   #define __Pyx_INCREF(r) Py_INCREF(r)
1045   #define __Pyx_DECREF(r) Py_DECREF(r)
1046   #define __Pyx_GOTREF(r)
1047   #define __Pyx_GIVEREF(r)
1048   #define __Pyx_XINCREF(r) Py_XINCREF(r)
1049   #define __Pyx_XDECREF(r) Py_XDECREF(r)
1050   #define __Pyx_XGOTREF(r)
1051   #define __Pyx_XGIVEREF(r)
1052 #endif
1053 #define __Pyx_XDECREF_SET(r, v) do {\
1054         PyObject *tmp = (PyObject *) r;\
1055         r = v; __Pyx_XDECREF(tmp);\
1056     } while (0)
1057 #define __Pyx_DECREF_SET(r, v) do {\
1058         PyObject *tmp = (PyObject *) r;\
1059         r = v; __Pyx_DECREF(tmp);\
1060     } while (0)
1061 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1062 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1063 
1064 /* PyObjectGetAttrStr.proto */
1065 #if CYTHON_USE_TYPE_SLOTS
1066 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1067 #else
1068 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1069 #endif
1070 
1071 /* GetBuiltinName.proto */
1072 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1073 
1074 /* RaiseDoubleKeywords.proto */
1075 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1076 
1077 /* ParseKeywords.proto */
1078 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1079     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1080     const char* function_name);
1081 
1082 /* RaiseArgTupleInvalid.proto */
1083 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1084     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1085 
1086 /* ArgTypeTest.proto */
1087 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1088     ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1089         __Pyx__ArgTypeTest(obj, type, name, exact))
1090 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1091 
1092 /* PyDictVersioning.proto */
1093 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1094 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
1095 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
1096 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1097     (version_var) = __PYX_GET_DICT_VERSION(dict);\
1098     (cache_var) = (value);
1099 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1100     static PY_UINT64_T __pyx_dict_version = 0;\
1101     static PyObject *__pyx_dict_cached_value = NULL;\
1102     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1103         (VAR) = __pyx_dict_cached_value;\
1104     } else {\
1105         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1106         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1107     }\
1108 }
1109 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1110 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1111 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1112 #else
1113 #define __PYX_GET_DICT_VERSION(dict)  (0)
1114 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1115 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
1116 #endif
1117 
1118 /* GetModuleGlobalName.proto */
1119 #if CYTHON_USE_DICT_VERSIONS
1120 #define __Pyx_GetModuleGlobalName(var, name)  {\
1121     static PY_UINT64_T __pyx_dict_version = 0;\
1122     static PyObject *__pyx_dict_cached_value = NULL;\
1123     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1124         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1125         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1126 }
1127 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
1128     PY_UINT64_T __pyx_dict_version;\
1129     PyObject *__pyx_dict_cached_value;\
1130     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1131 }
1132 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1133 #else
1134 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1135 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1136 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1137 #endif
1138 
1139 /* PyFunctionFastCall.proto */
1140 #if CYTHON_FAST_PYCALL
1141 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1142     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1143 #if 1 || PY_VERSION_HEX < 0x030600B1
1144 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1145 #else
1146 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1147 #endif
1148 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1149     (sizeof(char [1 - 2*!(cond)]) - 1)
1150 #ifndef Py_MEMBER_SIZE
1151 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1152 #endif
1153   static size_t __pyx_pyframe_localsplus_offset = 0;
1154   #include "frameobject.h"
1155   #define __Pxy_PyFrame_Initialize_Offsets()\
1156     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1157      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1158   #define __Pyx_PyFrame_GetLocalsplus(frame)\
1159     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1160 #endif
1161 
1162 /* PyCFunctionFastCall.proto */
1163 #if CYTHON_FAST_PYCCALL
1164 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1165 #else
1166 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
1167 #endif
1168 
1169 /* PyObjectCall.proto */
1170 #if CYTHON_COMPILING_IN_CPYTHON
1171 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1172 #else
1173 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1174 #endif
1175 
1176 /* PyThreadStateGet.proto */
1177 #if CYTHON_FAST_THREAD_STATE
1178 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
1179 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
1180 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
1181 #else
1182 #define __Pyx_PyThreadState_declare
1183 #define __Pyx_PyThreadState_assign
1184 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
1185 #endif
1186 
1187 /* PyErrFetchRestore.proto */
1188 #if CYTHON_FAST_THREAD_STATE
1189 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1190 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1191 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1192 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1193 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1194 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1195 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1196 #if CYTHON_COMPILING_IN_CPYTHON
1197 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1198 #else
1199 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1200 #endif
1201 #else
1202 #define __Pyx_PyErr_Clear() PyErr_Clear()
1203 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1204 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
1205 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
1206 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
1207 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
1208 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
1209 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
1210 #endif
1211 
1212 /* RaiseException.proto */
1213 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1214 
1215 /* WriteUnraisableException.proto */
1216 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1217                                   int lineno, const char *filename,
1218                                   int full_traceback, int nogil);
1219 
1220 /* PyObjectCallMethO.proto */
1221 #if CYTHON_COMPILING_IN_CPYTHON
1222 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1223 #endif
1224 
1225 /* PyObjectCallNoArg.proto */
1226 #if CYTHON_COMPILING_IN_CPYTHON
1227 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1228 #else
1229 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1230 #endif
1231 
1232 /* PyObject_GenericGetAttrNoDict.proto */
1233 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1234 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1235 #else
1236 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1237 #endif
1238 
1239 /* PyObject_GenericGetAttr.proto */
1240 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1241 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1242 #else
1243 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1244 #endif
1245 
1246 /* PyErrExceptionMatches.proto */
1247 #if CYTHON_FAST_THREAD_STATE
1248 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1249 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1250 #else
1251 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
1252 #endif
1253 
1254 /* PyObjectGetAttrStrNoError.proto */
1255 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1256 
1257 /* SetupReduce.proto */
1258 static int __Pyx_setup_reduce(PyObject* type_obj);
1259 
1260 /* TypeImport.proto */
1261 #ifndef __PYX_HAVE_RT_ImportType_proto
1262 #define __PYX_HAVE_RT_ImportType_proto
1263 enum __Pyx_ImportType_CheckSize {
1264    __Pyx_ImportType_CheckSize_Error = 0,
1265    __Pyx_ImportType_CheckSize_Warn = 1,
1266    __Pyx_ImportType_CheckSize_Ignore = 2
1267 };
1268 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1269 #endif
1270 
1271 /* GetVTable.proto */
1272 static void* __Pyx_GetVtable(PyObject *dict);
1273 
1274 /* Import.proto */
1275 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1276 
1277 /* ImportFrom.proto */
1278 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1279 
1280 /* CLineInTraceback.proto */
1281 #ifdef CYTHON_CLINE_IN_TRACEBACK
1282 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1283 #else
1284 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1285 #endif
1286 
1287 /* CodeObjectCache.proto */
1288 typedef struct {
1289     PyCodeObject* code_object;
1290     int code_line;
1291 } __Pyx_CodeObjectCacheEntry;
1292 struct __Pyx_CodeObjectCache {
1293     int count;
1294     int max_count;
1295     __Pyx_CodeObjectCacheEntry* entries;
1296 };
1297 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1298 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1299 static PyCodeObject *__pyx_find_code_object(int code_line);
1300 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1301 
1302 /* AddTraceback.proto */
1303 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1304                                int py_line, const char *filename);
1305 
1306 /* GCCDiagnostics.proto */
1307 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1308 #define __Pyx_HAS_GCC_DIAGNOSTIC
1309 #endif
1310 
1311 /* CIntToPy.proto */
1312 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);
1313 
1314 /* CIntFromPy.proto */
1315 static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *);
1316 
1317 /* CIntToPy.proto */
1318 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1319 
1320 /* CIntFromPy.proto */
1321 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1322 
1323 /* CIntFromPy.proto */
1324 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1325 
1326 /* FastTypeChecks.proto */
1327 #if CYTHON_COMPILING_IN_CPYTHON
1328 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1329 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1330 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1331 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1332 #else
1333 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1334 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1335 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1336 #endif
1337 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1338 
1339 /* CheckBinaryVersion.proto */
1340 static int __Pyx_check_binary_version(void);
1341 
1342 /* InitStrings.proto */
1343 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1344 
1345 
1346 /* Module declarations from 'libc.stdint' */
1347 
1348 /* Module declarations from 'gssapi.raw.cython_types' */
1349 
1350 /* Module declarations from 'libc.string' */
1351 
1352 /* Module declarations from 'libc.stdlib' */
1353 
1354 /* Module declarations from 'gssapi.raw.oids' */
1355 static PyTypeObject *__pyx_ptype_6gssapi_3raw_4oids_OID = 0;
1356 
1357 /* Module declarations from 'gssapi.raw.cython_converters' */
1358 static CYTHON_INLINE OM_uint32 __pyx_f_6gssapi_3raw_17cython_converters_c_py_ttl_to_c(PyObject *); /*proto*/
1359 static CYTHON_INLINE PyObject *__pyx_f_6gssapi_3raw_17cython_converters_c_c_ttl_to_py(OM_uint32); /*proto*/
1360 
1361 /* Module declarations from 'gssapi.raw.creds' */
1362 static PyTypeObject *__pyx_ptype_6gssapi_3raw_5creds_Creds = 0;
1363 
1364 /* Module declarations from 'gssapi.raw.names' */
1365 static PyTypeObject *__pyx_ptype_6gssapi_3raw_5names_Name = 0;
1366 
1367 /* Module declarations from 'gssapi.raw.chan_bindings' */
1368 static PyTypeObject *__pyx_ptype_6gssapi_3raw_13chan_bindings_ChannelBindings = 0;
1369 
1370 /* Module declarations from 'gssapi.raw.sec_contexts' */
1371 static PyTypeObject *__pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext = 0;
1372 #define __Pyx_MODULE_NAME "gssapi.raw.sec_contexts"
1373 extern int __pyx_module_is_main_gssapi__raw__sec_contexts;
1374 int __pyx_module_is_main_gssapi__raw__sec_contexts = 0;
1375 
1376 /* Implementation of 'gssapi.raw.sec_contexts' */
1377 static PyObject *__pyx_builtin_TypeError;
1378 static const char __pyx_k_oc[] = "oc";
1379 static const char __pyx_k_on[] = "on";
1380 static const char __pyx_k_sn[] = "sn";
1381 static const char __pyx_k_tn[] = "tn";
1382 static const char __pyx_k_cpy[] = "cpy";
1383 static const char __pyx_k_ctx[] = "ctx";
1384 static const char __pyx_k_res[] = "res";
1385 static const char __pyx_k_ttl[] = "ttl";
1386 static const char __pyx_k_BASE[] = "BASE";
1387 static const char __pyx_k_bdng[] = "bdng";
1388 static const char __pyx_k_main[] = "__main__";
1389 static const char __pyx_k_mech[] = "mech";
1390 static const char __pyx_k_name[] = "__name__";
1391 static const char __pyx_k_test[] = "__test__";
1392 static const char __pyx_k_creds[] = "creds";
1393 static const char __pyx_k_flags[] = "flags";
1394 static const char __pyx_k_token[] = "token";
1395 static const char __pyx_k_value[] = "value";
1396 static const char __pyx_k_GSSAPI[] = "GSSAPI";
1397 static const char __pyx_k_import[] = "__import__";
1398 static const char __pyx_k_length[] = "length";
1399 static const char __pyx_k_py_ttl[] = "py_ttl";
1400 static const char __pyx_k_reduce[] = "__reduce__";
1401 static const char __pyx_k_context[] = "context";
1402 static const char __pyx_k_ttl_ptr[] = "ttl_ptr";
1403 static const char __pyx_k_GSSError[] = "GSSError";
1404 static const char __pyx_k_MechType[] = "MechType";
1405 static const char __pyx_k_act_cred[] = "act_cred";
1406 static const char __pyx_k_complete[] = "complete";
1407 static const char __pyx_k_getstate[] = "__getstate__";
1408 static const char __pyx_k_lifetime[] = "lifetime";
1409 static const char __pyx_k_maj_stat[] = "maj_stat";
1410 static const char __pyx_k_mech_oid[] = "mech_oid";
1411 static const char __pyx_k_min_stat[] = "min_stat";
1412 static const char __pyx_k_py_flags[] = "py_flags";
1413 static const char __pyx_k_setstate[] = "__setstate__";
1414 static const char __pyx_k_TypeError[] = "TypeError";
1415 static const char __pyx_k_flags_ptr[] = "flags_ptr";
1416 static const char __pyx_k_input_ttl[] = "input_ttl";
1417 static const char __pyx_k_mech_type[] = "mech_type";
1418 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
1419 static const char __pyx_k_req_flags[] = "req_flags";
1420 static const char __pyx_k_res_token[] = "res_token";
1421 static const char __pyx_k_ret_flags[] = "ret_flags";
1422 static const char __pyx_k_local_only[] = "local_only";
1423 static const char __pyx_k_output_ttl[] = "output_ttl";
1424 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
1425 static const char __pyx_k_input_token[] = "input_token";
1426 static const char __pyx_k_is_complete[] = "is_complete";
1427 static const char __pyx_k_py_complete[] = "py_complete";
1428 static const char __pyx_k_target_name[] = "target_name";
1429 static const char __pyx_k_context_time[] = "context_time";
1430 static const char __pyx_k_locally_init[] = "locally_init";
1431 static const char __pyx_k_output_flags[] = "output_flags";
1432 static const char __pyx_k_output_token[] = "output_token";
1433 static const char __pyx_k_py_mech_type[] = "py_mech_type";
1434 static const char __pyx_k_tmp_min_stat[] = "tmp_min_stat";
1435 static const char __pyx_k_token_buffer[] = "token_buffer";
1436 static const char __pyx_k_init_name_ptr[] = "init_name_ptr";
1437 static const char __pyx_k_mech_type_ptr[] = "mech_type_ptr";
1438 static const char __pyx_k_output_ttl_py[] = "output_ttl_py";
1439 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
1440 static const char __pyx_k_IntEnumFlagSet[] = "IntEnumFlagSet";
1441 static const char __pyx_k_acceptor_creds[] = "acceptor_creds";
1442 static const char __pyx_k_delegated_cred[] = "delegated_cred";
1443 static const char __pyx_k_initiator_name[] = "initiator_name";
1444 static const char __pyx_k_output_context[] = "output_context";
1445 static const char __pyx_k_RequirementFlag[] = "RequirementFlag";
1446 static const char __pyx_k_SecurityContext[] = "SecurityContext";
1447 static const char __pyx_k_gssapi_raw_misc[] = "gssapi.raw.misc";
1448 static const char __pyx_k_inquire_context[] = "inquire_context";
1449 static const char __pyx_k_is_complete_ptr[] = "is_complete_ptr";
1450 static const char __pyx_k_py_locally_init[] = "py_locally_init";
1451 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
1452 static const char __pyx_k_target_name_ptr[] = "target_name_ptr";
1453 static const char __pyx_k_actual_mech_type[] = "actual_mech_type";
1454 static const char __pyx_k_channel_bindings[] = "channel_bindings";
1455 static const char __pyx_k_gssapi_raw_types[] = "gssapi.raw.types";
1456 static const char __pyx_k_init_sec_context[] = "init_sec_context";
1457 static const char __pyx_k_locally_init_ptr[] = "locally_init_ptr";
1458 static const char __pyx_k_output_init_name[] = "output_init_name";
1459 static const char __pyx_k_output_mech_type[] = "output_mech_type";
1460 static const char __pyx_k_act_acceptor_cred[] = "act_acceptor_cred";
1461 static const char __pyx_k_accept_sec_context[] = "accept_sec_context";
1462 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1463 static const char __pyx_k_delete_sec_context[] = "delete_sec_context";
1464 static const char __pyx_k_export_sec_context[] = "export_sec_context";
1465 static const char __pyx_k_import_sec_context[] = "import_sec_context";
1466 static const char __pyx_k_input_token_buffer[] = "input_token_buffer";
1467 static const char __pyx_k_output_target_name[] = "output_target_name";
1468 static const char __pyx_k_output_locally_init[] = "output_locally_init";
1469 static const char __pyx_k_output_token_buffer[] = "output_token_buffer";
1470 static const char __pyx_k_InitSecContextResult[] = "InitSecContextResult";
1471 static const char __pyx_k_InquireContextResult[] = "InquireContextResult";
1472 static const char __pyx_k_mutual_authentication[] = "mutual_authentication";
1473 static const char __pyx_k_process_context_token[] = "process_context_token";
1474 static const char __pyx_k_AcceptSecContextResult[] = "AcceptSecContextResult";
1475 static const char __pyx_k_gssapi_raw_named_tuples[] = "gssapi.raw.named_tuples";
1476 static const char __pyx_k_gssapi_raw_sec_contexts[] = "gssapi.raw.sec_contexts";
1477 static const char __pyx_k_out_of_sequence_detection[] = "out_of_sequence_detection";
1478 static const char __pyx_k_gssapi_raw_sec_contexts_pyx[] = "gssapi/raw/sec_contexts.pyx";
1479 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
1480 static PyObject *__pyx_n_s_AcceptSecContextResult;
1481 static PyObject *__pyx_n_s_BASE;
1482 static PyObject *__pyx_n_s_GSSAPI;
1483 static PyObject *__pyx_n_s_GSSError;
1484 static PyObject *__pyx_n_s_InitSecContextResult;
1485 static PyObject *__pyx_n_s_InquireContextResult;
1486 static PyObject *__pyx_n_s_IntEnumFlagSet;
1487 static PyObject *__pyx_n_s_MechType;
1488 static PyObject *__pyx_n_s_RequirementFlag;
1489 static PyObject *__pyx_n_s_SecurityContext;
1490 static PyObject *__pyx_n_s_TypeError;
1491 static PyObject *__pyx_n_s_accept_sec_context;
1492 static PyObject *__pyx_n_s_acceptor_creds;
1493 static PyObject *__pyx_n_s_act_acceptor_cred;
1494 static PyObject *__pyx_n_s_act_cred;
1495 static PyObject *__pyx_n_s_actual_mech_type;
1496 static PyObject *__pyx_n_s_bdng;
1497 static PyObject *__pyx_n_s_channel_bindings;
1498 static PyObject *__pyx_n_s_cline_in_traceback;
1499 static PyObject *__pyx_n_s_complete;
1500 static PyObject *__pyx_n_s_context;
1501 static PyObject *__pyx_n_s_context_time;
1502 static PyObject *__pyx_n_s_cpy;
1503 static PyObject *__pyx_n_s_creds;
1504 static PyObject *__pyx_n_s_ctx;
1505 static PyObject *__pyx_n_s_delegated_cred;
1506 static PyObject *__pyx_n_s_delete_sec_context;
1507 static PyObject *__pyx_n_s_export_sec_context;
1508 static PyObject *__pyx_n_s_flags;
1509 static PyObject *__pyx_n_s_flags_ptr;
1510 static PyObject *__pyx_n_s_getstate;
1511 static PyObject *__pyx_n_s_gssapi_raw_misc;
1512 static PyObject *__pyx_n_s_gssapi_raw_named_tuples;
1513 static PyObject *__pyx_n_s_gssapi_raw_sec_contexts;
1514 static PyObject *__pyx_kp_s_gssapi_raw_sec_contexts_pyx;
1515 static PyObject *__pyx_n_s_gssapi_raw_types;
1516 static PyObject *__pyx_n_s_import;
1517 static PyObject *__pyx_n_s_import_sec_context;
1518 static PyObject *__pyx_n_s_init_name_ptr;
1519 static PyObject *__pyx_n_s_init_sec_context;
1520 static PyObject *__pyx_n_s_initiator_name;
1521 static PyObject *__pyx_n_s_input_token;
1522 static PyObject *__pyx_n_s_input_token_buffer;
1523 static PyObject *__pyx_n_s_input_ttl;
1524 static PyObject *__pyx_n_s_inquire_context;
1525 static PyObject *__pyx_n_s_is_complete;
1526 static PyObject *__pyx_n_s_is_complete_ptr;
1527 static PyObject *__pyx_n_s_length;
1528 static PyObject *__pyx_n_s_lifetime;
1529 static PyObject *__pyx_n_s_local_only;
1530 static PyObject *__pyx_n_s_locally_init;
1531 static PyObject *__pyx_n_s_locally_init_ptr;
1532 static PyObject *__pyx_n_s_main;
1533 static PyObject *__pyx_n_s_maj_stat;
1534 static PyObject *__pyx_n_s_mech;
1535 static PyObject *__pyx_n_s_mech_oid;
1536 static PyObject *__pyx_n_s_mech_type;
1537 static PyObject *__pyx_n_s_mech_type_ptr;
1538 static PyObject *__pyx_n_s_min_stat;
1539 static PyObject *__pyx_n_s_mutual_authentication;
1540 static PyObject *__pyx_n_s_name;
1541 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
1542 static PyObject *__pyx_n_s_oc;
1543 static PyObject *__pyx_n_s_on;
1544 static PyObject *__pyx_n_s_out_of_sequence_detection;
1545 static PyObject *__pyx_n_s_output_context;
1546 static PyObject *__pyx_n_s_output_flags;
1547 static PyObject *__pyx_n_s_output_init_name;
1548 static PyObject *__pyx_n_s_output_locally_init;
1549 static PyObject *__pyx_n_s_output_mech_type;
1550 static PyObject *__pyx_n_s_output_target_name;
1551 static PyObject *__pyx_n_s_output_token;
1552 static PyObject *__pyx_n_s_output_token_buffer;
1553 static PyObject *__pyx_n_s_output_ttl;
1554 static PyObject *__pyx_n_s_output_ttl_py;
1555 static PyObject *__pyx_n_s_process_context_token;
1556 static PyObject *__pyx_n_s_py_complete;
1557 static PyObject *__pyx_n_s_py_flags;
1558 static PyObject *__pyx_n_s_py_locally_init;
1559 static PyObject *__pyx_n_s_py_mech_type;
1560 static PyObject *__pyx_n_s_py_ttl;
1561 static PyObject *__pyx_n_s_pyx_vtable;
1562 static PyObject *__pyx_n_s_reduce;
1563 static PyObject *__pyx_n_s_reduce_cython;
1564 static PyObject *__pyx_n_s_reduce_ex;
1565 static PyObject *__pyx_n_s_req_flags;
1566 static PyObject *__pyx_n_s_res;
1567 static PyObject *__pyx_n_s_res_token;
1568 static PyObject *__pyx_n_s_ret_flags;
1569 static PyObject *__pyx_n_s_setstate;
1570 static PyObject *__pyx_n_s_setstate_cython;
1571 static PyObject *__pyx_n_s_sn;
1572 static PyObject *__pyx_n_s_target_name;
1573 static PyObject *__pyx_n_s_target_name_ptr;
1574 static PyObject *__pyx_n_s_test;
1575 static PyObject *__pyx_n_s_tmp_min_stat;
1576 static PyObject *__pyx_n_s_tn;
1577 static PyObject *__pyx_n_s_token;
1578 static PyObject *__pyx_n_s_token_buffer;
1579 static PyObject *__pyx_n_s_ttl;
1580 static PyObject *__pyx_n_s_ttl_ptr;
1581 static PyObject *__pyx_n_s_value;
1582 static int __pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext___cinit__(struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_cpy); /* proto */
1583 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext_8_started___get__(struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_self); /* proto */
1584 static void __pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext_2__dealloc__(struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_self); /* proto */
1585 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_self); /* proto */
1586 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1587 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_init_sec_context(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_5names_Name *__pyx_v_target_name, struct __pyx_obj_6gssapi_3raw_5creds_Creds *__pyx_v_creds, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, struct __pyx_obj_6gssapi_3raw_4oids_OID *__pyx_v_mech, PyObject *__pyx_v_flags, PyObject *__pyx_v_lifetime, struct __pyx_obj_6gssapi_3raw_13chan_bindings_ChannelBindings *__pyx_v_channel_bindings, PyObject *__pyx_v_input_token); /* proto */
1588 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_2accept_sec_context(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input_token, struct __pyx_obj_6gssapi_3raw_5creds_Creds *__pyx_v_acceptor_creds, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, struct __pyx_obj_6gssapi_3raw_13chan_bindings_ChannelBindings *__pyx_v_channel_bindings); /* proto */
1589 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_4inquire_context(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, PyObject *__pyx_v_initiator_name, PyObject *__pyx_v_target_name, PyObject *__pyx_v_lifetime, PyObject *__pyx_v_mech, PyObject *__pyx_v_flags, PyObject *__pyx_v_locally_init, PyObject *__pyx_v_complete); /* proto */
1590 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_6context_time(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context); /* proto */
1591 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_8process_context_token(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, PyObject *__pyx_v_token); /* proto */
1592 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_10import_sec_context(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_token); /* proto */
1593 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_12export_sec_context(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context); /* proto */
1594 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_14delete_sec_context(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, PyObject *__pyx_v_local_only); /* proto */
1595 static PyObject *__pyx_tp_new_6gssapi_3raw_12sec_contexts_SecurityContext(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1596 static PyObject *__pyx_tuple_;
1597 static PyObject *__pyx_tuple__2;
1598 static PyObject *__pyx_tuple__3;
1599 static PyObject *__pyx_tuple__5;
1600 static PyObject *__pyx_tuple__7;
1601 static PyObject *__pyx_tuple__9;
1602 static PyObject *__pyx_tuple__11;
1603 static PyObject *__pyx_tuple__13;
1604 static PyObject *__pyx_tuple__15;
1605 static PyObject *__pyx_tuple__17;
1606 static PyObject *__pyx_codeobj__4;
1607 static PyObject *__pyx_codeobj__6;
1608 static PyObject *__pyx_codeobj__8;
1609 static PyObject *__pyx_codeobj__10;
1610 static PyObject *__pyx_codeobj__12;
1611 static PyObject *__pyx_codeobj__14;
1612 static PyObject *__pyx_codeobj__16;
1613 static PyObject *__pyx_codeobj__18;
1614 /* Late includes */
1615 
1616 /* "gssapi/raw/sec_contexts.pyx":84
1617  *     # cdef gss_ctx_id_t raw_ctx
1618  *
1619  *     def __cinit__(self, SecurityContext cpy=None):             # <<<<<<<<<<<<<<
1620  *         if cpy is not None:
1621  *             self.raw_ctx = cpy.raw_ctx
1622  */
1623 
1624 /* Python wrapper */
1625 static int __pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_1__cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)1626 static int __pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1627   struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_cpy = 0;
1628   int __pyx_lineno = 0;
1629   const char *__pyx_filename = NULL;
1630   int __pyx_clineno = 0;
1631   int __pyx_r;
1632   __Pyx_RefNannyDeclarations
1633   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
1634   {
1635     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cpy,0};
1636     PyObject* values[1] = {0};
1637     values[0] = (PyObject *)((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)Py_None);
1638     if (unlikely(__pyx_kwds)) {
1639       Py_ssize_t kw_args;
1640       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1641       switch (pos_args) {
1642         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1643         CYTHON_FALLTHROUGH;
1644         case  0: break;
1645         default: goto __pyx_L5_argtuple_error;
1646       }
1647       kw_args = PyDict_Size(__pyx_kwds);
1648       switch (pos_args) {
1649         case  0:
1650         if (kw_args > 0) {
1651           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cpy);
1652           if (value) { values[0] = value; kw_args--; }
1653         }
1654       }
1655       if (unlikely(kw_args > 0)) {
1656         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 84, __pyx_L3_error)
1657       }
1658     } else {
1659       switch (PyTuple_GET_SIZE(__pyx_args)) {
1660         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1661         CYTHON_FALLTHROUGH;
1662         case  0: break;
1663         default: goto __pyx_L5_argtuple_error;
1664       }
1665     }
1666     __pyx_v_cpy = ((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)values[0]);
1667   }
1668   goto __pyx_L4_argument_unpacking_done;
1669   __pyx_L5_argtuple_error:;
1670   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 84, __pyx_L3_error)
1671   __pyx_L3_error:;
1672   __Pyx_AddTraceback("gssapi.raw.sec_contexts.SecurityContext.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1673   __Pyx_RefNannyFinishContext();
1674   return -1;
1675   __pyx_L4_argument_unpacking_done:;
1676   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cpy), __pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext, 1, "cpy", 0))) __PYX_ERR(1, 84, __pyx_L1_error)
1677   __pyx_r = __pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext___cinit__(((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)__pyx_v_self), __pyx_v_cpy);
1678 
1679   /* function exit code */
1680   goto __pyx_L0;
1681   __pyx_L1_error:;
1682   __pyx_r = -1;
1683   __pyx_L0:;
1684   __Pyx_RefNannyFinishContext();
1685   return __pyx_r;
1686 }
1687 
__pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext___cinit__(struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_self,struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_cpy)1688 static int __pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext___cinit__(struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_cpy) {
1689   int __pyx_r;
1690   __Pyx_RefNannyDeclarations
1691   int __pyx_t_1;
1692   int __pyx_t_2;
1693   gss_ctx_id_t __pyx_t_3;
1694   __Pyx_RefNannySetupContext("__cinit__", 0);
1695 
1696   /* "gssapi/raw/sec_contexts.pyx":85
1697  *
1698  *     def __cinit__(self, SecurityContext cpy=None):
1699  *         if cpy is not None:             # <<<<<<<<<<<<<<
1700  *             self.raw_ctx = cpy.raw_ctx
1701  *             cpy.raw_ctx = GSS_C_NO_CONTEXT
1702  */
1703   __pyx_t_1 = (((PyObject *)__pyx_v_cpy) != Py_None);
1704   __pyx_t_2 = (__pyx_t_1 != 0);
1705   if (__pyx_t_2) {
1706 
1707     /* "gssapi/raw/sec_contexts.pyx":86
1708  *     def __cinit__(self, SecurityContext cpy=None):
1709  *         if cpy is not None:
1710  *             self.raw_ctx = cpy.raw_ctx             # <<<<<<<<<<<<<<
1711  *             cpy.raw_ctx = GSS_C_NO_CONTEXT
1712  *         else:
1713  */
1714     __pyx_t_3 = __pyx_v_cpy->raw_ctx;
1715     __pyx_v_self->raw_ctx = __pyx_t_3;
1716 
1717     /* "gssapi/raw/sec_contexts.pyx":87
1718  *         if cpy is not None:
1719  *             self.raw_ctx = cpy.raw_ctx
1720  *             cpy.raw_ctx = GSS_C_NO_CONTEXT             # <<<<<<<<<<<<<<
1721  *         else:
1722  *             self.raw_ctx = GSS_C_NO_CONTEXT
1723  */
1724     __pyx_v_cpy->raw_ctx = GSS_C_NO_CONTEXT;
1725 
1726     /* "gssapi/raw/sec_contexts.pyx":85
1727  *
1728  *     def __cinit__(self, SecurityContext cpy=None):
1729  *         if cpy is not None:             # <<<<<<<<<<<<<<
1730  *             self.raw_ctx = cpy.raw_ctx
1731  *             cpy.raw_ctx = GSS_C_NO_CONTEXT
1732  */
1733     goto __pyx_L3;
1734   }
1735 
1736   /* "gssapi/raw/sec_contexts.pyx":89
1737  *             cpy.raw_ctx = GSS_C_NO_CONTEXT
1738  *         else:
1739  *             self.raw_ctx = GSS_C_NO_CONTEXT             # <<<<<<<<<<<<<<
1740  *
1741  *     property _started:
1742  */
1743   /*else*/ {
1744     __pyx_v_self->raw_ctx = GSS_C_NO_CONTEXT;
1745   }
1746   __pyx_L3:;
1747 
1748   /* "gssapi/raw/sec_contexts.pyx":84
1749  *     # cdef gss_ctx_id_t raw_ctx
1750  *
1751  *     def __cinit__(self, SecurityContext cpy=None):             # <<<<<<<<<<<<<<
1752  *         if cpy is not None:
1753  *             self.raw_ctx = cpy.raw_ctx
1754  */
1755 
1756   /* function exit code */
1757   __pyx_r = 0;
1758   __Pyx_RefNannyFinishContext();
1759   return __pyx_r;
1760 }
1761 
1762 /* "gssapi/raw/sec_contexts.pyx":94
1763  *         """Whether the underlying context is NULL."""
1764  *
1765  *         def __get__(self):             # <<<<<<<<<<<<<<
1766  *             return self.raw_ctx is not NULL
1767  *
1768  */
1769 
1770 /* Python wrapper */
1771 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_8_started_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_8_started_1__get__(PyObject * __pyx_v_self)1772 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_8_started_1__get__(PyObject *__pyx_v_self) {
1773   PyObject *__pyx_r = 0;
1774   __Pyx_RefNannyDeclarations
1775   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
1776   __pyx_r = __pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext_8_started___get__(((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)__pyx_v_self));
1777 
1778   /* function exit code */
1779   __Pyx_RefNannyFinishContext();
1780   return __pyx_r;
1781 }
1782 
__pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext_8_started___get__(struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_self)1783 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext_8_started___get__(struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_self) {
1784   PyObject *__pyx_r = NULL;
1785   __Pyx_RefNannyDeclarations
1786   PyObject *__pyx_t_1 = NULL;
1787   int __pyx_lineno = 0;
1788   const char *__pyx_filename = NULL;
1789   int __pyx_clineno = 0;
1790   __Pyx_RefNannySetupContext("__get__", 0);
1791 
1792   /* "gssapi/raw/sec_contexts.pyx":95
1793  *
1794  *         def __get__(self):
1795  *             return self.raw_ctx is not NULL             # <<<<<<<<<<<<<<
1796  *
1797  *     def __dealloc__(self):
1798  */
1799   __Pyx_XDECREF(__pyx_r);
1800   __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->raw_ctx != NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 95, __pyx_L1_error)
1801   __Pyx_GOTREF(__pyx_t_1);
1802   __pyx_r = __pyx_t_1;
1803   __pyx_t_1 = 0;
1804   goto __pyx_L0;
1805 
1806   /* "gssapi/raw/sec_contexts.pyx":94
1807  *         """Whether the underlying context is NULL."""
1808  *
1809  *         def __get__(self):             # <<<<<<<<<<<<<<
1810  *             return self.raw_ctx is not NULL
1811  *
1812  */
1813 
1814   /* function exit code */
1815   __pyx_L1_error:;
1816   __Pyx_XDECREF(__pyx_t_1);
1817   __Pyx_AddTraceback("gssapi.raw.sec_contexts.SecurityContext._started.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1818   __pyx_r = NULL;
1819   __pyx_L0:;
1820   __Pyx_XGIVEREF(__pyx_r);
1821   __Pyx_RefNannyFinishContext();
1822   return __pyx_r;
1823 }
1824 
1825 /* "gssapi/raw/sec_contexts.pyx":97
1826  *             return self.raw_ctx is not NULL
1827  *
1828  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
1829  *         # basically just deleteSecContext, but we are not
1830  *         # allowed to call methods here
1831  */
1832 
1833 /* Python wrapper */
1834 static void __pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_3__dealloc__(PyObject * __pyx_v_self)1835 static void __pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_3__dealloc__(PyObject *__pyx_v_self) {
1836   __Pyx_RefNannyDeclarations
1837   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
1838   __pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext_2__dealloc__(((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)__pyx_v_self));
1839 
1840   /* function exit code */
1841   __Pyx_RefNannyFinishContext();
1842 }
1843 
__pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext_2__dealloc__(struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_self)1844 static void __pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext_2__dealloc__(struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_self) {
1845   OM_uint32 __pyx_v_maj_stat;
1846   OM_uint32 __pyx_v_min_stat;
1847   __Pyx_RefNannyDeclarations
1848   int __pyx_t_1;
1849   PyObject *__pyx_t_2 = NULL;
1850   PyObject *__pyx_t_3 = NULL;
1851   PyObject *__pyx_t_4 = NULL;
1852   PyObject *__pyx_t_5 = NULL;
1853   PyObject *__pyx_t_6 = NULL;
1854   int __pyx_t_7;
1855   PyObject *__pyx_t_8 = NULL;
1856   int __pyx_lineno = 0;
1857   const char *__pyx_filename = NULL;
1858   int __pyx_clineno = 0;
1859   __Pyx_RefNannySetupContext("__dealloc__", 0);
1860 
1861   /* "gssapi/raw/sec_contexts.pyx":101
1862  *         # allowed to call methods here
1863  *         cdef OM_uint32 maj_stat, min_stat
1864  *         if self.raw_ctx is not GSS_C_NO_CONTEXT:             # <<<<<<<<<<<<<<
1865  *             # local deletion only
1866  *             maj_stat = gss_delete_sec_context(&min_stat, &self.raw_ctx,
1867  */
1868   __pyx_t_1 = ((__pyx_v_self->raw_ctx != GSS_C_NO_CONTEXT) != 0);
1869   if (__pyx_t_1) {
1870 
1871     /* "gssapi/raw/sec_contexts.pyx":103
1872  *         if self.raw_ctx is not GSS_C_NO_CONTEXT:
1873  *             # local deletion only
1874  *             maj_stat = gss_delete_sec_context(&min_stat, &self.raw_ctx,             # <<<<<<<<<<<<<<
1875  *                                               GSS_C_NO_BUFFER)
1876  *             if maj_stat != GSS_S_COMPLETE:
1877  */
1878     __pyx_v_maj_stat = gss_delete_sec_context((&__pyx_v_min_stat), (&__pyx_v_self->raw_ctx), GSS_C_NO_BUFFER);
1879 
1880     /* "gssapi/raw/sec_contexts.pyx":105
1881  *             maj_stat = gss_delete_sec_context(&min_stat, &self.raw_ctx,
1882  *                                               GSS_C_NO_BUFFER)
1883  *             if maj_stat != GSS_S_COMPLETE:             # <<<<<<<<<<<<<<
1884  *                 raise GSSError(maj_stat, min_stat)
1885  *
1886  */
1887     __pyx_t_1 = ((__pyx_v_maj_stat != GSS_S_COMPLETE) != 0);
1888     if (unlikely(__pyx_t_1)) {
1889 
1890       /* "gssapi/raw/sec_contexts.pyx":106
1891  *                                               GSS_C_NO_BUFFER)
1892  *             if maj_stat != GSS_S_COMPLETE:
1893  *                 raise GSSError(maj_stat, min_stat)             # <<<<<<<<<<<<<<
1894  *
1895  *             self.raw_ctx = NULL
1896  */
1897       __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_GSSError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 106, __pyx_L1_error)
1898       __Pyx_GOTREF(__pyx_t_3);
1899       __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_maj_stat); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 106, __pyx_L1_error)
1900       __Pyx_GOTREF(__pyx_t_4);
1901       __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_min_stat); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 106, __pyx_L1_error)
1902       __Pyx_GOTREF(__pyx_t_5);
1903       __pyx_t_6 = NULL;
1904       __pyx_t_7 = 0;
1905       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
1906         __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
1907         if (likely(__pyx_t_6)) {
1908           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
1909           __Pyx_INCREF(__pyx_t_6);
1910           __Pyx_INCREF(function);
1911           __Pyx_DECREF_SET(__pyx_t_3, function);
1912           __pyx_t_7 = 1;
1913         }
1914       }
1915       #if CYTHON_FAST_PYCALL
1916       if (PyFunction_Check(__pyx_t_3)) {
1917         PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
1918         __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 106, __pyx_L1_error)
1919         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
1920         __Pyx_GOTREF(__pyx_t_2);
1921         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1922         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1923       } else
1924       #endif
1925       #if CYTHON_FAST_PYCCALL
1926       if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
1927         PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
1928         __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 106, __pyx_L1_error)
1929         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
1930         __Pyx_GOTREF(__pyx_t_2);
1931         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1932         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1933       } else
1934       #endif
1935       {
1936         __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 106, __pyx_L1_error)
1937         __Pyx_GOTREF(__pyx_t_8);
1938         if (__pyx_t_6) {
1939           __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
1940         }
1941         __Pyx_GIVEREF(__pyx_t_4);
1942         PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
1943         __Pyx_GIVEREF(__pyx_t_5);
1944         PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
1945         __pyx_t_4 = 0;
1946         __pyx_t_5 = 0;
1947         __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 106, __pyx_L1_error)
1948         __Pyx_GOTREF(__pyx_t_2);
1949         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
1950       }
1951       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1952       __Pyx_Raise(__pyx_t_2, 0, 0, 0);
1953       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1954       __PYX_ERR(1, 106, __pyx_L1_error)
1955 
1956       /* "gssapi/raw/sec_contexts.pyx":105
1957  *             maj_stat = gss_delete_sec_context(&min_stat, &self.raw_ctx,
1958  *                                               GSS_C_NO_BUFFER)
1959  *             if maj_stat != GSS_S_COMPLETE:             # <<<<<<<<<<<<<<
1960  *                 raise GSSError(maj_stat, min_stat)
1961  *
1962  */
1963     }
1964 
1965     /* "gssapi/raw/sec_contexts.pyx":108
1966  *                 raise GSSError(maj_stat, min_stat)
1967  *
1968  *             self.raw_ctx = NULL             # <<<<<<<<<<<<<<
1969  *
1970  *
1971  */
1972     __pyx_v_self->raw_ctx = NULL;
1973 
1974     /* "gssapi/raw/sec_contexts.pyx":101
1975  *         # allowed to call methods here
1976  *         cdef OM_uint32 maj_stat, min_stat
1977  *         if self.raw_ctx is not GSS_C_NO_CONTEXT:             # <<<<<<<<<<<<<<
1978  *             # local deletion only
1979  *             maj_stat = gss_delete_sec_context(&min_stat, &self.raw_ctx,
1980  */
1981   }
1982 
1983   /* "gssapi/raw/sec_contexts.pyx":97
1984  *             return self.raw_ctx is not NULL
1985  *
1986  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
1987  *         # basically just deleteSecContext, but we are not
1988  *         # allowed to call methods here
1989  */
1990 
1991   /* function exit code */
1992   goto __pyx_L0;
1993   __pyx_L1_error:;
1994   __Pyx_XDECREF(__pyx_t_2);
1995   __Pyx_XDECREF(__pyx_t_3);
1996   __Pyx_XDECREF(__pyx_t_4);
1997   __Pyx_XDECREF(__pyx_t_5);
1998   __Pyx_XDECREF(__pyx_t_6);
1999   __Pyx_XDECREF(__pyx_t_8);
2000   __Pyx_WriteUnraisable("gssapi.raw.sec_contexts.SecurityContext.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
2001   __pyx_L0:;
2002   __Pyx_RefNannyFinishContext();
2003 }
2004 
2005 /* "(tree fragment)":1
2006  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
2007  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2008  * def __setstate_cython__(self, __pyx_state):
2009  */
2010 
2011 /* Python wrapper */
2012 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_5__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)2013 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2014   PyObject *__pyx_r = 0;
2015   __Pyx_RefNannyDeclarations
2016   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
2017   __pyx_r = __pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext_4__reduce_cython__(((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)__pyx_v_self));
2018 
2019   /* function exit code */
2020   __Pyx_RefNannyFinishContext();
2021   return __pyx_r;
2022 }
2023 
__pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_self)2024 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_self) {
2025   PyObject *__pyx_r = NULL;
2026   __Pyx_RefNannyDeclarations
2027   PyObject *__pyx_t_1 = NULL;
2028   int __pyx_lineno = 0;
2029   const char *__pyx_filename = NULL;
2030   int __pyx_clineno = 0;
2031   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
2032 
2033   /* "(tree fragment)":2
2034  * def __reduce_cython__(self):
2035  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
2036  * def __setstate_cython__(self, __pyx_state):
2037  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2038  */
2039   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
2040   __Pyx_GOTREF(__pyx_t_1);
2041   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2042   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2043   __PYX_ERR(0, 2, __pyx_L1_error)
2044 
2045   /* "(tree fragment)":1
2046  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
2047  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2048  * def __setstate_cython__(self, __pyx_state):
2049  */
2050 
2051   /* function exit code */
2052   __pyx_L1_error:;
2053   __Pyx_XDECREF(__pyx_t_1);
2054   __Pyx_AddTraceback("gssapi.raw.sec_contexts.SecurityContext.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2055   __pyx_r = NULL;
2056   __Pyx_XGIVEREF(__pyx_r);
2057   __Pyx_RefNannyFinishContext();
2058   return __pyx_r;
2059 }
2060 
2061 /* "(tree fragment)":3
2062  * def __reduce_cython__(self):
2063  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2064  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
2065  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2066  */
2067 
2068 /* Python wrapper */
2069 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_7__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)2070 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
2071   PyObject *__pyx_r = 0;
2072   __Pyx_RefNannyDeclarations
2073   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
2074   __pyx_r = __pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext_6__setstate_cython__(((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
2075 
2076   /* function exit code */
2077   __Pyx_RefNannyFinishContext();
2078   return __pyx_r;
2079 }
2080 
__pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)2081 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_15SecurityContext_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
2082   PyObject *__pyx_r = NULL;
2083   __Pyx_RefNannyDeclarations
2084   PyObject *__pyx_t_1 = NULL;
2085   int __pyx_lineno = 0;
2086   const char *__pyx_filename = NULL;
2087   int __pyx_clineno = 0;
2088   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
2089 
2090   /* "(tree fragment)":4
2091  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2092  * def __setstate_cython__(self, __pyx_state):
2093  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
2094  */
2095   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
2096   __Pyx_GOTREF(__pyx_t_1);
2097   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2098   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2099   __PYX_ERR(0, 4, __pyx_L1_error)
2100 
2101   /* "(tree fragment)":3
2102  * def __reduce_cython__(self):
2103  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2104  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
2105  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
2106  */
2107 
2108   /* function exit code */
2109   __pyx_L1_error:;
2110   __Pyx_XDECREF(__pyx_t_1);
2111   __Pyx_AddTraceback("gssapi.raw.sec_contexts.SecurityContext.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2112   __pyx_r = NULL;
2113   __Pyx_XGIVEREF(__pyx_r);
2114   __Pyx_RefNannyFinishContext();
2115   return __pyx_r;
2116 }
2117 
2118 /* "gssapi/raw/sec_contexts.pyx":112
2119  *
2120  * # TODO(directxman12): figure out whether GSS_C_NO_NAME can be passed in here
2121  * def init_sec_context(Name target_name not None, Creds creds=None,             # <<<<<<<<<<<<<<
2122  *                      SecurityContext context=None,
2123  *                      OID mech=None,
2124  */
2125 
2126 /* Python wrapper */
2127 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_1init_sec_context(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2128 static char __pyx_doc_6gssapi_3raw_12sec_contexts_init_sec_context[] = "\n    init_sec_context(target_name, creds=None, context=None, mech=None, flags=None, lifetime=None, channel_bindings=None, input_token=None)\n    Initiate a GSSAPI security context.\n\n    This method initiates a GSSAPI security context, targeting the given\n    target name.  To create a basic context, just provide the target name.\n    Further calls used to update the context should pass in the output context\n    of the last call, as well as the input token received from the acceptor.\n\n    Warning:\n        This changes the input context!\n\n    Args:\n        target_name (Name): the target for the security context\n        creds (Creds): the credentials to use to initiate the context,\n            or None to use the default credentials\n        context (SecurityContext): the security context to update, or\n            None to create a new context\n        mech (MechType): the mechanism type for this security context,\n            or None for the default mechanism type\n        flags (list): the flags to request for the security context, or\n            None to use the default set: mutual_authentication and\n            out_of_sequence_detection.  This may also be an\n            :class:`IntEnumFlagSet`\n        lifetime (int): the request lifetime of the security context (a value\n            of 0 or None means indefinite)\n        channel_bindings (ChannelBindings): The channel bindings (or None for\n            no channel bindings)\n        input_token (bytes): the token to use to update the security context,\n            or None if you are creating a new context\n\n    Returns:\n        InitSecContextResult: the output security context, the actual mech\n        type, the actual flags used, the output token to send to the acceptor,\n        the actual lifetime of the context (or None if not supported or\n        indefinite), and whether or not more calls are needed to finish the\n        initiation.\n\n    Raises:\n        InvalidTokenError\n        InvalidCr""edentialsError\n        MissingCredentialsError\n        ExpiredCredentialsError\n        BadChannelBindingsError\n        BadMICError\n        ExpiredTokenError\n        DuplicateTokenError\n        MissingContextError\n        BadNameTypeError\n        BadNameError\n        BadMechanismError\n    ";
2129 static PyMethodDef __pyx_mdef_6gssapi_3raw_12sec_contexts_1init_sec_context = {"init_sec_context", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gssapi_3raw_12sec_contexts_1init_sec_context, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gssapi_3raw_12sec_contexts_init_sec_context};
__pyx_pw_6gssapi_3raw_12sec_contexts_1init_sec_context(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2130 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_1init_sec_context(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2131   struct __pyx_obj_6gssapi_3raw_5names_Name *__pyx_v_target_name = 0;
2132   struct __pyx_obj_6gssapi_3raw_5creds_Creds *__pyx_v_creds = 0;
2133   struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context = 0;
2134   struct __pyx_obj_6gssapi_3raw_4oids_OID *__pyx_v_mech = 0;
2135   PyObject *__pyx_v_flags = 0;
2136   PyObject *__pyx_v_lifetime = 0;
2137   struct __pyx_obj_6gssapi_3raw_13chan_bindings_ChannelBindings *__pyx_v_channel_bindings = 0;
2138   PyObject *__pyx_v_input_token = 0;
2139   int __pyx_lineno = 0;
2140   const char *__pyx_filename = NULL;
2141   int __pyx_clineno = 0;
2142   PyObject *__pyx_r = 0;
2143   __Pyx_RefNannyDeclarations
2144   __Pyx_RefNannySetupContext("init_sec_context (wrapper)", 0);
2145   {
2146     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_target_name,&__pyx_n_s_creds,&__pyx_n_s_context,&__pyx_n_s_mech,&__pyx_n_s_flags,&__pyx_n_s_lifetime,&__pyx_n_s_channel_bindings,&__pyx_n_s_input_token,0};
2147     PyObject* values[8] = {0,0,0,0,0,0,0,0};
2148     values[1] = (PyObject *)((struct __pyx_obj_6gssapi_3raw_5creds_Creds *)Py_None);
2149 
2150     /* "gssapi/raw/sec_contexts.pyx":113
2151  * # TODO(directxman12): figure out whether GSS_C_NO_NAME can be passed in here
2152  * def init_sec_context(Name target_name not None, Creds creds=None,
2153  *                      SecurityContext context=None,             # <<<<<<<<<<<<<<
2154  *                      OID mech=None,
2155  *                      flags=None, lifetime=None,
2156  */
2157     values[2] = (PyObject *)((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)Py_None);
2158 
2159     /* "gssapi/raw/sec_contexts.pyx":114
2160  * def init_sec_context(Name target_name not None, Creds creds=None,
2161  *                      SecurityContext context=None,
2162  *                      OID mech=None,             # <<<<<<<<<<<<<<
2163  *                      flags=None, lifetime=None,
2164  *                      ChannelBindings channel_bindings=None,
2165  */
2166     values[3] = (PyObject *)((struct __pyx_obj_6gssapi_3raw_4oids_OID *)Py_None);
2167 
2168     /* "gssapi/raw/sec_contexts.pyx":115
2169  *                      SecurityContext context=None,
2170  *                      OID mech=None,
2171  *                      flags=None, lifetime=None,             # <<<<<<<<<<<<<<
2172  *                      ChannelBindings channel_bindings=None,
2173  *                      input_token=None):
2174  */
2175     values[4] = ((PyObject *)Py_None);
2176     values[5] = ((PyObject *)Py_None);
2177 
2178     /* "gssapi/raw/sec_contexts.pyx":116
2179  *                      OID mech=None,
2180  *                      flags=None, lifetime=None,
2181  *                      ChannelBindings channel_bindings=None,             # <<<<<<<<<<<<<<
2182  *                      input_token=None):
2183  *     """
2184  */
2185     values[6] = (PyObject *)((struct __pyx_obj_6gssapi_3raw_13chan_bindings_ChannelBindings *)Py_None);
2186 
2187     /* "gssapi/raw/sec_contexts.pyx":117
2188  *                      flags=None, lifetime=None,
2189  *                      ChannelBindings channel_bindings=None,
2190  *                      input_token=None):             # <<<<<<<<<<<<<<
2191  *     """
2192  *     init_sec_context(target_name, creds=None, context=None, mech=None, \
2193  */
2194     values[7] = ((PyObject *)Py_None);
2195     if (unlikely(__pyx_kwds)) {
2196       Py_ssize_t kw_args;
2197       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2198       switch (pos_args) {
2199         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2200         CYTHON_FALLTHROUGH;
2201         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2202         CYTHON_FALLTHROUGH;
2203         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2204         CYTHON_FALLTHROUGH;
2205         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2206         CYTHON_FALLTHROUGH;
2207         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2208         CYTHON_FALLTHROUGH;
2209         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2210         CYTHON_FALLTHROUGH;
2211         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2212         CYTHON_FALLTHROUGH;
2213         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2214         CYTHON_FALLTHROUGH;
2215         case  0: break;
2216         default: goto __pyx_L5_argtuple_error;
2217       }
2218       kw_args = PyDict_Size(__pyx_kwds);
2219       switch (pos_args) {
2220         case  0:
2221         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target_name)) != 0)) kw_args--;
2222         else goto __pyx_L5_argtuple_error;
2223         CYTHON_FALLTHROUGH;
2224         case  1:
2225         if (kw_args > 0) {
2226           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_creds);
2227           if (value) { values[1] = value; kw_args--; }
2228         }
2229         CYTHON_FALLTHROUGH;
2230         case  2:
2231         if (kw_args > 0) {
2232           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
2233           if (value) { values[2] = value; kw_args--; }
2234         }
2235         CYTHON_FALLTHROUGH;
2236         case  3:
2237         if (kw_args > 0) {
2238           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mech);
2239           if (value) { values[3] = value; kw_args--; }
2240         }
2241         CYTHON_FALLTHROUGH;
2242         case  4:
2243         if (kw_args > 0) {
2244           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags);
2245           if (value) { values[4] = value; kw_args--; }
2246         }
2247         CYTHON_FALLTHROUGH;
2248         case  5:
2249         if (kw_args > 0) {
2250           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lifetime);
2251           if (value) { values[5] = value; kw_args--; }
2252         }
2253         CYTHON_FALLTHROUGH;
2254         case  6:
2255         if (kw_args > 0) {
2256           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_channel_bindings);
2257           if (value) { values[6] = value; kw_args--; }
2258         }
2259         CYTHON_FALLTHROUGH;
2260         case  7:
2261         if (kw_args > 0) {
2262           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input_token);
2263           if (value) { values[7] = value; kw_args--; }
2264         }
2265       }
2266       if (unlikely(kw_args > 0)) {
2267         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init_sec_context") < 0)) __PYX_ERR(1, 112, __pyx_L3_error)
2268       }
2269     } else {
2270       switch (PyTuple_GET_SIZE(__pyx_args)) {
2271         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2272         CYTHON_FALLTHROUGH;
2273         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2274         CYTHON_FALLTHROUGH;
2275         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2276         CYTHON_FALLTHROUGH;
2277         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2278         CYTHON_FALLTHROUGH;
2279         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2280         CYTHON_FALLTHROUGH;
2281         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2282         CYTHON_FALLTHROUGH;
2283         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2284         CYTHON_FALLTHROUGH;
2285         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2286         break;
2287         default: goto __pyx_L5_argtuple_error;
2288       }
2289     }
2290     __pyx_v_target_name = ((struct __pyx_obj_6gssapi_3raw_5names_Name *)values[0]);
2291     __pyx_v_creds = ((struct __pyx_obj_6gssapi_3raw_5creds_Creds *)values[1]);
2292     __pyx_v_context = ((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)values[2]);
2293     __pyx_v_mech = ((struct __pyx_obj_6gssapi_3raw_4oids_OID *)values[3]);
2294     __pyx_v_flags = values[4];
2295     __pyx_v_lifetime = values[5];
2296     __pyx_v_channel_bindings = ((struct __pyx_obj_6gssapi_3raw_13chan_bindings_ChannelBindings *)values[6]);
2297     __pyx_v_input_token = values[7];
2298   }
2299   goto __pyx_L4_argument_unpacking_done;
2300   __pyx_L5_argtuple_error:;
2301   __Pyx_RaiseArgtupleInvalid("init_sec_context", 0, 1, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 112, __pyx_L3_error)
2302   __pyx_L3_error:;
2303   __Pyx_AddTraceback("gssapi.raw.sec_contexts.init_sec_context", __pyx_clineno, __pyx_lineno, __pyx_filename);
2304   __Pyx_RefNannyFinishContext();
2305   return NULL;
2306   __pyx_L4_argument_unpacking_done:;
2307   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target_name), __pyx_ptype_6gssapi_3raw_5names_Name, 0, "target_name", 0))) __PYX_ERR(1, 112, __pyx_L1_error)
2308   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_creds), __pyx_ptype_6gssapi_3raw_5creds_Creds, 1, "creds", 0))) __PYX_ERR(1, 112, __pyx_L1_error)
2309   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext, 1, "context", 0))) __PYX_ERR(1, 113, __pyx_L1_error)
2310   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mech), __pyx_ptype_6gssapi_3raw_4oids_OID, 1, "mech", 0))) __PYX_ERR(1, 114, __pyx_L1_error)
2311   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_channel_bindings), __pyx_ptype_6gssapi_3raw_13chan_bindings_ChannelBindings, 1, "channel_bindings", 0))) __PYX_ERR(1, 116, __pyx_L1_error)
2312   __pyx_r = __pyx_pf_6gssapi_3raw_12sec_contexts_init_sec_context(__pyx_self, __pyx_v_target_name, __pyx_v_creds, __pyx_v_context, __pyx_v_mech, __pyx_v_flags, __pyx_v_lifetime, __pyx_v_channel_bindings, __pyx_v_input_token);
2313 
2314   /* "gssapi/raw/sec_contexts.pyx":112
2315  *
2316  * # TODO(directxman12): figure out whether GSS_C_NO_NAME can be passed in here
2317  * def init_sec_context(Name target_name not None, Creds creds=None,             # <<<<<<<<<<<<<<
2318  *                      SecurityContext context=None,
2319  *                      OID mech=None,
2320  */
2321 
2322   /* function exit code */
2323   goto __pyx_L0;
2324   __pyx_L1_error:;
2325   __pyx_r = NULL;
2326   __pyx_L0:;
2327   __Pyx_RefNannyFinishContext();
2328   return __pyx_r;
2329 }
2330 
__pyx_pf_6gssapi_3raw_12sec_contexts_init_sec_context(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_6gssapi_3raw_5names_Name * __pyx_v_target_name,struct __pyx_obj_6gssapi_3raw_5creds_Creds * __pyx_v_creds,struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_context,struct __pyx_obj_6gssapi_3raw_4oids_OID * __pyx_v_mech,PyObject * __pyx_v_flags,PyObject * __pyx_v_lifetime,struct __pyx_obj_6gssapi_3raw_13chan_bindings_ChannelBindings * __pyx_v_channel_bindings,PyObject * __pyx_v_input_token)2331 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_init_sec_context(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_5names_Name *__pyx_v_target_name, struct __pyx_obj_6gssapi_3raw_5creds_Creds *__pyx_v_creds, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, struct __pyx_obj_6gssapi_3raw_4oids_OID *__pyx_v_mech, PyObject *__pyx_v_flags, PyObject *__pyx_v_lifetime, struct __pyx_obj_6gssapi_3raw_13chan_bindings_ChannelBindings *__pyx_v_channel_bindings, PyObject *__pyx_v_input_token) {
2332   gss_OID __pyx_v_mech_oid;
2333   OM_uint32 __pyx_v_req_flags;
2334   gss_channel_bindings_t __pyx_v_bdng;
2335   gss_buffer_desc __pyx_v_input_token_buffer;
2336   OM_uint32 __pyx_v_input_ttl;
2337   struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_output_context = 0;
2338   gss_cred_id_t __pyx_v_act_cred;
2339   gss_OID __pyx_v_actual_mech_type;
2340   gss_buffer_desc __pyx_v_output_token_buffer;
2341   OM_uint32 __pyx_v_ret_flags;
2342   OM_uint32 __pyx_v_output_ttl;
2343   OM_uint32 __pyx_v_maj_stat;
2344   OM_uint32 __pyx_v_min_stat;
2345   PyObject *__pyx_v_output_token = NULL;
2346   OM_uint32 __pyx_v_tmp_min_stat;
2347   struct __pyx_obj_6gssapi_3raw_4oids_OID *__pyx_v_output_mech_type = 0;
2348   PyObject *__pyx_r = NULL;
2349   __Pyx_RefNannyDeclarations
2350   int __pyx_t_1;
2351   int __pyx_t_2;
2352   PyObject *__pyx_t_3 = NULL;
2353   PyObject *__pyx_t_4 = NULL;
2354   PyObject *__pyx_t_5 = NULL;
2355   PyObject *__pyx_t_6 = NULL;
2356   PyObject *__pyx_t_7 = NULL;
2357   PyObject *__pyx_t_8 = NULL;
2358   PyObject *__pyx_t_9 = NULL;
2359   int __pyx_t_10;
2360   OM_uint32 __pyx_t_11;
2361   gss_channel_bindings_t __pyx_t_12;
2362   gss_buffer_desc __pyx_t_13;
2363   gss_cred_id_t __pyx_t_14;
2364   char *__pyx_t_15;
2365   Py_ssize_t __pyx_t_16;
2366   PyObject *__pyx_t_17 = NULL;
2367   int __pyx_lineno = 0;
2368   const char *__pyx_filename = NULL;
2369   int __pyx_clineno = 0;
2370   __Pyx_RefNannySetupContext("init_sec_context", 0);
2371 
2372   /* "gssapi/raw/sec_contexts.pyx":173
2373  *
2374  *     cdef gss_OID mech_oid
2375  *     if mech is not None:             # <<<<<<<<<<<<<<
2376  *         mech_oid = &mech.raw_oid
2377  *     else:
2378  */
2379   __pyx_t_1 = (((PyObject *)__pyx_v_mech) != Py_None);
2380   __pyx_t_2 = (__pyx_t_1 != 0);
2381   if (__pyx_t_2) {
2382 
2383     /* "gssapi/raw/sec_contexts.pyx":174
2384  *     cdef gss_OID mech_oid
2385  *     if mech is not None:
2386  *         mech_oid = &mech.raw_oid             # <<<<<<<<<<<<<<
2387  *     else:
2388  *         mech_oid = GSS_C_NO_OID
2389  */
2390     __pyx_v_mech_oid = (&__pyx_v_mech->raw_oid);
2391 
2392     /* "gssapi/raw/sec_contexts.pyx":173
2393  *
2394  *     cdef gss_OID mech_oid
2395  *     if mech is not None:             # <<<<<<<<<<<<<<
2396  *         mech_oid = &mech.raw_oid
2397  *     else:
2398  */
2399     goto __pyx_L3;
2400   }
2401 
2402   /* "gssapi/raw/sec_contexts.pyx":176
2403  *         mech_oid = &mech.raw_oid
2404  *     else:
2405  *         mech_oid = GSS_C_NO_OID             # <<<<<<<<<<<<<<
2406  *
2407  *     # TODO(directxman12): should we default to this?
2408  */
2409   /*else*/ {
2410     __pyx_v_mech_oid = GSS_C_NO_OID;
2411   }
2412   __pyx_L3:;
2413 
2414   /* "gssapi/raw/sec_contexts.pyx":179
2415  *
2416  *     # TODO(directxman12): should we default to this?
2417  *     cdef OM_uint32 req_flags = IntEnumFlagSet(RequirementFlag, flags or [             # <<<<<<<<<<<<<<
2418  *         RequirementFlag.mutual_authentication,
2419  *         RequirementFlag.out_of_sequence_detection])
2420  */
2421   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_IntEnumFlagSet); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 179, __pyx_L1_error)
2422   __Pyx_GOTREF(__pyx_t_4);
2423   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RequirementFlag); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 179, __pyx_L1_error)
2424   __Pyx_GOTREF(__pyx_t_5);
2425   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_flags); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 179, __pyx_L1_error)
2426   if (!__pyx_t_2) {
2427   } else {
2428     __Pyx_INCREF(__pyx_v_flags);
2429     __pyx_t_6 = __pyx_v_flags;
2430     goto __pyx_L4_bool_binop_done;
2431   }
2432 
2433   /* "gssapi/raw/sec_contexts.pyx":180
2434  *     # TODO(directxman12): should we default to this?
2435  *     cdef OM_uint32 req_flags = IntEnumFlagSet(RequirementFlag, flags or [
2436  *         RequirementFlag.mutual_authentication,             # <<<<<<<<<<<<<<
2437  *         RequirementFlag.out_of_sequence_detection])
2438  *
2439  */
2440   __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_RequirementFlag); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 180, __pyx_L1_error)
2441   __Pyx_GOTREF(__pyx_t_7);
2442   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_mutual_authentication); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 180, __pyx_L1_error)
2443   __Pyx_GOTREF(__pyx_t_8);
2444   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2445 
2446   /* "gssapi/raw/sec_contexts.pyx":181
2447  *     cdef OM_uint32 req_flags = IntEnumFlagSet(RequirementFlag, flags or [
2448  *         RequirementFlag.mutual_authentication,
2449  *         RequirementFlag.out_of_sequence_detection])             # <<<<<<<<<<<<<<
2450  *
2451  *     cdef gss_channel_bindings_t bdng
2452  */
2453   __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_RequirementFlag); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 181, __pyx_L1_error)
2454   __Pyx_GOTREF(__pyx_t_7);
2455   __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_out_of_sequence_detection); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 181, __pyx_L1_error)
2456   __Pyx_GOTREF(__pyx_t_9);
2457   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2458 
2459   /* "gssapi/raw/sec_contexts.pyx":179
2460  *
2461  *     # TODO(directxman12): should we default to this?
2462  *     cdef OM_uint32 req_flags = IntEnumFlagSet(RequirementFlag, flags or [             # <<<<<<<<<<<<<<
2463  *         RequirementFlag.mutual_authentication,
2464  *         RequirementFlag.out_of_sequence_detection])
2465  */
2466   __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 179, __pyx_L1_error)
2467   __Pyx_GOTREF(__pyx_t_7);
2468   __Pyx_GIVEREF(__pyx_t_8);
2469   PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
2470   __Pyx_GIVEREF(__pyx_t_9);
2471   PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_9);
2472   __pyx_t_8 = 0;
2473   __pyx_t_9 = 0;
2474   __Pyx_INCREF(__pyx_t_7);
2475   __pyx_t_6 = __pyx_t_7;
2476   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2477   __pyx_L4_bool_binop_done:;
2478   __pyx_t_7 = NULL;
2479   __pyx_t_10 = 0;
2480   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
2481     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
2482     if (likely(__pyx_t_7)) {
2483       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
2484       __Pyx_INCREF(__pyx_t_7);
2485       __Pyx_INCREF(function);
2486       __Pyx_DECREF_SET(__pyx_t_4, function);
2487       __pyx_t_10 = 1;
2488     }
2489   }
2490   #if CYTHON_FAST_PYCALL
2491   if (PyFunction_Check(__pyx_t_4)) {
2492     PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
2493     __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 179, __pyx_L1_error)
2494     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
2495     __Pyx_GOTREF(__pyx_t_3);
2496     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2497     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2498   } else
2499   #endif
2500   #if CYTHON_FAST_PYCCALL
2501   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
2502     PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
2503     __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 179, __pyx_L1_error)
2504     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
2505     __Pyx_GOTREF(__pyx_t_3);
2506     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2507     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2508   } else
2509   #endif
2510   {
2511     __pyx_t_9 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 179, __pyx_L1_error)
2512     __Pyx_GOTREF(__pyx_t_9);
2513     if (__pyx_t_7) {
2514       __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
2515     }
2516     __Pyx_GIVEREF(__pyx_t_5);
2517     PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_10, __pyx_t_5);
2518     __Pyx_GIVEREF(__pyx_t_6);
2519     PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_10, __pyx_t_6);
2520     __pyx_t_5 = 0;
2521     __pyx_t_6 = 0;
2522     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 179, __pyx_L1_error)
2523     __Pyx_GOTREF(__pyx_t_3);
2524     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
2525   }
2526   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2527   __pyx_t_11 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_11 == ((OM_uint32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 179, __pyx_L1_error)
2528   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2529   __pyx_v_req_flags = __pyx_t_11;
2530 
2531   /* "gssapi/raw/sec_contexts.pyx":184
2532  *
2533  *     cdef gss_channel_bindings_t bdng
2534  *     if channel_bindings is not None:             # <<<<<<<<<<<<<<
2535  *         bdng = channel_bindings.__cvalue__()
2536  *     else:
2537  */
2538   __pyx_t_2 = (((PyObject *)__pyx_v_channel_bindings) != Py_None);
2539   __pyx_t_1 = (__pyx_t_2 != 0);
2540   if (__pyx_t_1) {
2541 
2542     /* "gssapi/raw/sec_contexts.pyx":185
2543  *     cdef gss_channel_bindings_t bdng
2544  *     if channel_bindings is not None:
2545  *         bdng = channel_bindings.__cvalue__()             # <<<<<<<<<<<<<<
2546  *     else:
2547  *         bdng = GSS_C_NO_CHANNEL_BINDINGS
2548  */
2549     __pyx_t_12 = ((struct __pyx_vtabstruct_6gssapi_3raw_13chan_bindings_ChannelBindings *)__pyx_v_channel_bindings->__pyx_vtab)->__pyx___cvalue__(__pyx_v_channel_bindings); if (unlikely(__pyx_t_12 == ((gss_channel_bindings_t)NULL))) __PYX_ERR(1, 185, __pyx_L1_error)
2550     __pyx_v_bdng = __pyx_t_12;
2551 
2552     /* "gssapi/raw/sec_contexts.pyx":184
2553  *
2554  *     cdef gss_channel_bindings_t bdng
2555  *     if channel_bindings is not None:             # <<<<<<<<<<<<<<
2556  *         bdng = channel_bindings.__cvalue__()
2557  *     else:
2558  */
2559     goto __pyx_L6;
2560   }
2561 
2562   /* "gssapi/raw/sec_contexts.pyx":187
2563  *         bdng = channel_bindings.__cvalue__()
2564  *     else:
2565  *         bdng = GSS_C_NO_CHANNEL_BINDINGS             # <<<<<<<<<<<<<<
2566  *
2567  *     cdef gss_buffer_desc input_token_buffer = gss_buffer_desc(0, NULL)
2568  */
2569   /*else*/ {
2570     __pyx_v_bdng = GSS_C_NO_CHANNEL_BINDINGS;
2571   }
2572   __pyx_L6:;
2573 
2574   /* "gssapi/raw/sec_contexts.pyx":189
2575  *         bdng = GSS_C_NO_CHANNEL_BINDINGS
2576  *
2577  *     cdef gss_buffer_desc input_token_buffer = gss_buffer_desc(0, NULL)             # <<<<<<<<<<<<<<
2578  *
2579  *     cdef OM_uint32 input_ttl = c_py_ttl_to_c(lifetime)
2580  */
2581   __pyx_t_13.length = 0;
2582   __pyx_t_13.value = NULL;
2583   __pyx_v_input_token_buffer = __pyx_t_13;
2584 
2585   /* "gssapi/raw/sec_contexts.pyx":191
2586  *     cdef gss_buffer_desc input_token_buffer = gss_buffer_desc(0, NULL)
2587  *
2588  *     cdef OM_uint32 input_ttl = c_py_ttl_to_c(lifetime)             # <<<<<<<<<<<<<<
2589  *
2590  *     cdef SecurityContext output_context = context
2591  */
2592   __pyx_t_11 = __pyx_f_6gssapi_3raw_17cython_converters_c_py_ttl_to_c(__pyx_v_lifetime); if (unlikely(__pyx_t_11 == ((OM_uint32)1) && PyErr_Occurred())) __PYX_ERR(1, 191, __pyx_L1_error)
2593   __pyx_v_input_ttl = __pyx_t_11;
2594 
2595   /* "gssapi/raw/sec_contexts.pyx":193
2596  *     cdef OM_uint32 input_ttl = c_py_ttl_to_c(lifetime)
2597  *
2598  *     cdef SecurityContext output_context = context             # <<<<<<<<<<<<<<
2599  *     if output_context is None:
2600  *         output_context = SecurityContext()
2601  */
2602   __Pyx_INCREF(((PyObject *)__pyx_v_context));
2603   __pyx_v_output_context = __pyx_v_context;
2604 
2605   /* "gssapi/raw/sec_contexts.pyx":194
2606  *
2607  *     cdef SecurityContext output_context = context
2608  *     if output_context is None:             # <<<<<<<<<<<<<<
2609  *         output_context = SecurityContext()
2610  *
2611  */
2612   __pyx_t_1 = (((PyObject *)__pyx_v_output_context) == Py_None);
2613   __pyx_t_2 = (__pyx_t_1 != 0);
2614   if (__pyx_t_2) {
2615 
2616     /* "gssapi/raw/sec_contexts.pyx":195
2617  *     cdef SecurityContext output_context = context
2618  *     if output_context is None:
2619  *         output_context = SecurityContext()             # <<<<<<<<<<<<<<
2620  *
2621  *     cdef gss_cred_id_t act_cred
2622  */
2623     __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 195, __pyx_L1_error)
2624     __Pyx_GOTREF(__pyx_t_3);
2625     __Pyx_DECREF_SET(__pyx_v_output_context, ((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)__pyx_t_3));
2626     __pyx_t_3 = 0;
2627 
2628     /* "gssapi/raw/sec_contexts.pyx":194
2629  *
2630  *     cdef SecurityContext output_context = context
2631  *     if output_context is None:             # <<<<<<<<<<<<<<
2632  *         output_context = SecurityContext()
2633  *
2634  */
2635   }
2636 
2637   /* "gssapi/raw/sec_contexts.pyx":198
2638  *
2639  *     cdef gss_cred_id_t act_cred
2640  *     if creds is not None:             # <<<<<<<<<<<<<<
2641  *         act_cred = creds.raw_creds
2642  *     else:
2643  */
2644   __pyx_t_2 = (((PyObject *)__pyx_v_creds) != Py_None);
2645   __pyx_t_1 = (__pyx_t_2 != 0);
2646   if (__pyx_t_1) {
2647 
2648     /* "gssapi/raw/sec_contexts.pyx":199
2649  *     cdef gss_cred_id_t act_cred
2650  *     if creds is not None:
2651  *         act_cred = creds.raw_creds             # <<<<<<<<<<<<<<
2652  *     else:
2653  *         act_cred = GSS_C_NO_CREDENTIAL
2654  */
2655     __pyx_t_14 = __pyx_v_creds->raw_creds;
2656     __pyx_v_act_cred = __pyx_t_14;
2657 
2658     /* "gssapi/raw/sec_contexts.pyx":198
2659  *
2660  *     cdef gss_cred_id_t act_cred
2661  *     if creds is not None:             # <<<<<<<<<<<<<<
2662  *         act_cred = creds.raw_creds
2663  *     else:
2664  */
2665     goto __pyx_L8;
2666   }
2667 
2668   /* "gssapi/raw/sec_contexts.pyx":201
2669  *         act_cred = creds.raw_creds
2670  *     else:
2671  *         act_cred = GSS_C_NO_CREDENTIAL             # <<<<<<<<<<<<<<
2672  *
2673  *     if input_token is not None:
2674  */
2675   /*else*/ {
2676     __pyx_v_act_cred = GSS_C_NO_CREDENTIAL;
2677   }
2678   __pyx_L8:;
2679 
2680   /* "gssapi/raw/sec_contexts.pyx":203
2681  *         act_cred = GSS_C_NO_CREDENTIAL
2682  *
2683  *     if input_token is not None:             # <<<<<<<<<<<<<<
2684  *         input_token_buffer.value = input_token
2685  *         input_token_buffer.length = len(input_token)
2686  */
2687   __pyx_t_1 = (__pyx_v_input_token != Py_None);
2688   __pyx_t_2 = (__pyx_t_1 != 0);
2689   if (__pyx_t_2) {
2690 
2691     /* "gssapi/raw/sec_contexts.pyx":204
2692  *
2693  *     if input_token is not None:
2694  *         input_token_buffer.value = input_token             # <<<<<<<<<<<<<<
2695  *         input_token_buffer.length = len(input_token)
2696  *
2697  */
2698     __pyx_t_15 = __Pyx_PyObject_AsWritableString(__pyx_v_input_token); if (unlikely((!__pyx_t_15) && PyErr_Occurred())) __PYX_ERR(1, 204, __pyx_L1_error)
2699     __pyx_v_input_token_buffer.value = __pyx_t_15;
2700 
2701     /* "gssapi/raw/sec_contexts.pyx":205
2702  *     if input_token is not None:
2703  *         input_token_buffer.value = input_token
2704  *         input_token_buffer.length = len(input_token)             # <<<<<<<<<<<<<<
2705  *
2706  *     cdef gss_OID actual_mech_type = GSS_C_NO_OID
2707  */
2708     __pyx_t_16 = PyObject_Length(__pyx_v_input_token); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(1, 205, __pyx_L1_error)
2709     __pyx_v_input_token_buffer.length = __pyx_t_16;
2710 
2711     /* "gssapi/raw/sec_contexts.pyx":203
2712  *         act_cred = GSS_C_NO_CREDENTIAL
2713  *
2714  *     if input_token is not None:             # <<<<<<<<<<<<<<
2715  *         input_token_buffer.value = input_token
2716  *         input_token_buffer.length = len(input_token)
2717  */
2718   }
2719 
2720   /* "gssapi/raw/sec_contexts.pyx":207
2721  *         input_token_buffer.length = len(input_token)
2722  *
2723  *     cdef gss_OID actual_mech_type = GSS_C_NO_OID             # <<<<<<<<<<<<<<
2724  *     cdef gss_buffer_desc output_token_buffer = gss_buffer_desc(0, NULL)
2725  *     cdef OM_uint32 ret_flags
2726  */
2727   __pyx_v_actual_mech_type = GSS_C_NO_OID;
2728 
2729   /* "gssapi/raw/sec_contexts.pyx":208
2730  *
2731  *     cdef gss_OID actual_mech_type = GSS_C_NO_OID
2732  *     cdef gss_buffer_desc output_token_buffer = gss_buffer_desc(0, NULL)             # <<<<<<<<<<<<<<
2733  *     cdef OM_uint32 ret_flags
2734  *     cdef OM_uint32 output_ttl
2735  */
2736   __pyx_t_13.length = 0;
2737   __pyx_t_13.value = NULL;
2738   __pyx_v_output_token_buffer = __pyx_t_13;
2739 
2740   /* "gssapi/raw/sec_contexts.pyx":214
2741  *     cdef OM_uint32 maj_stat, min_stat
2742  *
2743  *     with nogil:             # <<<<<<<<<<<<<<
2744  *         maj_stat = gss_init_sec_context(&min_stat, act_cred,
2745  *                                         &output_context.raw_ctx,
2746  */
2747   {
2748       #ifdef WITH_THREAD
2749       PyThreadState *_save;
2750       Py_UNBLOCK_THREADS
2751       __Pyx_FastGIL_Remember();
2752       #endif
2753       /*try:*/ {
2754 
2755         /* "gssapi/raw/sec_contexts.pyx":215
2756  *
2757  *     with nogil:
2758  *         maj_stat = gss_init_sec_context(&min_stat, act_cred,             # <<<<<<<<<<<<<<
2759  *                                         &output_context.raw_ctx,
2760  *                                         target_name.raw_name,
2761  */
2762         __pyx_v_maj_stat = gss_init_sec_context((&__pyx_v_min_stat), __pyx_v_act_cred, (&__pyx_v_output_context->raw_ctx), __pyx_v_target_name->raw_name, __pyx_v_mech_oid, __pyx_v_req_flags, __pyx_v_input_ttl, __pyx_v_bdng, (&__pyx_v_input_token_buffer), (&__pyx_v_actual_mech_type), (&__pyx_v_output_token_buffer), (&__pyx_v_ret_flags), (&__pyx_v_output_ttl));
2763       }
2764 
2765       /* "gssapi/raw/sec_contexts.pyx":214
2766  *     cdef OM_uint32 maj_stat, min_stat
2767  *
2768  *     with nogil:             # <<<<<<<<<<<<<<
2769  *         maj_stat = gss_init_sec_context(&min_stat, act_cred,
2770  *                                         &output_context.raw_ctx,
2771  */
2772       /*finally:*/ {
2773         /*normal exit:*/{
2774           #ifdef WITH_THREAD
2775           __Pyx_FastGIL_Forget();
2776           Py_BLOCK_THREADS
2777           #endif
2778           goto __pyx_L12;
2779         }
2780         __pyx_L12:;
2781       }
2782   }
2783 
2784   /* "gssapi/raw/sec_contexts.pyx":224
2785  *                                         &ret_flags, &output_ttl)
2786  *
2787  *     output_token = None             # <<<<<<<<<<<<<<
2788  *     if output_token_buffer.length:
2789  *         output_token = \
2790  */
2791   __Pyx_INCREF(Py_None);
2792   __pyx_v_output_token = ((PyObject*)Py_None);
2793 
2794   /* "gssapi/raw/sec_contexts.pyx":225
2795  *
2796  *     output_token = None
2797  *     if output_token_buffer.length:             # <<<<<<<<<<<<<<
2798  *         output_token = \
2799  *             (<char*>output_token_buffer.value)[:output_token_buffer.length]
2800  */
2801   __pyx_t_2 = (__pyx_v_output_token_buffer.length != 0);
2802   if (__pyx_t_2) {
2803 
2804     /* "gssapi/raw/sec_contexts.pyx":227
2805  *     if output_token_buffer.length:
2806  *         output_token = \
2807  *             (<char*>output_token_buffer.value)[:output_token_buffer.length]             # <<<<<<<<<<<<<<
2808  *     cdef OM_uint32 tmp_min_stat
2809  *     gss_release_buffer(&tmp_min_stat, &output_token_buffer)
2810  */
2811     __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_output_token_buffer.value) + 0, __pyx_v_output_token_buffer.length - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 227, __pyx_L1_error)
2812     __Pyx_GOTREF(__pyx_t_3);
2813     __Pyx_DECREF_SET(__pyx_v_output_token, ((PyObject*)__pyx_t_3));
2814     __pyx_t_3 = 0;
2815 
2816     /* "gssapi/raw/sec_contexts.pyx":225
2817  *
2818  *     output_token = None
2819  *     if output_token_buffer.length:             # <<<<<<<<<<<<<<
2820  *         output_token = \
2821  *             (<char*>output_token_buffer.value)[:output_token_buffer.length]
2822  */
2823   }
2824 
2825   /* "gssapi/raw/sec_contexts.pyx":229
2826  *             (<char*>output_token_buffer.value)[:output_token_buffer.length]
2827  *     cdef OM_uint32 tmp_min_stat
2828  *     gss_release_buffer(&tmp_min_stat, &output_token_buffer)             # <<<<<<<<<<<<<<
2829  *
2830  *     if channel_bindings is not None:
2831  */
2832   (void)(gss_release_buffer((&__pyx_v_tmp_min_stat), (&__pyx_v_output_token_buffer)));
2833 
2834   /* "gssapi/raw/sec_contexts.pyx":231
2835  *     gss_release_buffer(&tmp_min_stat, &output_token_buffer)
2836  *
2837  *     if channel_bindings is not None:             # <<<<<<<<<<<<<<
2838  *         free(bdng)
2839  *
2840  */
2841   __pyx_t_2 = (((PyObject *)__pyx_v_channel_bindings) != Py_None);
2842   __pyx_t_1 = (__pyx_t_2 != 0);
2843   if (__pyx_t_1) {
2844 
2845     /* "gssapi/raw/sec_contexts.pyx":232
2846  *
2847  *     if channel_bindings is not None:
2848  *         free(bdng)             # <<<<<<<<<<<<<<
2849  *
2850  *     cdef OID output_mech_type = OID()
2851  */
2852     free(__pyx_v_bdng);
2853 
2854     /* "gssapi/raw/sec_contexts.pyx":231
2855  *     gss_release_buffer(&tmp_min_stat, &output_token_buffer)
2856  *
2857  *     if channel_bindings is not None:             # <<<<<<<<<<<<<<
2858  *         free(bdng)
2859  *
2860  */
2861   }
2862 
2863   /* "gssapi/raw/sec_contexts.pyx":234
2864  *         free(bdng)
2865  *
2866  *     cdef OID output_mech_type = OID()             # <<<<<<<<<<<<<<
2867  *     if maj_stat == GSS_S_COMPLETE or maj_stat == GSS_S_CONTINUE_NEEDED:
2868  *         if actual_mech_type is not GSS_C_NO_OID:
2869  */
2870   __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gssapi_3raw_4oids_OID)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 234, __pyx_L1_error)
2871   __Pyx_GOTREF(__pyx_t_3);
2872   __pyx_v_output_mech_type = ((struct __pyx_obj_6gssapi_3raw_4oids_OID *)__pyx_t_3);
2873   __pyx_t_3 = 0;
2874 
2875   /* "gssapi/raw/sec_contexts.pyx":235
2876  *
2877  *     cdef OID output_mech_type = OID()
2878  *     if maj_stat == GSS_S_COMPLETE or maj_stat == GSS_S_CONTINUE_NEEDED:             # <<<<<<<<<<<<<<
2879  *         if actual_mech_type is not GSS_C_NO_OID:
2880  *             output_mech_type.raw_oid = actual_mech_type[0]
2881  */
2882   __pyx_t_2 = ((__pyx_v_maj_stat == GSS_S_COMPLETE) != 0);
2883   if (!__pyx_t_2) {
2884   } else {
2885     __pyx_t_1 = __pyx_t_2;
2886     goto __pyx_L16_bool_binop_done;
2887   }
2888   __pyx_t_2 = ((__pyx_v_maj_stat == GSS_S_CONTINUE_NEEDED) != 0);
2889   __pyx_t_1 = __pyx_t_2;
2890   __pyx_L16_bool_binop_done:;
2891   if (likely(__pyx_t_1)) {
2892 
2893     /* "gssapi/raw/sec_contexts.pyx":236
2894  *     cdef OID output_mech_type = OID()
2895  *     if maj_stat == GSS_S_COMPLETE or maj_stat == GSS_S_CONTINUE_NEEDED:
2896  *         if actual_mech_type is not GSS_C_NO_OID:             # <<<<<<<<<<<<<<
2897  *             output_mech_type.raw_oid = actual_mech_type[0]
2898  *
2899  */
2900     __pyx_t_1 = ((__pyx_v_actual_mech_type != GSS_C_NO_OID) != 0);
2901     if (__pyx_t_1) {
2902 
2903       /* "gssapi/raw/sec_contexts.pyx":237
2904  *     if maj_stat == GSS_S_COMPLETE or maj_stat == GSS_S_CONTINUE_NEEDED:
2905  *         if actual_mech_type is not GSS_C_NO_OID:
2906  *             output_mech_type.raw_oid = actual_mech_type[0]             # <<<<<<<<<<<<<<
2907  *
2908  *         return InitSecContextResult(output_context, output_mech_type,
2909  */
2910       __pyx_v_output_mech_type->raw_oid = (__pyx_v_actual_mech_type[0]);
2911 
2912       /* "gssapi/raw/sec_contexts.pyx":236
2913  *     cdef OID output_mech_type = OID()
2914  *     if maj_stat == GSS_S_COMPLETE or maj_stat == GSS_S_CONTINUE_NEEDED:
2915  *         if actual_mech_type is not GSS_C_NO_OID:             # <<<<<<<<<<<<<<
2916  *             output_mech_type.raw_oid = actual_mech_type[0]
2917  *
2918  */
2919     }
2920 
2921     /* "gssapi/raw/sec_contexts.pyx":239
2922  *             output_mech_type.raw_oid = actual_mech_type[0]
2923  *
2924  *         return InitSecContextResult(output_context, output_mech_type,             # <<<<<<<<<<<<<<
2925  *                                     IntEnumFlagSet(RequirementFlag, ret_flags),
2926  *                                     output_token,
2927  */
2928     __Pyx_XDECREF(__pyx_r);
2929     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_InitSecContextResult); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 239, __pyx_L1_error)
2930     __Pyx_GOTREF(__pyx_t_4);
2931 
2932     /* "gssapi/raw/sec_contexts.pyx":240
2933  *
2934  *         return InitSecContextResult(output_context, output_mech_type,
2935  *                                     IntEnumFlagSet(RequirementFlag, ret_flags),             # <<<<<<<<<<<<<<
2936  *                                     output_token,
2937  *                                     c_c_ttl_to_py(output_ttl),
2938  */
2939     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_IntEnumFlagSet); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 240, __pyx_L1_error)
2940     __Pyx_GOTREF(__pyx_t_6);
2941     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RequirementFlag); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 240, __pyx_L1_error)
2942     __Pyx_GOTREF(__pyx_t_5);
2943     __pyx_t_7 = __Pyx_PyInt_From_uint32_t(__pyx_v_ret_flags); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 240, __pyx_L1_error)
2944     __Pyx_GOTREF(__pyx_t_7);
2945     __pyx_t_8 = NULL;
2946     __pyx_t_10 = 0;
2947     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
2948       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
2949       if (likely(__pyx_t_8)) {
2950         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
2951         __Pyx_INCREF(__pyx_t_8);
2952         __Pyx_INCREF(function);
2953         __Pyx_DECREF_SET(__pyx_t_6, function);
2954         __pyx_t_10 = 1;
2955       }
2956     }
2957     #if CYTHON_FAST_PYCALL
2958     if (PyFunction_Check(__pyx_t_6)) {
2959       PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_5, __pyx_t_7};
2960       __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 240, __pyx_L1_error)
2961       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2962       __Pyx_GOTREF(__pyx_t_9);
2963       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2964       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2965     } else
2966     #endif
2967     #if CYTHON_FAST_PYCCALL
2968     if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
2969       PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_5, __pyx_t_7};
2970       __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 240, __pyx_L1_error)
2971       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2972       __Pyx_GOTREF(__pyx_t_9);
2973       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2974       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2975     } else
2976     #endif
2977     {
2978       __pyx_t_17 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 240, __pyx_L1_error)
2979       __Pyx_GOTREF(__pyx_t_17);
2980       if (__pyx_t_8) {
2981         __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_8); __pyx_t_8 = NULL;
2982       }
2983       __Pyx_GIVEREF(__pyx_t_5);
2984       PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_10, __pyx_t_5);
2985       __Pyx_GIVEREF(__pyx_t_7);
2986       PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_10, __pyx_t_7);
2987       __pyx_t_5 = 0;
2988       __pyx_t_7 = 0;
2989       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_17, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 240, __pyx_L1_error)
2990       __Pyx_GOTREF(__pyx_t_9);
2991       __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
2992     }
2993     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2994 
2995     /* "gssapi/raw/sec_contexts.pyx":242
2996  *                                     IntEnumFlagSet(RequirementFlag, ret_flags),
2997  *                                     output_token,
2998  *                                     c_c_ttl_to_py(output_ttl),             # <<<<<<<<<<<<<<
2999  *                                     maj_stat == GSS_S_CONTINUE_NEEDED)
3000  *     else:
3001  */
3002     __pyx_t_6 = __pyx_f_6gssapi_3raw_17cython_converters_c_c_ttl_to_py(__pyx_v_output_ttl); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 242, __pyx_L1_error)
3003     __Pyx_GOTREF(__pyx_t_6);
3004 
3005     /* "gssapi/raw/sec_contexts.pyx":243
3006  *                                     output_token,
3007  *                                     c_c_ttl_to_py(output_ttl),
3008  *                                     maj_stat == GSS_S_CONTINUE_NEEDED)             # <<<<<<<<<<<<<<
3009  *     else:
3010  *         raise GSSError(maj_stat, min_stat, token=output_token)
3011  */
3012     __pyx_t_17 = __Pyx_PyBool_FromLong((__pyx_v_maj_stat == GSS_S_CONTINUE_NEEDED)); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 243, __pyx_L1_error)
3013     __Pyx_GOTREF(__pyx_t_17);
3014     __pyx_t_7 = NULL;
3015     __pyx_t_10 = 0;
3016     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3017       __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
3018       if (likely(__pyx_t_7)) {
3019         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3020         __Pyx_INCREF(__pyx_t_7);
3021         __Pyx_INCREF(function);
3022         __Pyx_DECREF_SET(__pyx_t_4, function);
3023         __pyx_t_10 = 1;
3024       }
3025     }
3026     #if CYTHON_FAST_PYCALL
3027     if (PyFunction_Check(__pyx_t_4)) {
3028       PyObject *__pyx_temp[7] = {__pyx_t_7, ((PyObject *)__pyx_v_output_context), ((PyObject *)__pyx_v_output_mech_type), __pyx_t_9, __pyx_v_output_token, __pyx_t_6, __pyx_t_17};
3029       __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 6+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 239, __pyx_L1_error)
3030       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3031       __Pyx_GOTREF(__pyx_t_3);
3032       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3033       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3034       __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3035     } else
3036     #endif
3037     #if CYTHON_FAST_PYCCALL
3038     if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
3039       PyObject *__pyx_temp[7] = {__pyx_t_7, ((PyObject *)__pyx_v_output_context), ((PyObject *)__pyx_v_output_mech_type), __pyx_t_9, __pyx_v_output_token, __pyx_t_6, __pyx_t_17};
3040       __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 6+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 239, __pyx_L1_error)
3041       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3042       __Pyx_GOTREF(__pyx_t_3);
3043       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3044       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3045       __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3046     } else
3047     #endif
3048     {
3049       __pyx_t_5 = PyTuple_New(6+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 239, __pyx_L1_error)
3050       __Pyx_GOTREF(__pyx_t_5);
3051       if (__pyx_t_7) {
3052         __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
3053       }
3054       __Pyx_INCREF(((PyObject *)__pyx_v_output_context));
3055       __Pyx_GIVEREF(((PyObject *)__pyx_v_output_context));
3056       PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_10, ((PyObject *)__pyx_v_output_context));
3057       __Pyx_INCREF(((PyObject *)__pyx_v_output_mech_type));
3058       __Pyx_GIVEREF(((PyObject *)__pyx_v_output_mech_type));
3059       PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_10, ((PyObject *)__pyx_v_output_mech_type));
3060       __Pyx_GIVEREF(__pyx_t_9);
3061       PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_10, __pyx_t_9);
3062       __Pyx_INCREF(__pyx_v_output_token);
3063       __Pyx_GIVEREF(__pyx_v_output_token);
3064       PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_10, __pyx_v_output_token);
3065       __Pyx_GIVEREF(__pyx_t_6);
3066       PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_10, __pyx_t_6);
3067       __Pyx_GIVEREF(__pyx_t_17);
3068       PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_10, __pyx_t_17);
3069       __pyx_t_9 = 0;
3070       __pyx_t_6 = 0;
3071       __pyx_t_17 = 0;
3072       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 239, __pyx_L1_error)
3073       __Pyx_GOTREF(__pyx_t_3);
3074       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3075     }
3076     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3077     __pyx_r = __pyx_t_3;
3078     __pyx_t_3 = 0;
3079     goto __pyx_L0;
3080 
3081     /* "gssapi/raw/sec_contexts.pyx":235
3082  *
3083  *     cdef OID output_mech_type = OID()
3084  *     if maj_stat == GSS_S_COMPLETE or maj_stat == GSS_S_CONTINUE_NEEDED:             # <<<<<<<<<<<<<<
3085  *         if actual_mech_type is not GSS_C_NO_OID:
3086  *             output_mech_type.raw_oid = actual_mech_type[0]
3087  */
3088   }
3089 
3090   /* "gssapi/raw/sec_contexts.pyx":245
3091  *                                     maj_stat == GSS_S_CONTINUE_NEEDED)
3092  *     else:
3093  *         raise GSSError(maj_stat, min_stat, token=output_token)             # <<<<<<<<<<<<<<
3094  *
3095  *
3096  */
3097   /*else*/ {
3098     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_GSSError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __pyx_L1_error)
3099     __Pyx_GOTREF(__pyx_t_3);
3100     __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_maj_stat); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error)
3101     __Pyx_GOTREF(__pyx_t_4);
3102     __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_min_stat); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __pyx_L1_error)
3103     __Pyx_GOTREF(__pyx_t_5);
3104     __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 245, __pyx_L1_error)
3105     __Pyx_GOTREF(__pyx_t_17);
3106     __Pyx_GIVEREF(__pyx_t_4);
3107     PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_4);
3108     __Pyx_GIVEREF(__pyx_t_5);
3109     PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_5);
3110     __pyx_t_4 = 0;
3111     __pyx_t_5 = 0;
3112     __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __pyx_L1_error)
3113     __Pyx_GOTREF(__pyx_t_5);
3114     if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_token, __pyx_v_output_token) < 0) __PYX_ERR(1, 245, __pyx_L1_error)
3115     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_17, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __pyx_L1_error)
3116     __Pyx_GOTREF(__pyx_t_4);
3117     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3118     __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3119     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3120     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3121     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3122     __PYX_ERR(1, 245, __pyx_L1_error)
3123   }
3124 
3125   /* "gssapi/raw/sec_contexts.pyx":112
3126  *
3127  * # TODO(directxman12): figure out whether GSS_C_NO_NAME can be passed in here
3128  * def init_sec_context(Name target_name not None, Creds creds=None,             # <<<<<<<<<<<<<<
3129  *                      SecurityContext context=None,
3130  *                      OID mech=None,
3131  */
3132 
3133   /* function exit code */
3134   __pyx_L1_error:;
3135   __Pyx_XDECREF(__pyx_t_3);
3136   __Pyx_XDECREF(__pyx_t_4);
3137   __Pyx_XDECREF(__pyx_t_5);
3138   __Pyx_XDECREF(__pyx_t_6);
3139   __Pyx_XDECREF(__pyx_t_7);
3140   __Pyx_XDECREF(__pyx_t_8);
3141   __Pyx_XDECREF(__pyx_t_9);
3142   __Pyx_XDECREF(__pyx_t_17);
3143   __Pyx_AddTraceback("gssapi.raw.sec_contexts.init_sec_context", __pyx_clineno, __pyx_lineno, __pyx_filename);
3144   __pyx_r = NULL;
3145   __pyx_L0:;
3146   __Pyx_XDECREF((PyObject *)__pyx_v_output_context);
3147   __Pyx_XDECREF(__pyx_v_output_token);
3148   __Pyx_XDECREF((PyObject *)__pyx_v_output_mech_type);
3149   __Pyx_XGIVEREF(__pyx_r);
3150   __Pyx_RefNannyFinishContext();
3151   return __pyx_r;
3152 }
3153 
3154 /* "gssapi/raw/sec_contexts.pyx":248
3155  *
3156  *
3157  * def accept_sec_context(input_token not None, Creds acceptor_creds=None,             # <<<<<<<<<<<<<<
3158  *                        SecurityContext context=None,
3159  *                        ChannelBindings channel_bindings=None):
3160  */
3161 
3162 /* Python wrapper */
3163 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_3accept_sec_context(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3164 static char __pyx_doc_6gssapi_3raw_12sec_contexts_2accept_sec_context[] = "\n    accept_sec_context(input_token, acceptor_creds=None, context=None, channel_bindings=None)\n    Accept a GSSAPI security context.\n\n    This method accepts a GSSAPI security context using a token sent by the\n    initiator, using the given credentials.  It can either be used to accept a\n    security context and create a new security context object, or to update an\n    existing security context object.\n\n    Warning:\n        This changes the input context!\n\n    Args:\n        input_token (bytes): the token sent by the context initiator\n        acceptor_creds (Creds): the credentials to be used to accept the\n            context (or None to use the default credentials)\n        context (SecurityContext): the security context to update\n            (or None to create a new security context object)\n        channel_bindings (ChannelBindings): The channel bindings (or None for\n            no channel bindings)\n\n    Returns:\n        AcceptSecContextResult: the resulting security context, the initiator\n            name, the mechanism being used, the output token, the flags in use,\n            the lifetime of the context (or None for indefinite or not\n            supported), the delegated credentials (valid only if the\n            delegate_to_peer flag is set), and whether or not further token\n            exchanges are needed to finalize the security context.\n\n    Raises:\n        InvalidTokenError\n        InvalidCredentialsError\n        MissingCredentialsError\n        ExpiredCredentialsError\n        BadChannelBindingsError\n        MissingContextError\n        BadMICError\n        ExpiredTokenError\n        DuplicateTokenError\n        BadMechanismError\n    ";
3165 static PyMethodDef __pyx_mdef_6gssapi_3raw_12sec_contexts_3accept_sec_context = {"accept_sec_context", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gssapi_3raw_12sec_contexts_3accept_sec_context, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gssapi_3raw_12sec_contexts_2accept_sec_context};
__pyx_pw_6gssapi_3raw_12sec_contexts_3accept_sec_context(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3166 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_3accept_sec_context(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3167   PyObject *__pyx_v_input_token = 0;
3168   struct __pyx_obj_6gssapi_3raw_5creds_Creds *__pyx_v_acceptor_creds = 0;
3169   struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context = 0;
3170   struct __pyx_obj_6gssapi_3raw_13chan_bindings_ChannelBindings *__pyx_v_channel_bindings = 0;
3171   int __pyx_lineno = 0;
3172   const char *__pyx_filename = NULL;
3173   int __pyx_clineno = 0;
3174   PyObject *__pyx_r = 0;
3175   __Pyx_RefNannyDeclarations
3176   __Pyx_RefNannySetupContext("accept_sec_context (wrapper)", 0);
3177   {
3178     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_token,&__pyx_n_s_acceptor_creds,&__pyx_n_s_context,&__pyx_n_s_channel_bindings,0};
3179     PyObject* values[4] = {0,0,0,0};
3180     values[1] = (PyObject *)((struct __pyx_obj_6gssapi_3raw_5creds_Creds *)Py_None);
3181 
3182     /* "gssapi/raw/sec_contexts.pyx":249
3183  *
3184  * def accept_sec_context(input_token not None, Creds acceptor_creds=None,
3185  *                        SecurityContext context=None,             # <<<<<<<<<<<<<<
3186  *                        ChannelBindings channel_bindings=None):
3187  *     """
3188  */
3189     values[2] = (PyObject *)((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)Py_None);
3190 
3191     /* "gssapi/raw/sec_contexts.pyx":250
3192  * def accept_sec_context(input_token not None, Creds acceptor_creds=None,
3193  *                        SecurityContext context=None,
3194  *                        ChannelBindings channel_bindings=None):             # <<<<<<<<<<<<<<
3195  *     """
3196  *     accept_sec_context(input_token, acceptor_creds=None, context=None, \
3197  */
3198     values[3] = (PyObject *)((struct __pyx_obj_6gssapi_3raw_13chan_bindings_ChannelBindings *)Py_None);
3199     if (unlikely(__pyx_kwds)) {
3200       Py_ssize_t kw_args;
3201       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3202       switch (pos_args) {
3203         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3204         CYTHON_FALLTHROUGH;
3205         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3206         CYTHON_FALLTHROUGH;
3207         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3208         CYTHON_FALLTHROUGH;
3209         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3210         CYTHON_FALLTHROUGH;
3211         case  0: break;
3212         default: goto __pyx_L5_argtuple_error;
3213       }
3214       kw_args = PyDict_Size(__pyx_kwds);
3215       switch (pos_args) {
3216         case  0:
3217         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_input_token)) != 0)) kw_args--;
3218         else goto __pyx_L5_argtuple_error;
3219         CYTHON_FALLTHROUGH;
3220         case  1:
3221         if (kw_args > 0) {
3222           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_acceptor_creds);
3223           if (value) { values[1] = value; kw_args--; }
3224         }
3225         CYTHON_FALLTHROUGH;
3226         case  2:
3227         if (kw_args > 0) {
3228           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
3229           if (value) { values[2] = value; kw_args--; }
3230         }
3231         CYTHON_FALLTHROUGH;
3232         case  3:
3233         if (kw_args > 0) {
3234           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_channel_bindings);
3235           if (value) { values[3] = value; kw_args--; }
3236         }
3237       }
3238       if (unlikely(kw_args > 0)) {
3239         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "accept_sec_context") < 0)) __PYX_ERR(1, 248, __pyx_L3_error)
3240       }
3241     } else {
3242       switch (PyTuple_GET_SIZE(__pyx_args)) {
3243         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3244         CYTHON_FALLTHROUGH;
3245         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3246         CYTHON_FALLTHROUGH;
3247         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3248         CYTHON_FALLTHROUGH;
3249         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3250         break;
3251         default: goto __pyx_L5_argtuple_error;
3252       }
3253     }
3254     __pyx_v_input_token = values[0];
3255     __pyx_v_acceptor_creds = ((struct __pyx_obj_6gssapi_3raw_5creds_Creds *)values[1]);
3256     __pyx_v_context = ((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)values[2]);
3257     __pyx_v_channel_bindings = ((struct __pyx_obj_6gssapi_3raw_13chan_bindings_ChannelBindings *)values[3]);
3258   }
3259   goto __pyx_L4_argument_unpacking_done;
3260   __pyx_L5_argtuple_error:;
3261   __Pyx_RaiseArgtupleInvalid("accept_sec_context", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 248, __pyx_L3_error)
3262   __pyx_L3_error:;
3263   __Pyx_AddTraceback("gssapi.raw.sec_contexts.accept_sec_context", __pyx_clineno, __pyx_lineno, __pyx_filename);
3264   __Pyx_RefNannyFinishContext();
3265   return NULL;
3266   __pyx_L4_argument_unpacking_done:;
3267   if (unlikely(((PyObject *)__pyx_v_input_token) == Py_None)) {
3268     PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "input_token"); __PYX_ERR(1, 248, __pyx_L1_error)
3269   }
3270   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_acceptor_creds), __pyx_ptype_6gssapi_3raw_5creds_Creds, 1, "acceptor_creds", 0))) __PYX_ERR(1, 248, __pyx_L1_error)
3271   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext, 1, "context", 0))) __PYX_ERR(1, 249, __pyx_L1_error)
3272   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_channel_bindings), __pyx_ptype_6gssapi_3raw_13chan_bindings_ChannelBindings, 1, "channel_bindings", 0))) __PYX_ERR(1, 250, __pyx_L1_error)
3273   __pyx_r = __pyx_pf_6gssapi_3raw_12sec_contexts_2accept_sec_context(__pyx_self, __pyx_v_input_token, __pyx_v_acceptor_creds, __pyx_v_context, __pyx_v_channel_bindings);
3274 
3275   /* "gssapi/raw/sec_contexts.pyx":248
3276  *
3277  *
3278  * def accept_sec_context(input_token not None, Creds acceptor_creds=None,             # <<<<<<<<<<<<<<
3279  *                        SecurityContext context=None,
3280  *                        ChannelBindings channel_bindings=None):
3281  */
3282 
3283   /* function exit code */
3284   goto __pyx_L0;
3285   __pyx_L1_error:;
3286   __pyx_r = NULL;
3287   __pyx_L0:;
3288   __Pyx_RefNannyFinishContext();
3289   return __pyx_r;
3290 }
3291 
__pyx_pf_6gssapi_3raw_12sec_contexts_2accept_sec_context(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_input_token,struct __pyx_obj_6gssapi_3raw_5creds_Creds * __pyx_v_acceptor_creds,struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_context,struct __pyx_obj_6gssapi_3raw_13chan_bindings_ChannelBindings * __pyx_v_channel_bindings)3292 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_2accept_sec_context(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input_token, struct __pyx_obj_6gssapi_3raw_5creds_Creds *__pyx_v_acceptor_creds, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, struct __pyx_obj_6gssapi_3raw_13chan_bindings_ChannelBindings *__pyx_v_channel_bindings) {
3293   gss_channel_bindings_t __pyx_v_bdng;
3294   gss_buffer_desc __pyx_v_input_token_buffer;
3295   struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_output_context = 0;
3296   gss_cred_id_t __pyx_v_act_acceptor_cred;
3297   gss_name_t __pyx_v_initiator_name;
3298   gss_OID __pyx_v_mech_type;
3299   gss_buffer_desc __pyx_v_output_token_buffer;
3300   OM_uint32 __pyx_v_ret_flags;
3301   OM_uint32 __pyx_v_output_ttl;
3302   gss_cred_id_t __pyx_v_delegated_cred;
3303   OM_uint32 __pyx_v_maj_stat;
3304   OM_uint32 __pyx_v_min_stat;
3305   PyObject *__pyx_v_output_token = NULL;
3306   OM_uint32 __pyx_v_tmp_min_stat;
3307   struct __pyx_obj_6gssapi_3raw_5names_Name *__pyx_v_on = 0;
3308   struct __pyx_obj_6gssapi_3raw_5creds_Creds *__pyx_v_oc = 0;
3309   struct __pyx_obj_6gssapi_3raw_4oids_OID *__pyx_v_py_mech_type = 0;
3310   PyObject *__pyx_v_output_ttl_py = NULL;
3311   PyObject *__pyx_r = NULL;
3312   __Pyx_RefNannyDeclarations
3313   int __pyx_t_1;
3314   int __pyx_t_2;
3315   gss_channel_bindings_t __pyx_t_3;
3316   gss_buffer_desc __pyx_t_4;
3317   Py_ssize_t __pyx_t_5;
3318   char *__pyx_t_6;
3319   PyObject *__pyx_t_7 = NULL;
3320   gss_cred_id_t __pyx_t_8;
3321   PyObject *__pyx_t_9 = NULL;
3322   PyObject *__pyx_t_10 = NULL;
3323   PyObject *__pyx_t_11 = NULL;
3324   PyObject *__pyx_t_12 = NULL;
3325   PyObject *__pyx_t_13 = NULL;
3326   PyObject *__pyx_t_14 = NULL;
3327   int __pyx_t_15;
3328   PyObject *__pyx_t_16 = NULL;
3329   int __pyx_lineno = 0;
3330   const char *__pyx_filename = NULL;
3331   int __pyx_clineno = 0;
3332   __Pyx_RefNannySetupContext("accept_sec_context", 0);
3333 
3334   /* "gssapi/raw/sec_contexts.pyx":295
3335  *
3336  *     cdef gss_channel_bindings_t bdng
3337  *     if channel_bindings is not None:             # <<<<<<<<<<<<<<
3338  *         bdng = channel_bindings.__cvalue__()
3339  *     else:
3340  */
3341   __pyx_t_1 = (((PyObject *)__pyx_v_channel_bindings) != Py_None);
3342   __pyx_t_2 = (__pyx_t_1 != 0);
3343   if (__pyx_t_2) {
3344 
3345     /* "gssapi/raw/sec_contexts.pyx":296
3346  *     cdef gss_channel_bindings_t bdng
3347  *     if channel_bindings is not None:
3348  *         bdng = channel_bindings.__cvalue__()             # <<<<<<<<<<<<<<
3349  *     else:
3350  *         bdng = GSS_C_NO_CHANNEL_BINDINGS
3351  */
3352     __pyx_t_3 = ((struct __pyx_vtabstruct_6gssapi_3raw_13chan_bindings_ChannelBindings *)__pyx_v_channel_bindings->__pyx_vtab)->__pyx___cvalue__(__pyx_v_channel_bindings); if (unlikely(__pyx_t_3 == ((gss_channel_bindings_t)NULL))) __PYX_ERR(1, 296, __pyx_L1_error)
3353     __pyx_v_bdng = __pyx_t_3;
3354 
3355     /* "gssapi/raw/sec_contexts.pyx":295
3356  *
3357  *     cdef gss_channel_bindings_t bdng
3358  *     if channel_bindings is not None:             # <<<<<<<<<<<<<<
3359  *         bdng = channel_bindings.__cvalue__()
3360  *     else:
3361  */
3362     goto __pyx_L3;
3363   }
3364 
3365   /* "gssapi/raw/sec_contexts.pyx":298
3366  *         bdng = channel_bindings.__cvalue__()
3367  *     else:
3368  *         bdng = GSS_C_NO_CHANNEL_BINDINGS             # <<<<<<<<<<<<<<
3369  *
3370  *     cdef gss_buffer_desc input_token_buffer = gss_buffer_desc(len(input_token),
3371  */
3372   /*else*/ {
3373     __pyx_v_bdng = GSS_C_NO_CHANNEL_BINDINGS;
3374   }
3375   __pyx_L3:;
3376 
3377   /* "gssapi/raw/sec_contexts.pyx":300
3378  *         bdng = GSS_C_NO_CHANNEL_BINDINGS
3379  *
3380  *     cdef gss_buffer_desc input_token_buffer = gss_buffer_desc(len(input_token),             # <<<<<<<<<<<<<<
3381  *                                                               input_token)
3382  *
3383  */
3384   __pyx_t_5 = PyObject_Length(__pyx_v_input_token); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 300, __pyx_L1_error)
3385   __pyx_t_4.length = __pyx_t_5;
3386 
3387   /* "gssapi/raw/sec_contexts.pyx":301
3388  *
3389  *     cdef gss_buffer_desc input_token_buffer = gss_buffer_desc(len(input_token),
3390  *                                                               input_token)             # <<<<<<<<<<<<<<
3391  *
3392  *     cdef SecurityContext output_context = context
3393  */
3394   __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_input_token); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 301, __pyx_L1_error)
3395   __pyx_t_4.value = __pyx_t_6;
3396   __pyx_v_input_token_buffer = __pyx_t_4;
3397 
3398   /* "gssapi/raw/sec_contexts.pyx":303
3399  *                                                               input_token)
3400  *
3401  *     cdef SecurityContext output_context = context             # <<<<<<<<<<<<<<
3402  *     if output_context is None:
3403  *         output_context = SecurityContext()
3404  */
3405   __Pyx_INCREF(((PyObject *)__pyx_v_context));
3406   __pyx_v_output_context = __pyx_v_context;
3407 
3408   /* "gssapi/raw/sec_contexts.pyx":304
3409  *
3410  *     cdef SecurityContext output_context = context
3411  *     if output_context is None:             # <<<<<<<<<<<<<<
3412  *         output_context = SecurityContext()
3413  *
3414  */
3415   __pyx_t_2 = (((PyObject *)__pyx_v_output_context) == Py_None);
3416   __pyx_t_1 = (__pyx_t_2 != 0);
3417   if (__pyx_t_1) {
3418 
3419     /* "gssapi/raw/sec_contexts.pyx":305
3420  *     cdef SecurityContext output_context = context
3421  *     if output_context is None:
3422  *         output_context = SecurityContext()             # <<<<<<<<<<<<<<
3423  *
3424  *     cdef gss_cred_id_t act_acceptor_cred
3425  */
3426     __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 305, __pyx_L1_error)
3427     __Pyx_GOTREF(__pyx_t_7);
3428     __Pyx_DECREF_SET(__pyx_v_output_context, ((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)__pyx_t_7));
3429     __pyx_t_7 = 0;
3430 
3431     /* "gssapi/raw/sec_contexts.pyx":304
3432  *
3433  *     cdef SecurityContext output_context = context
3434  *     if output_context is None:             # <<<<<<<<<<<<<<
3435  *         output_context = SecurityContext()
3436  *
3437  */
3438   }
3439 
3440   /* "gssapi/raw/sec_contexts.pyx":308
3441  *
3442  *     cdef gss_cred_id_t act_acceptor_cred
3443  *     if acceptor_creds is not None:             # <<<<<<<<<<<<<<
3444  *         act_acceptor_cred = acceptor_creds.raw_creds
3445  *     else:
3446  */
3447   __pyx_t_1 = (((PyObject *)__pyx_v_acceptor_creds) != Py_None);
3448   __pyx_t_2 = (__pyx_t_1 != 0);
3449   if (__pyx_t_2) {
3450 
3451     /* "gssapi/raw/sec_contexts.pyx":309
3452  *     cdef gss_cred_id_t act_acceptor_cred
3453  *     if acceptor_creds is not None:
3454  *         act_acceptor_cred = acceptor_creds.raw_creds             # <<<<<<<<<<<<<<
3455  *     else:
3456  *         act_acceptor_cred = GSS_C_NO_CREDENTIAL
3457  */
3458     __pyx_t_8 = __pyx_v_acceptor_creds->raw_creds;
3459     __pyx_v_act_acceptor_cred = __pyx_t_8;
3460 
3461     /* "gssapi/raw/sec_contexts.pyx":308
3462  *
3463  *     cdef gss_cred_id_t act_acceptor_cred
3464  *     if acceptor_creds is not None:             # <<<<<<<<<<<<<<
3465  *         act_acceptor_cred = acceptor_creds.raw_creds
3466  *     else:
3467  */
3468     goto __pyx_L5;
3469   }
3470 
3471   /* "gssapi/raw/sec_contexts.pyx":311
3472  *         act_acceptor_cred = acceptor_creds.raw_creds
3473  *     else:
3474  *         act_acceptor_cred = GSS_C_NO_CREDENTIAL             # <<<<<<<<<<<<<<
3475  *
3476  *     cdef gss_name_t initiator_name
3477  */
3478   /*else*/ {
3479     __pyx_v_act_acceptor_cred = GSS_C_NO_CREDENTIAL;
3480   }
3481   __pyx_L5:;
3482 
3483   /* "gssapi/raw/sec_contexts.pyx":316
3484  *     cdef gss_OID mech_type
3485  *     # GSS_C_EMPTY_BUFFER
3486  *     cdef gss_buffer_desc output_token_buffer = gss_buffer_desc(0, NULL)             # <<<<<<<<<<<<<<
3487  *     cdef OM_uint32 ret_flags
3488  *     cdef OM_uint32 output_ttl
3489  */
3490   __pyx_t_4.length = 0;
3491   __pyx_t_4.value = NULL;
3492   __pyx_v_output_token_buffer = __pyx_t_4;
3493 
3494   /* "gssapi/raw/sec_contexts.pyx":323
3495  *     cdef OM_uint32 maj_stat, min_stat
3496  *
3497  *     with nogil:             # <<<<<<<<<<<<<<
3498  *         maj_stat = gss_accept_sec_context(&min_stat, &output_context.raw_ctx,
3499  *                                           act_acceptor_cred,
3500  */
3501   {
3502       #ifdef WITH_THREAD
3503       PyThreadState *_save;
3504       Py_UNBLOCK_THREADS
3505       __Pyx_FastGIL_Remember();
3506       #endif
3507       /*try:*/ {
3508 
3509         /* "gssapi/raw/sec_contexts.pyx":324
3510  *
3511  *     with nogil:
3512  *         maj_stat = gss_accept_sec_context(&min_stat, &output_context.raw_ctx,             # <<<<<<<<<<<<<<
3513  *                                           act_acceptor_cred,
3514  *                                           &input_token_buffer, bdng,
3515  */
3516         __pyx_v_maj_stat = gss_accept_sec_context((&__pyx_v_min_stat), (&__pyx_v_output_context->raw_ctx), __pyx_v_act_acceptor_cred, (&__pyx_v_input_token_buffer), __pyx_v_bdng, (&__pyx_v_initiator_name), (&__pyx_v_mech_type), (&__pyx_v_output_token_buffer), (&__pyx_v_ret_flags), (&__pyx_v_output_ttl), (&__pyx_v_delegated_cred));
3517       }
3518 
3519       /* "gssapi/raw/sec_contexts.pyx":323
3520  *     cdef OM_uint32 maj_stat, min_stat
3521  *
3522  *     with nogil:             # <<<<<<<<<<<<<<
3523  *         maj_stat = gss_accept_sec_context(&min_stat, &output_context.raw_ctx,
3524  *                                           act_acceptor_cred,
3525  */
3526       /*finally:*/ {
3527         /*normal exit:*/{
3528           #ifdef WITH_THREAD
3529           __Pyx_FastGIL_Forget();
3530           Py_BLOCK_THREADS
3531           #endif
3532           goto __pyx_L8;
3533         }
3534         __pyx_L8:;
3535       }
3536   }
3537 
3538   /* "gssapi/raw/sec_contexts.pyx":332
3539  *                                           &delegated_cred)
3540  *
3541  *     output_token = None             # <<<<<<<<<<<<<<
3542  *     if output_token_buffer.length:
3543  *         output_token = \
3544  */
3545   __Pyx_INCREF(Py_None);
3546   __pyx_v_output_token = ((PyObject*)Py_None);
3547 
3548   /* "gssapi/raw/sec_contexts.pyx":333
3549  *
3550  *     output_token = None
3551  *     if output_token_buffer.length:             # <<<<<<<<<<<<<<
3552  *         output_token = \
3553  *             (<char*>output_token_buffer.value)[:output_token_buffer.length]
3554  */
3555   __pyx_t_2 = (__pyx_v_output_token_buffer.length != 0);
3556   if (__pyx_t_2) {
3557 
3558     /* "gssapi/raw/sec_contexts.pyx":335
3559  *     if output_token_buffer.length:
3560  *         output_token = \
3561  *             (<char*>output_token_buffer.value)[:output_token_buffer.length]             # <<<<<<<<<<<<<<
3562  *     cdef OM_uint32 tmp_min_stat
3563  *     gss_release_buffer(&tmp_min_stat, &output_token_buffer)
3564  */
3565     __pyx_t_7 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_output_token_buffer.value) + 0, __pyx_v_output_token_buffer.length - 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 335, __pyx_L1_error)
3566     __Pyx_GOTREF(__pyx_t_7);
3567     __Pyx_DECREF_SET(__pyx_v_output_token, ((PyObject*)__pyx_t_7));
3568     __pyx_t_7 = 0;
3569 
3570     /* "gssapi/raw/sec_contexts.pyx":333
3571  *
3572  *     output_token = None
3573  *     if output_token_buffer.length:             # <<<<<<<<<<<<<<
3574  *         output_token = \
3575  *             (<char*>output_token_buffer.value)[:output_token_buffer.length]
3576  */
3577   }
3578 
3579   /* "gssapi/raw/sec_contexts.pyx":337
3580  *             (<char*>output_token_buffer.value)[:output_token_buffer.length]
3581  *     cdef OM_uint32 tmp_min_stat
3582  *     gss_release_buffer(&tmp_min_stat, &output_token_buffer)             # <<<<<<<<<<<<<<
3583  *
3584  *     if channel_bindings is not None:
3585  */
3586   (void)(gss_release_buffer((&__pyx_v_tmp_min_stat), (&__pyx_v_output_token_buffer)));
3587 
3588   /* "gssapi/raw/sec_contexts.pyx":339
3589  *     gss_release_buffer(&tmp_min_stat, &output_token_buffer)
3590  *
3591  *     if channel_bindings is not None:             # <<<<<<<<<<<<<<
3592  *         free(bdng)
3593  *
3594  */
3595   __pyx_t_2 = (((PyObject *)__pyx_v_channel_bindings) != Py_None);
3596   __pyx_t_1 = (__pyx_t_2 != 0);
3597   if (__pyx_t_1) {
3598 
3599     /* "gssapi/raw/sec_contexts.pyx":340
3600  *
3601  *     if channel_bindings is not None:
3602  *         free(bdng)             # <<<<<<<<<<<<<<
3603  *
3604  *     cdef Name on = Name()
3605  */
3606     free(__pyx_v_bdng);
3607 
3608     /* "gssapi/raw/sec_contexts.pyx":339
3609  *     gss_release_buffer(&tmp_min_stat, &output_token_buffer)
3610  *
3611  *     if channel_bindings is not None:             # <<<<<<<<<<<<<<
3612  *         free(bdng)
3613  *
3614  */
3615   }
3616 
3617   /* "gssapi/raw/sec_contexts.pyx":342
3618  *         free(bdng)
3619  *
3620  *     cdef Name on = Name()             # <<<<<<<<<<<<<<
3621  *     cdef Creds oc = None
3622  *     cdef OID py_mech_type
3623  */
3624   __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gssapi_3raw_5names_Name)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 342, __pyx_L1_error)
3625   __Pyx_GOTREF(__pyx_t_7);
3626   __pyx_v_on = ((struct __pyx_obj_6gssapi_3raw_5names_Name *)__pyx_t_7);
3627   __pyx_t_7 = 0;
3628 
3629   /* "gssapi/raw/sec_contexts.pyx":343
3630  *
3631  *     cdef Name on = Name()
3632  *     cdef Creds oc = None             # <<<<<<<<<<<<<<
3633  *     cdef OID py_mech_type
3634  *     if maj_stat == GSS_S_COMPLETE or maj_stat == GSS_S_CONTINUE_NEEDED:
3635  */
3636   __Pyx_INCREF(Py_None);
3637   __pyx_v_oc = ((struct __pyx_obj_6gssapi_3raw_5creds_Creds *)Py_None);
3638 
3639   /* "gssapi/raw/sec_contexts.pyx":345
3640  *     cdef Creds oc = None
3641  *     cdef OID py_mech_type
3642  *     if maj_stat == GSS_S_COMPLETE or maj_stat == GSS_S_CONTINUE_NEEDED:             # <<<<<<<<<<<<<<
3643  *         if output_ttl == GSS_C_INDEFINITE:
3644  *             output_ttl_py = None
3645  */
3646   __pyx_t_2 = ((__pyx_v_maj_stat == GSS_S_COMPLETE) != 0);
3647   if (!__pyx_t_2) {
3648   } else {
3649     __pyx_t_1 = __pyx_t_2;
3650     goto __pyx_L12_bool_binop_done;
3651   }
3652   __pyx_t_2 = ((__pyx_v_maj_stat == GSS_S_CONTINUE_NEEDED) != 0);
3653   __pyx_t_1 = __pyx_t_2;
3654   __pyx_L12_bool_binop_done:;
3655   if (likely(__pyx_t_1)) {
3656 
3657     /* "gssapi/raw/sec_contexts.pyx":346
3658  *     cdef OID py_mech_type
3659  *     if maj_stat == GSS_S_COMPLETE or maj_stat == GSS_S_CONTINUE_NEEDED:
3660  *         if output_ttl == GSS_C_INDEFINITE:             # <<<<<<<<<<<<<<
3661  *             output_ttl_py = None
3662  *         else:
3663  */
3664     __pyx_t_1 = ((__pyx_v_output_ttl == GSS_C_INDEFINITE) != 0);
3665     if (__pyx_t_1) {
3666 
3667       /* "gssapi/raw/sec_contexts.pyx":347
3668  *     if maj_stat == GSS_S_COMPLETE or maj_stat == GSS_S_CONTINUE_NEEDED:
3669  *         if output_ttl == GSS_C_INDEFINITE:
3670  *             output_ttl_py = None             # <<<<<<<<<<<<<<
3671  *         else:
3672  *             output_ttl_py = output_ttl
3673  */
3674       __Pyx_INCREF(Py_None);
3675       __pyx_v_output_ttl_py = Py_None;
3676 
3677       /* "gssapi/raw/sec_contexts.pyx":346
3678  *     cdef OID py_mech_type
3679  *     if maj_stat == GSS_S_COMPLETE or maj_stat == GSS_S_CONTINUE_NEEDED:
3680  *         if output_ttl == GSS_C_INDEFINITE:             # <<<<<<<<<<<<<<
3681  *             output_ttl_py = None
3682  *         else:
3683  */
3684       goto __pyx_L14;
3685     }
3686 
3687     /* "gssapi/raw/sec_contexts.pyx":349
3688  *             output_ttl_py = None
3689  *         else:
3690  *             output_ttl_py = output_ttl             # <<<<<<<<<<<<<<
3691  *
3692  *         on.raw_name = initiator_name
3693  */
3694     /*else*/ {
3695       __pyx_t_7 = __Pyx_PyInt_From_uint32_t(__pyx_v_output_ttl); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 349, __pyx_L1_error)
3696       __Pyx_GOTREF(__pyx_t_7);
3697       __pyx_v_output_ttl_py = __pyx_t_7;
3698       __pyx_t_7 = 0;
3699     }
3700     __pyx_L14:;
3701 
3702     /* "gssapi/raw/sec_contexts.pyx":351
3703  *             output_ttl_py = output_ttl
3704  *
3705  *         on.raw_name = initiator_name             # <<<<<<<<<<<<<<
3706  *
3707  *         if delegated_cred is not NULL:
3708  */
3709     __pyx_v_on->raw_name = __pyx_v_initiator_name;
3710 
3711     /* "gssapi/raw/sec_contexts.pyx":353
3712  *         on.raw_name = initiator_name
3713  *
3714  *         if delegated_cred is not NULL:             # <<<<<<<<<<<<<<
3715  *             oc = Creds()
3716  *             oc.raw_creds = delegated_cred
3717  */
3718     __pyx_t_1 = ((__pyx_v_delegated_cred != NULL) != 0);
3719     if (__pyx_t_1) {
3720 
3721       /* "gssapi/raw/sec_contexts.pyx":354
3722  *
3723  *         if delegated_cred is not NULL:
3724  *             oc = Creds()             # <<<<<<<<<<<<<<
3725  *             oc.raw_creds = delegated_cred
3726  *
3727  */
3728       __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gssapi_3raw_5creds_Creds)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 354, __pyx_L1_error)
3729       __Pyx_GOTREF(__pyx_t_7);
3730       __Pyx_DECREF_SET(__pyx_v_oc, ((struct __pyx_obj_6gssapi_3raw_5creds_Creds *)__pyx_t_7));
3731       __pyx_t_7 = 0;
3732 
3733       /* "gssapi/raw/sec_contexts.pyx":355
3734  *         if delegated_cred is not NULL:
3735  *             oc = Creds()
3736  *             oc.raw_creds = delegated_cred             # <<<<<<<<<<<<<<
3737  *
3738  *         if mech_type is not NULL:
3739  */
3740       __pyx_v_oc->raw_creds = __pyx_v_delegated_cred;
3741 
3742       /* "gssapi/raw/sec_contexts.pyx":353
3743  *         on.raw_name = initiator_name
3744  *
3745  *         if delegated_cred is not NULL:             # <<<<<<<<<<<<<<
3746  *             oc = Creds()
3747  *             oc.raw_creds = delegated_cred
3748  */
3749     }
3750 
3751     /* "gssapi/raw/sec_contexts.pyx":357
3752  *             oc.raw_creds = delegated_cred
3753  *
3754  *         if mech_type is not NULL:             # <<<<<<<<<<<<<<
3755  *             py_mech_type = OID()
3756  *             py_mech_type.raw_oid = mech_type[0]
3757  */
3758     __pyx_t_1 = ((__pyx_v_mech_type != NULL) != 0);
3759     if (__pyx_t_1) {
3760 
3761       /* "gssapi/raw/sec_contexts.pyx":358
3762  *
3763  *         if mech_type is not NULL:
3764  *             py_mech_type = OID()             # <<<<<<<<<<<<<<
3765  *             py_mech_type.raw_oid = mech_type[0]
3766  *         else:
3767  */
3768       __pyx_t_7 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gssapi_3raw_4oids_OID)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 358, __pyx_L1_error)
3769       __Pyx_GOTREF(__pyx_t_7);
3770       __pyx_v_py_mech_type = ((struct __pyx_obj_6gssapi_3raw_4oids_OID *)__pyx_t_7);
3771       __pyx_t_7 = 0;
3772 
3773       /* "gssapi/raw/sec_contexts.pyx":359
3774  *         if mech_type is not NULL:
3775  *             py_mech_type = OID()
3776  *             py_mech_type.raw_oid = mech_type[0]             # <<<<<<<<<<<<<<
3777  *         else:
3778  *             py_mech_type = None
3779  */
3780       __pyx_v_py_mech_type->raw_oid = (__pyx_v_mech_type[0]);
3781 
3782       /* "gssapi/raw/sec_contexts.pyx":357
3783  *             oc.raw_creds = delegated_cred
3784  *
3785  *         if mech_type is not NULL:             # <<<<<<<<<<<<<<
3786  *             py_mech_type = OID()
3787  *             py_mech_type.raw_oid = mech_type[0]
3788  */
3789       goto __pyx_L16;
3790     }
3791 
3792     /* "gssapi/raw/sec_contexts.pyx":361
3793  *             py_mech_type.raw_oid = mech_type[0]
3794  *         else:
3795  *             py_mech_type = None             # <<<<<<<<<<<<<<
3796  *
3797  *         return AcceptSecContextResult(output_context, on, py_mech_type,
3798  */
3799     /*else*/ {
3800       __Pyx_INCREF(Py_None);
3801       __pyx_v_py_mech_type = ((struct __pyx_obj_6gssapi_3raw_4oids_OID *)Py_None);
3802     }
3803     __pyx_L16:;
3804 
3805     /* "gssapi/raw/sec_contexts.pyx":363
3806  *             py_mech_type = None
3807  *
3808  *         return AcceptSecContextResult(output_context, on, py_mech_type,             # <<<<<<<<<<<<<<
3809  *                                       output_token,
3810  *                                       IntEnumFlagSet(RequirementFlag,
3811  */
3812     __Pyx_XDECREF(__pyx_r);
3813     __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_AcceptSecContextResult); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 363, __pyx_L1_error)
3814     __Pyx_GOTREF(__pyx_t_9);
3815 
3816     /* "gssapi/raw/sec_contexts.pyx":365
3817  *         return AcceptSecContextResult(output_context, on, py_mech_type,
3818  *                                       output_token,
3819  *                                       IntEnumFlagSet(RequirementFlag,             # <<<<<<<<<<<<<<
3820  *                                                      ret_flags),
3821  *                                       output_ttl_py, oc,
3822  */
3823     __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_IntEnumFlagSet); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 365, __pyx_L1_error)
3824     __Pyx_GOTREF(__pyx_t_11);
3825     __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_RequirementFlag); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 365, __pyx_L1_error)
3826     __Pyx_GOTREF(__pyx_t_12);
3827 
3828     /* "gssapi/raw/sec_contexts.pyx":366
3829  *                                       output_token,
3830  *                                       IntEnumFlagSet(RequirementFlag,
3831  *                                                      ret_flags),             # <<<<<<<<<<<<<<
3832  *                                       output_ttl_py, oc,
3833  *                                       maj_stat == GSS_S_CONTINUE_NEEDED)
3834  */
3835     __pyx_t_13 = __Pyx_PyInt_From_uint32_t(__pyx_v_ret_flags); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 366, __pyx_L1_error)
3836     __Pyx_GOTREF(__pyx_t_13);
3837     __pyx_t_14 = NULL;
3838     __pyx_t_15 = 0;
3839     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
3840       __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_11);
3841       if (likely(__pyx_t_14)) {
3842         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
3843         __Pyx_INCREF(__pyx_t_14);
3844         __Pyx_INCREF(function);
3845         __Pyx_DECREF_SET(__pyx_t_11, function);
3846         __pyx_t_15 = 1;
3847       }
3848     }
3849     #if CYTHON_FAST_PYCALL
3850     if (PyFunction_Check(__pyx_t_11)) {
3851       PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_12, __pyx_t_13};
3852       __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 365, __pyx_L1_error)
3853       __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3854       __Pyx_GOTREF(__pyx_t_10);
3855       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3856       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3857     } else
3858     #endif
3859     #if CYTHON_FAST_PYCCALL
3860     if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
3861       PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_12, __pyx_t_13};
3862       __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 365, __pyx_L1_error)
3863       __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3864       __Pyx_GOTREF(__pyx_t_10);
3865       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3866       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3867     } else
3868     #endif
3869     {
3870       __pyx_t_16 = PyTuple_New(2+__pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 365, __pyx_L1_error)
3871       __Pyx_GOTREF(__pyx_t_16);
3872       if (__pyx_t_14) {
3873         __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14); __pyx_t_14 = NULL;
3874       }
3875       __Pyx_GIVEREF(__pyx_t_12);
3876       PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_15, __pyx_t_12);
3877       __Pyx_GIVEREF(__pyx_t_13);
3878       PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_15, __pyx_t_13);
3879       __pyx_t_12 = 0;
3880       __pyx_t_13 = 0;
3881       __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_16, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 365, __pyx_L1_error)
3882       __Pyx_GOTREF(__pyx_t_10);
3883       __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3884     }
3885     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3886 
3887     /* "gssapi/raw/sec_contexts.pyx":368
3888  *                                                      ret_flags),
3889  *                                       output_ttl_py, oc,
3890  *                                       maj_stat == GSS_S_CONTINUE_NEEDED)             # <<<<<<<<<<<<<<
3891  *     else:
3892  *         raise GSSError(maj_stat, min_stat, token=output_token)
3893  */
3894     __pyx_t_11 = __Pyx_PyBool_FromLong((__pyx_v_maj_stat == GSS_S_CONTINUE_NEEDED)); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 368, __pyx_L1_error)
3895     __Pyx_GOTREF(__pyx_t_11);
3896     __pyx_t_16 = NULL;
3897     __pyx_t_15 = 0;
3898     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
3899       __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_9);
3900       if (likely(__pyx_t_16)) {
3901         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
3902         __Pyx_INCREF(__pyx_t_16);
3903         __Pyx_INCREF(function);
3904         __Pyx_DECREF_SET(__pyx_t_9, function);
3905         __pyx_t_15 = 1;
3906       }
3907     }
3908     #if CYTHON_FAST_PYCALL
3909     if (PyFunction_Check(__pyx_t_9)) {
3910       PyObject *__pyx_temp[9] = {__pyx_t_16, ((PyObject *)__pyx_v_output_context), ((PyObject *)__pyx_v_on), ((PyObject *)__pyx_v_py_mech_type), __pyx_v_output_token, __pyx_t_10, __pyx_v_output_ttl_py, ((PyObject *)__pyx_v_oc), __pyx_t_11};
3911       __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_15, 8+__pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 363, __pyx_L1_error)
3912       __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3913       __Pyx_GOTREF(__pyx_t_7);
3914       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3915       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3916     } else
3917     #endif
3918     #if CYTHON_FAST_PYCCALL
3919     if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
3920       PyObject *__pyx_temp[9] = {__pyx_t_16, ((PyObject *)__pyx_v_output_context), ((PyObject *)__pyx_v_on), ((PyObject *)__pyx_v_py_mech_type), __pyx_v_output_token, __pyx_t_10, __pyx_v_output_ttl_py, ((PyObject *)__pyx_v_oc), __pyx_t_11};
3921       __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_15, 8+__pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 363, __pyx_L1_error)
3922       __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
3923       __Pyx_GOTREF(__pyx_t_7);
3924       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3925       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3926     } else
3927     #endif
3928     {
3929       __pyx_t_13 = PyTuple_New(8+__pyx_t_15); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 363, __pyx_L1_error)
3930       __Pyx_GOTREF(__pyx_t_13);
3931       if (__pyx_t_16) {
3932         __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_16); __pyx_t_16 = NULL;
3933       }
3934       __Pyx_INCREF(((PyObject *)__pyx_v_output_context));
3935       __Pyx_GIVEREF(((PyObject *)__pyx_v_output_context));
3936       PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_15, ((PyObject *)__pyx_v_output_context));
3937       __Pyx_INCREF(((PyObject *)__pyx_v_on));
3938       __Pyx_GIVEREF(((PyObject *)__pyx_v_on));
3939       PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_15, ((PyObject *)__pyx_v_on));
3940       __Pyx_INCREF(((PyObject *)__pyx_v_py_mech_type));
3941       __Pyx_GIVEREF(((PyObject *)__pyx_v_py_mech_type));
3942       PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_15, ((PyObject *)__pyx_v_py_mech_type));
3943       __Pyx_INCREF(__pyx_v_output_token);
3944       __Pyx_GIVEREF(__pyx_v_output_token);
3945       PyTuple_SET_ITEM(__pyx_t_13, 3+__pyx_t_15, __pyx_v_output_token);
3946       __Pyx_GIVEREF(__pyx_t_10);
3947       PyTuple_SET_ITEM(__pyx_t_13, 4+__pyx_t_15, __pyx_t_10);
3948       __Pyx_INCREF(__pyx_v_output_ttl_py);
3949       __Pyx_GIVEREF(__pyx_v_output_ttl_py);
3950       PyTuple_SET_ITEM(__pyx_t_13, 5+__pyx_t_15, __pyx_v_output_ttl_py);
3951       __Pyx_INCREF(((PyObject *)__pyx_v_oc));
3952       __Pyx_GIVEREF(((PyObject *)__pyx_v_oc));
3953       PyTuple_SET_ITEM(__pyx_t_13, 6+__pyx_t_15, ((PyObject *)__pyx_v_oc));
3954       __Pyx_GIVEREF(__pyx_t_11);
3955       PyTuple_SET_ITEM(__pyx_t_13, 7+__pyx_t_15, __pyx_t_11);
3956       __pyx_t_10 = 0;
3957       __pyx_t_11 = 0;
3958       __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_13, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 363, __pyx_L1_error)
3959       __Pyx_GOTREF(__pyx_t_7);
3960       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3961     }
3962     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3963     __pyx_r = __pyx_t_7;
3964     __pyx_t_7 = 0;
3965     goto __pyx_L0;
3966 
3967     /* "gssapi/raw/sec_contexts.pyx":345
3968  *     cdef Creds oc = None
3969  *     cdef OID py_mech_type
3970  *     if maj_stat == GSS_S_COMPLETE or maj_stat == GSS_S_CONTINUE_NEEDED:             # <<<<<<<<<<<<<<
3971  *         if output_ttl == GSS_C_INDEFINITE:
3972  *             output_ttl_py = None
3973  */
3974   }
3975 
3976   /* "gssapi/raw/sec_contexts.pyx":370
3977  *                                       maj_stat == GSS_S_CONTINUE_NEEDED)
3978  *     else:
3979  *         raise GSSError(maj_stat, min_stat, token=output_token)             # <<<<<<<<<<<<<<
3980  *
3981  *
3982  */
3983   /*else*/ {
3984     __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_GSSError); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 370, __pyx_L1_error)
3985     __Pyx_GOTREF(__pyx_t_7);
3986     __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_maj_stat); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 370, __pyx_L1_error)
3987     __Pyx_GOTREF(__pyx_t_9);
3988     __pyx_t_13 = __Pyx_PyInt_From_uint32_t(__pyx_v_min_stat); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 370, __pyx_L1_error)
3989     __Pyx_GOTREF(__pyx_t_13);
3990     __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 370, __pyx_L1_error)
3991     __Pyx_GOTREF(__pyx_t_11);
3992     __Pyx_GIVEREF(__pyx_t_9);
3993     PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
3994     __Pyx_GIVEREF(__pyx_t_13);
3995     PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13);
3996     __pyx_t_9 = 0;
3997     __pyx_t_13 = 0;
3998     __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 370, __pyx_L1_error)
3999     __Pyx_GOTREF(__pyx_t_13);
4000     if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_token, __pyx_v_output_token) < 0) __PYX_ERR(1, 370, __pyx_L1_error)
4001     __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 370, __pyx_L1_error)
4002     __Pyx_GOTREF(__pyx_t_9);
4003     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4004     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4005     __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4006     __Pyx_Raise(__pyx_t_9, 0, 0, 0);
4007     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4008     __PYX_ERR(1, 370, __pyx_L1_error)
4009   }
4010 
4011   /* "gssapi/raw/sec_contexts.pyx":248
4012  *
4013  *
4014  * def accept_sec_context(input_token not None, Creds acceptor_creds=None,             # <<<<<<<<<<<<<<
4015  *                        SecurityContext context=None,
4016  *                        ChannelBindings channel_bindings=None):
4017  */
4018 
4019   /* function exit code */
4020   __pyx_L1_error:;
4021   __Pyx_XDECREF(__pyx_t_7);
4022   __Pyx_XDECREF(__pyx_t_9);
4023   __Pyx_XDECREF(__pyx_t_10);
4024   __Pyx_XDECREF(__pyx_t_11);
4025   __Pyx_XDECREF(__pyx_t_12);
4026   __Pyx_XDECREF(__pyx_t_13);
4027   __Pyx_XDECREF(__pyx_t_14);
4028   __Pyx_XDECREF(__pyx_t_16);
4029   __Pyx_AddTraceback("gssapi.raw.sec_contexts.accept_sec_context", __pyx_clineno, __pyx_lineno, __pyx_filename);
4030   __pyx_r = NULL;
4031   __pyx_L0:;
4032   __Pyx_XDECREF((PyObject *)__pyx_v_output_context);
4033   __Pyx_XDECREF(__pyx_v_output_token);
4034   __Pyx_XDECREF((PyObject *)__pyx_v_on);
4035   __Pyx_XDECREF((PyObject *)__pyx_v_oc);
4036   __Pyx_XDECREF((PyObject *)__pyx_v_py_mech_type);
4037   __Pyx_XDECREF(__pyx_v_output_ttl_py);
4038   __Pyx_XGIVEREF(__pyx_r);
4039   __Pyx_RefNannyFinishContext();
4040   return __pyx_r;
4041 }
4042 
4043 /* "gssapi/raw/sec_contexts.pyx":373
4044  *
4045  *
4046  * def inquire_context(SecurityContext context not None, initiator_name=True,             # <<<<<<<<<<<<<<
4047  *                     target_name=True, lifetime=True, mech=True,
4048  *                     flags=True, locally_init=True, complete=True):
4049  */
4050 
4051 /* Python wrapper */
4052 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_5inquire_context(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4053 static char __pyx_doc_6gssapi_3raw_12sec_contexts_4inquire_context[] = "\n    inquire_context(context, initiator_name=True, target_name=True, lifetime=True, mech=True, flags=True, locally_init=True, complete=True)\n    Get information about a security context.\n\n    This method obtains information about a security context, including\n    the initiator and target names, as well as the TTL, mech,\n    flags, and its current state (open vs closed).\n\n    Note:\n        the target name may be ``None`` if it would have been ``GSS_C_NO_NAME``\n\n    Args:\n        context (SecurityContext): the context in question\n\n    Returns:\n        InquireContextResult: the initiator name, the target name, the TTL\n            (can be None for indefinite or not supported), the mech type, the\n            flags, whether or not the context was locally initiated,\n            and whether or not the context is currently fully established\n\n    Raises:\n        MissingContextError\n    ";
4054 static PyMethodDef __pyx_mdef_6gssapi_3raw_12sec_contexts_5inquire_context = {"inquire_context", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gssapi_3raw_12sec_contexts_5inquire_context, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gssapi_3raw_12sec_contexts_4inquire_context};
__pyx_pw_6gssapi_3raw_12sec_contexts_5inquire_context(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4055 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_5inquire_context(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4056   struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context = 0;
4057   PyObject *__pyx_v_initiator_name = 0;
4058   PyObject *__pyx_v_target_name = 0;
4059   PyObject *__pyx_v_lifetime = 0;
4060   PyObject *__pyx_v_mech = 0;
4061   PyObject *__pyx_v_flags = 0;
4062   PyObject *__pyx_v_locally_init = 0;
4063   PyObject *__pyx_v_complete = 0;
4064   int __pyx_lineno = 0;
4065   const char *__pyx_filename = NULL;
4066   int __pyx_clineno = 0;
4067   PyObject *__pyx_r = 0;
4068   __Pyx_RefNannyDeclarations
4069   __Pyx_RefNannySetupContext("inquire_context (wrapper)", 0);
4070   {
4071     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_initiator_name,&__pyx_n_s_target_name,&__pyx_n_s_lifetime,&__pyx_n_s_mech,&__pyx_n_s_flags,&__pyx_n_s_locally_init,&__pyx_n_s_complete,0};
4072     PyObject* values[8] = {0,0,0,0,0,0,0,0};
4073     values[1] = ((PyObject *)Py_True);
4074 
4075     /* "gssapi/raw/sec_contexts.pyx":374
4076  *
4077  * def inquire_context(SecurityContext context not None, initiator_name=True,
4078  *                     target_name=True, lifetime=True, mech=True,             # <<<<<<<<<<<<<<
4079  *                     flags=True, locally_init=True, complete=True):
4080  *     """
4081  */
4082     values[2] = ((PyObject *)Py_True);
4083     values[3] = ((PyObject *)Py_True);
4084     values[4] = ((PyObject *)Py_True);
4085 
4086     /* "gssapi/raw/sec_contexts.pyx":375
4087  * def inquire_context(SecurityContext context not None, initiator_name=True,
4088  *                     target_name=True, lifetime=True, mech=True,
4089  *                     flags=True, locally_init=True, complete=True):             # <<<<<<<<<<<<<<
4090  *     """
4091  *     inquire_context(context, initiator_name=True, target_name=True, \
4092  */
4093     values[5] = ((PyObject *)Py_True);
4094     values[6] = ((PyObject *)Py_True);
4095     values[7] = ((PyObject *)Py_True);
4096     if (unlikely(__pyx_kwds)) {
4097       Py_ssize_t kw_args;
4098       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4099       switch (pos_args) {
4100         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4101         CYTHON_FALLTHROUGH;
4102         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4103         CYTHON_FALLTHROUGH;
4104         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4105         CYTHON_FALLTHROUGH;
4106         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4107         CYTHON_FALLTHROUGH;
4108         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4109         CYTHON_FALLTHROUGH;
4110         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4111         CYTHON_FALLTHROUGH;
4112         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4113         CYTHON_FALLTHROUGH;
4114         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4115         CYTHON_FALLTHROUGH;
4116         case  0: break;
4117         default: goto __pyx_L5_argtuple_error;
4118       }
4119       kw_args = PyDict_Size(__pyx_kwds);
4120       switch (pos_args) {
4121         case  0:
4122         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
4123         else goto __pyx_L5_argtuple_error;
4124         CYTHON_FALLTHROUGH;
4125         case  1:
4126         if (kw_args > 0) {
4127           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_initiator_name);
4128           if (value) { values[1] = value; kw_args--; }
4129         }
4130         CYTHON_FALLTHROUGH;
4131         case  2:
4132         if (kw_args > 0) {
4133           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_target_name);
4134           if (value) { values[2] = value; kw_args--; }
4135         }
4136         CYTHON_FALLTHROUGH;
4137         case  3:
4138         if (kw_args > 0) {
4139           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lifetime);
4140           if (value) { values[3] = value; kw_args--; }
4141         }
4142         CYTHON_FALLTHROUGH;
4143         case  4:
4144         if (kw_args > 0) {
4145           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mech);
4146           if (value) { values[4] = value; kw_args--; }
4147         }
4148         CYTHON_FALLTHROUGH;
4149         case  5:
4150         if (kw_args > 0) {
4151           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags);
4152           if (value) { values[5] = value; kw_args--; }
4153         }
4154         CYTHON_FALLTHROUGH;
4155         case  6:
4156         if (kw_args > 0) {
4157           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_locally_init);
4158           if (value) { values[6] = value; kw_args--; }
4159         }
4160         CYTHON_FALLTHROUGH;
4161         case  7:
4162         if (kw_args > 0) {
4163           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_complete);
4164           if (value) { values[7] = value; kw_args--; }
4165         }
4166       }
4167       if (unlikely(kw_args > 0)) {
4168         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inquire_context") < 0)) __PYX_ERR(1, 373, __pyx_L3_error)
4169       }
4170     } else {
4171       switch (PyTuple_GET_SIZE(__pyx_args)) {
4172         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
4173         CYTHON_FALLTHROUGH;
4174         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4175         CYTHON_FALLTHROUGH;
4176         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4177         CYTHON_FALLTHROUGH;
4178         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4179         CYTHON_FALLTHROUGH;
4180         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4181         CYTHON_FALLTHROUGH;
4182         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4183         CYTHON_FALLTHROUGH;
4184         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4185         CYTHON_FALLTHROUGH;
4186         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4187         break;
4188         default: goto __pyx_L5_argtuple_error;
4189       }
4190     }
4191     __pyx_v_context = ((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)values[0]);
4192     __pyx_v_initiator_name = values[1];
4193     __pyx_v_target_name = values[2];
4194     __pyx_v_lifetime = values[3];
4195     __pyx_v_mech = values[4];
4196     __pyx_v_flags = values[5];
4197     __pyx_v_locally_init = values[6];
4198     __pyx_v_complete = values[7];
4199   }
4200   goto __pyx_L4_argument_unpacking_done;
4201   __pyx_L5_argtuple_error:;
4202   __Pyx_RaiseArgtupleInvalid("inquire_context", 0, 1, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 373, __pyx_L3_error)
4203   __pyx_L3_error:;
4204   __Pyx_AddTraceback("gssapi.raw.sec_contexts.inquire_context", __pyx_clineno, __pyx_lineno, __pyx_filename);
4205   __Pyx_RefNannyFinishContext();
4206   return NULL;
4207   __pyx_L4_argument_unpacking_done:;
4208   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext, 0, "context", 0))) __PYX_ERR(1, 373, __pyx_L1_error)
4209   __pyx_r = __pyx_pf_6gssapi_3raw_12sec_contexts_4inquire_context(__pyx_self, __pyx_v_context, __pyx_v_initiator_name, __pyx_v_target_name, __pyx_v_lifetime, __pyx_v_mech, __pyx_v_flags, __pyx_v_locally_init, __pyx_v_complete);
4210 
4211   /* "gssapi/raw/sec_contexts.pyx":373
4212  *
4213  *
4214  * def inquire_context(SecurityContext context not None, initiator_name=True,             # <<<<<<<<<<<<<<
4215  *                     target_name=True, lifetime=True, mech=True,
4216  *                     flags=True, locally_init=True, complete=True):
4217  */
4218 
4219   /* function exit code */
4220   goto __pyx_L0;
4221   __pyx_L1_error:;
4222   __pyx_r = NULL;
4223   __pyx_L0:;
4224   __Pyx_RefNannyFinishContext();
4225   return __pyx_r;
4226 }
4227 
__pyx_pf_6gssapi_3raw_12sec_contexts_4inquire_context(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_context,PyObject * __pyx_v_initiator_name,PyObject * __pyx_v_target_name,PyObject * __pyx_v_lifetime,PyObject * __pyx_v_mech,PyObject * __pyx_v_flags,PyObject * __pyx_v_locally_init,PyObject * __pyx_v_complete)4228 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_4inquire_context(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, PyObject *__pyx_v_initiator_name, PyObject *__pyx_v_target_name, PyObject *__pyx_v_lifetime, PyObject *__pyx_v_mech, PyObject *__pyx_v_flags, PyObject *__pyx_v_locally_init, PyObject *__pyx_v_complete) {
4229   gss_name_t __pyx_v_output_init_name;
4230   gss_name_t *__pyx_v_init_name_ptr;
4231   gss_name_t __pyx_v_output_target_name;
4232   gss_name_t *__pyx_v_target_name_ptr;
4233   OM_uint32 __pyx_v_ttl;
4234   OM_uint32 *__pyx_v_ttl_ptr;
4235   gss_OID __pyx_v_output_mech_type;
4236   gss_OID *__pyx_v_mech_type_ptr;
4237   OM_uint32 __pyx_v_output_flags;
4238   OM_uint32 *__pyx_v_flags_ptr;
4239   int __pyx_v_output_locally_init;
4240   int *__pyx_v_locally_init_ptr;
4241   int __pyx_v_is_complete;
4242   int *__pyx_v_is_complete_ptr;
4243   OM_uint32 __pyx_v_maj_stat;
4244   OM_uint32 __pyx_v_min_stat;
4245   struct __pyx_obj_6gssapi_3raw_5names_Name *__pyx_v_sn = 0;
4246   struct __pyx_obj_6gssapi_3raw_4oids_OID *__pyx_v_py_mech_type = 0;
4247   struct __pyx_obj_6gssapi_3raw_5names_Name *__pyx_v_tn = 0;
4248   PyObject *__pyx_v_py_ttl = NULL;
4249   PyObject *__pyx_v_py_flags = NULL;
4250   PyObject *__pyx_v_py_locally_init = NULL;
4251   PyObject *__pyx_v_py_complete = NULL;
4252   PyObject *__pyx_r = NULL;
4253   __Pyx_RefNannyDeclarations
4254   int __pyx_t_1;
4255   PyObject *__pyx_t_2 = NULL;
4256   int __pyx_t_3;
4257   PyObject *__pyx_t_4 = NULL;
4258   PyObject *__pyx_t_5 = NULL;
4259   PyObject *__pyx_t_6 = NULL;
4260   PyObject *__pyx_t_7 = NULL;
4261   int __pyx_t_8;
4262   PyObject *__pyx_t_9 = NULL;
4263   int __pyx_lineno = 0;
4264   const char *__pyx_filename = NULL;
4265   int __pyx_clineno = 0;
4266   __Pyx_RefNannySetupContext("inquire_context", 0);
4267 
4268   /* "gssapi/raw/sec_contexts.pyx":402
4269  *
4270  *     cdef gss_name_t output_init_name
4271  *     cdef gss_name_t *init_name_ptr = NULL             # <<<<<<<<<<<<<<
4272  *     if initiator_name:
4273  *         init_name_ptr = &output_init_name
4274  */
4275   __pyx_v_init_name_ptr = NULL;
4276 
4277   /* "gssapi/raw/sec_contexts.pyx":403
4278  *     cdef gss_name_t output_init_name
4279  *     cdef gss_name_t *init_name_ptr = NULL
4280  *     if initiator_name:             # <<<<<<<<<<<<<<
4281  *         init_name_ptr = &output_init_name
4282  *
4283  */
4284   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_initiator_name); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 403, __pyx_L1_error)
4285   if (__pyx_t_1) {
4286 
4287     /* "gssapi/raw/sec_contexts.pyx":404
4288  *     cdef gss_name_t *init_name_ptr = NULL
4289  *     if initiator_name:
4290  *         init_name_ptr = &output_init_name             # <<<<<<<<<<<<<<
4291  *
4292  *     cdef gss_name_t output_target_name
4293  */
4294     __pyx_v_init_name_ptr = (&__pyx_v_output_init_name);
4295 
4296     /* "gssapi/raw/sec_contexts.pyx":403
4297  *     cdef gss_name_t output_init_name
4298  *     cdef gss_name_t *init_name_ptr = NULL
4299  *     if initiator_name:             # <<<<<<<<<<<<<<
4300  *         init_name_ptr = &output_init_name
4301  *
4302  */
4303   }
4304 
4305   /* "gssapi/raw/sec_contexts.pyx":407
4306  *
4307  *     cdef gss_name_t output_target_name
4308  *     cdef gss_name_t *target_name_ptr = NULL             # <<<<<<<<<<<<<<
4309  *     if target_name:
4310  *         target_name_ptr = &output_target_name
4311  */
4312   __pyx_v_target_name_ptr = NULL;
4313 
4314   /* "gssapi/raw/sec_contexts.pyx":408
4315  *     cdef gss_name_t output_target_name
4316  *     cdef gss_name_t *target_name_ptr = NULL
4317  *     if target_name:             # <<<<<<<<<<<<<<
4318  *         target_name_ptr = &output_target_name
4319  *
4320  */
4321   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_target_name); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 408, __pyx_L1_error)
4322   if (__pyx_t_1) {
4323 
4324     /* "gssapi/raw/sec_contexts.pyx":409
4325  *     cdef gss_name_t *target_name_ptr = NULL
4326  *     if target_name:
4327  *         target_name_ptr = &output_target_name             # <<<<<<<<<<<<<<
4328  *
4329  *     cdef OM_uint32 ttl
4330  */
4331     __pyx_v_target_name_ptr = (&__pyx_v_output_target_name);
4332 
4333     /* "gssapi/raw/sec_contexts.pyx":408
4334  *     cdef gss_name_t output_target_name
4335  *     cdef gss_name_t *target_name_ptr = NULL
4336  *     if target_name:             # <<<<<<<<<<<<<<
4337  *         target_name_ptr = &output_target_name
4338  *
4339  */
4340   }
4341 
4342   /* "gssapi/raw/sec_contexts.pyx":412
4343  *
4344  *     cdef OM_uint32 ttl
4345  *     cdef OM_uint32 *ttl_ptr = NULL             # <<<<<<<<<<<<<<
4346  *     if lifetime:
4347  *         ttl_ptr = &ttl
4348  */
4349   __pyx_v_ttl_ptr = NULL;
4350 
4351   /* "gssapi/raw/sec_contexts.pyx":413
4352  *     cdef OM_uint32 ttl
4353  *     cdef OM_uint32 *ttl_ptr = NULL
4354  *     if lifetime:             # <<<<<<<<<<<<<<
4355  *         ttl_ptr = &ttl
4356  *
4357  */
4358   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_lifetime); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 413, __pyx_L1_error)
4359   if (__pyx_t_1) {
4360 
4361     /* "gssapi/raw/sec_contexts.pyx":414
4362  *     cdef OM_uint32 *ttl_ptr = NULL
4363  *     if lifetime:
4364  *         ttl_ptr = &ttl             # <<<<<<<<<<<<<<
4365  *
4366  *     cdef gss_OID output_mech_type
4367  */
4368     __pyx_v_ttl_ptr = (&__pyx_v_ttl);
4369 
4370     /* "gssapi/raw/sec_contexts.pyx":413
4371  *     cdef OM_uint32 ttl
4372  *     cdef OM_uint32 *ttl_ptr = NULL
4373  *     if lifetime:             # <<<<<<<<<<<<<<
4374  *         ttl_ptr = &ttl
4375  *
4376  */
4377   }
4378 
4379   /* "gssapi/raw/sec_contexts.pyx":417
4380  *
4381  *     cdef gss_OID output_mech_type
4382  *     cdef gss_OID *mech_type_ptr = NULL             # <<<<<<<<<<<<<<
4383  *     if mech:
4384  *         mech_type_ptr = &output_mech_type
4385  */
4386   __pyx_v_mech_type_ptr = NULL;
4387 
4388   /* "gssapi/raw/sec_contexts.pyx":418
4389  *     cdef gss_OID output_mech_type
4390  *     cdef gss_OID *mech_type_ptr = NULL
4391  *     if mech:             # <<<<<<<<<<<<<<
4392  *         mech_type_ptr = &output_mech_type
4393  *
4394  */
4395   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_mech); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 418, __pyx_L1_error)
4396   if (__pyx_t_1) {
4397 
4398     /* "gssapi/raw/sec_contexts.pyx":419
4399  *     cdef gss_OID *mech_type_ptr = NULL
4400  *     if mech:
4401  *         mech_type_ptr = &output_mech_type             # <<<<<<<<<<<<<<
4402  *
4403  *     cdef OM_uint32 output_flags
4404  */
4405     __pyx_v_mech_type_ptr = (&__pyx_v_output_mech_type);
4406 
4407     /* "gssapi/raw/sec_contexts.pyx":418
4408  *     cdef gss_OID output_mech_type
4409  *     cdef gss_OID *mech_type_ptr = NULL
4410  *     if mech:             # <<<<<<<<<<<<<<
4411  *         mech_type_ptr = &output_mech_type
4412  *
4413  */
4414   }
4415 
4416   /* "gssapi/raw/sec_contexts.pyx":422
4417  *
4418  *     cdef OM_uint32 output_flags
4419  *     cdef OM_uint32 *flags_ptr = NULL             # <<<<<<<<<<<<<<
4420  *     if flags:
4421  *         flags_ptr = &output_flags
4422  */
4423   __pyx_v_flags_ptr = NULL;
4424 
4425   /* "gssapi/raw/sec_contexts.pyx":423
4426  *     cdef OM_uint32 output_flags
4427  *     cdef OM_uint32 *flags_ptr = NULL
4428  *     if flags:             # <<<<<<<<<<<<<<
4429  *         flags_ptr = &output_flags
4430  *
4431  */
4432   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flags); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 423, __pyx_L1_error)
4433   if (__pyx_t_1) {
4434 
4435     /* "gssapi/raw/sec_contexts.pyx":424
4436  *     cdef OM_uint32 *flags_ptr = NULL
4437  *     if flags:
4438  *         flags_ptr = &output_flags             # <<<<<<<<<<<<<<
4439  *
4440  *     cdef int output_locally_init
4441  */
4442     __pyx_v_flags_ptr = (&__pyx_v_output_flags);
4443 
4444     /* "gssapi/raw/sec_contexts.pyx":423
4445  *     cdef OM_uint32 output_flags
4446  *     cdef OM_uint32 *flags_ptr = NULL
4447  *     if flags:             # <<<<<<<<<<<<<<
4448  *         flags_ptr = &output_flags
4449  *
4450  */
4451   }
4452 
4453   /* "gssapi/raw/sec_contexts.pyx":427
4454  *
4455  *     cdef int output_locally_init
4456  *     cdef int *locally_init_ptr = NULL             # <<<<<<<<<<<<<<
4457  *     if locally_init:
4458  *         locally_init_ptr = &output_locally_init
4459  */
4460   __pyx_v_locally_init_ptr = NULL;
4461 
4462   /* "gssapi/raw/sec_contexts.pyx":428
4463  *     cdef int output_locally_init
4464  *     cdef int *locally_init_ptr = NULL
4465  *     if locally_init:             # <<<<<<<<<<<<<<
4466  *         locally_init_ptr = &output_locally_init
4467  *
4468  */
4469   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_locally_init); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 428, __pyx_L1_error)
4470   if (__pyx_t_1) {
4471 
4472     /* "gssapi/raw/sec_contexts.pyx":429
4473  *     cdef int *locally_init_ptr = NULL
4474  *     if locally_init:
4475  *         locally_init_ptr = &output_locally_init             # <<<<<<<<<<<<<<
4476  *
4477  *     cdef int is_complete
4478  */
4479     __pyx_v_locally_init_ptr = (&__pyx_v_output_locally_init);
4480 
4481     /* "gssapi/raw/sec_contexts.pyx":428
4482  *     cdef int output_locally_init
4483  *     cdef int *locally_init_ptr = NULL
4484  *     if locally_init:             # <<<<<<<<<<<<<<
4485  *         locally_init_ptr = &output_locally_init
4486  *
4487  */
4488   }
4489 
4490   /* "gssapi/raw/sec_contexts.pyx":432
4491  *
4492  *     cdef int is_complete
4493  *     cdef int *is_complete_ptr = NULL             # <<<<<<<<<<<<<<
4494  *     if complete:
4495  *         is_complete_ptr = &is_complete
4496  */
4497   __pyx_v_is_complete_ptr = NULL;
4498 
4499   /* "gssapi/raw/sec_contexts.pyx":433
4500  *     cdef int is_complete
4501  *     cdef int *is_complete_ptr = NULL
4502  *     if complete:             # <<<<<<<<<<<<<<
4503  *         is_complete_ptr = &is_complete
4504  *
4505  */
4506   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_complete); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 433, __pyx_L1_error)
4507   if (__pyx_t_1) {
4508 
4509     /* "gssapi/raw/sec_contexts.pyx":434
4510  *     cdef int *is_complete_ptr = NULL
4511  *     if complete:
4512  *         is_complete_ptr = &is_complete             # <<<<<<<<<<<<<<
4513  *
4514  *     cdef OM_uint32 maj_stat, min_stat
4515  */
4516     __pyx_v_is_complete_ptr = (&__pyx_v_is_complete);
4517 
4518     /* "gssapi/raw/sec_contexts.pyx":433
4519  *     cdef int is_complete
4520  *     cdef int *is_complete_ptr = NULL
4521  *     if complete:             # <<<<<<<<<<<<<<
4522  *         is_complete_ptr = &is_complete
4523  *
4524  */
4525   }
4526 
4527   /* "gssapi/raw/sec_contexts.pyx":438
4528  *     cdef OM_uint32 maj_stat, min_stat
4529  *
4530  *     maj_stat = gss_inquire_context(&min_stat, context.raw_ctx, init_name_ptr,             # <<<<<<<<<<<<<<
4531  *                                    target_name_ptr, ttl_ptr, mech_type_ptr,
4532  *                                    flags_ptr, locally_init_ptr,
4533  */
4534   __pyx_v_maj_stat = gss_inquire_context((&__pyx_v_min_stat), __pyx_v_context->raw_ctx, __pyx_v_init_name_ptr, __pyx_v_target_name_ptr, __pyx_v_ttl_ptr, __pyx_v_mech_type_ptr, __pyx_v_flags_ptr, __pyx_v_locally_init_ptr, __pyx_v_is_complete_ptr);
4535 
4536   /* "gssapi/raw/sec_contexts.pyx":446
4537  *     cdef OID py_mech_type
4538  *     cdef Name tn
4539  *     if maj_stat == GSS_S_COMPLETE:             # <<<<<<<<<<<<<<
4540  *         if initiator_name:
4541  *             sn = Name()
4542  */
4543   __pyx_t_1 = ((__pyx_v_maj_stat == GSS_S_COMPLETE) != 0);
4544   if (likely(__pyx_t_1)) {
4545 
4546     /* "gssapi/raw/sec_contexts.pyx":447
4547  *     cdef Name tn
4548  *     if maj_stat == GSS_S_COMPLETE:
4549  *         if initiator_name:             # <<<<<<<<<<<<<<
4550  *             sn = Name()
4551  *             sn.raw_name = output_init_name
4552  */
4553     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_initiator_name); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 447, __pyx_L1_error)
4554     if (__pyx_t_1) {
4555 
4556       /* "gssapi/raw/sec_contexts.pyx":448
4557  *     if maj_stat == GSS_S_COMPLETE:
4558  *         if initiator_name:
4559  *             sn = Name()             # <<<<<<<<<<<<<<
4560  *             sn.raw_name = output_init_name
4561  *         else:
4562  */
4563       __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gssapi_3raw_5names_Name)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 448, __pyx_L1_error)
4564       __Pyx_GOTREF(__pyx_t_2);
4565       __pyx_v_sn = ((struct __pyx_obj_6gssapi_3raw_5names_Name *)__pyx_t_2);
4566       __pyx_t_2 = 0;
4567 
4568       /* "gssapi/raw/sec_contexts.pyx":449
4569  *         if initiator_name:
4570  *             sn = Name()
4571  *             sn.raw_name = output_init_name             # <<<<<<<<<<<<<<
4572  *         else:
4573  *             sn = None
4574  */
4575       __pyx_v_sn->raw_name = __pyx_v_output_init_name;
4576 
4577       /* "gssapi/raw/sec_contexts.pyx":447
4578  *     cdef Name tn
4579  *     if maj_stat == GSS_S_COMPLETE:
4580  *         if initiator_name:             # <<<<<<<<<<<<<<
4581  *             sn = Name()
4582  *             sn.raw_name = output_init_name
4583  */
4584       goto __pyx_L11;
4585     }
4586 
4587     /* "gssapi/raw/sec_contexts.pyx":451
4588  *             sn.raw_name = output_init_name
4589  *         else:
4590  *             sn = None             # <<<<<<<<<<<<<<
4591  *
4592  *         if target_name and output_target_name != GSS_C_NO_NAME:
4593  */
4594     /*else*/ {
4595       __Pyx_INCREF(Py_None);
4596       __pyx_v_sn = ((struct __pyx_obj_6gssapi_3raw_5names_Name *)Py_None);
4597     }
4598     __pyx_L11:;
4599 
4600     /* "gssapi/raw/sec_contexts.pyx":453
4601  *             sn = None
4602  *
4603  *         if target_name and output_target_name != GSS_C_NO_NAME:             # <<<<<<<<<<<<<<
4604  *             tn = Name()
4605  *             tn.raw_name = output_target_name
4606  */
4607     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_target_name); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 453, __pyx_L1_error)
4608     if (__pyx_t_3) {
4609     } else {
4610       __pyx_t_1 = __pyx_t_3;
4611       goto __pyx_L13_bool_binop_done;
4612     }
4613     __pyx_t_3 = ((__pyx_v_output_target_name != GSS_C_NO_NAME) != 0);
4614     __pyx_t_1 = __pyx_t_3;
4615     __pyx_L13_bool_binop_done:;
4616     if (__pyx_t_1) {
4617 
4618       /* "gssapi/raw/sec_contexts.pyx":454
4619  *
4620  *         if target_name and output_target_name != GSS_C_NO_NAME:
4621  *             tn = Name()             # <<<<<<<<<<<<<<
4622  *             tn.raw_name = output_target_name
4623  *         else:
4624  */
4625       __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gssapi_3raw_5names_Name)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 454, __pyx_L1_error)
4626       __Pyx_GOTREF(__pyx_t_2);
4627       __pyx_v_tn = ((struct __pyx_obj_6gssapi_3raw_5names_Name *)__pyx_t_2);
4628       __pyx_t_2 = 0;
4629 
4630       /* "gssapi/raw/sec_contexts.pyx":455
4631  *         if target_name and output_target_name != GSS_C_NO_NAME:
4632  *             tn = Name()
4633  *             tn.raw_name = output_target_name             # <<<<<<<<<<<<<<
4634  *         else:
4635  *             tn = None
4636  */
4637       __pyx_v_tn->raw_name = __pyx_v_output_target_name;
4638 
4639       /* "gssapi/raw/sec_contexts.pyx":453
4640  *             sn = None
4641  *
4642  *         if target_name and output_target_name != GSS_C_NO_NAME:             # <<<<<<<<<<<<<<
4643  *             tn = Name()
4644  *             tn.raw_name = output_target_name
4645  */
4646       goto __pyx_L12;
4647     }
4648 
4649     /* "gssapi/raw/sec_contexts.pyx":457
4650  *             tn.raw_name = output_target_name
4651  *         else:
4652  *             tn = None             # <<<<<<<<<<<<<<
4653  *
4654  *         if mech:
4655  */
4656     /*else*/ {
4657       __Pyx_INCREF(Py_None);
4658       __pyx_v_tn = ((struct __pyx_obj_6gssapi_3raw_5names_Name *)Py_None);
4659     }
4660     __pyx_L12:;
4661 
4662     /* "gssapi/raw/sec_contexts.pyx":459
4663  *             tn = None
4664  *
4665  *         if mech:             # <<<<<<<<<<<<<<
4666  *             py_mech_type = OID()
4667  *             py_mech_type.raw_oid = output_mech_type[0]
4668  */
4669     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_mech); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 459, __pyx_L1_error)
4670     if (__pyx_t_1) {
4671 
4672       /* "gssapi/raw/sec_contexts.pyx":460
4673  *
4674  *         if mech:
4675  *             py_mech_type = OID()             # <<<<<<<<<<<<<<
4676  *             py_mech_type.raw_oid = output_mech_type[0]
4677  *         else:
4678  */
4679       __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gssapi_3raw_4oids_OID)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 460, __pyx_L1_error)
4680       __Pyx_GOTREF(__pyx_t_2);
4681       __pyx_v_py_mech_type = ((struct __pyx_obj_6gssapi_3raw_4oids_OID *)__pyx_t_2);
4682       __pyx_t_2 = 0;
4683 
4684       /* "gssapi/raw/sec_contexts.pyx":461
4685  *         if mech:
4686  *             py_mech_type = OID()
4687  *             py_mech_type.raw_oid = output_mech_type[0]             # <<<<<<<<<<<<<<
4688  *         else:
4689  *             py_mech_type = None
4690  */
4691       __pyx_v_py_mech_type->raw_oid = (__pyx_v_output_mech_type[0]);
4692 
4693       /* "gssapi/raw/sec_contexts.pyx":459
4694  *             tn = None
4695  *
4696  *         if mech:             # <<<<<<<<<<<<<<
4697  *             py_mech_type = OID()
4698  *             py_mech_type.raw_oid = output_mech_type[0]
4699  */
4700       goto __pyx_L15;
4701     }
4702 
4703     /* "gssapi/raw/sec_contexts.pyx":463
4704  *             py_mech_type.raw_oid = output_mech_type[0]
4705  *         else:
4706  *             py_mech_type = None             # <<<<<<<<<<<<<<
4707  *
4708  *         if lifetime and ttl != GSS_C_INDEFINITE:
4709  */
4710     /*else*/ {
4711       __Pyx_INCREF(Py_None);
4712       __pyx_v_py_mech_type = ((struct __pyx_obj_6gssapi_3raw_4oids_OID *)Py_None);
4713     }
4714     __pyx_L15:;
4715 
4716     /* "gssapi/raw/sec_contexts.pyx":465
4717  *             py_mech_type = None
4718  *
4719  *         if lifetime and ttl != GSS_C_INDEFINITE:             # <<<<<<<<<<<<<<
4720  *             py_ttl = ttl
4721  *         else:
4722  */
4723     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_lifetime); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 465, __pyx_L1_error)
4724     if (__pyx_t_3) {
4725     } else {
4726       __pyx_t_1 = __pyx_t_3;
4727       goto __pyx_L17_bool_binop_done;
4728     }
4729     __pyx_t_3 = ((__pyx_v_ttl != GSS_C_INDEFINITE) != 0);
4730     __pyx_t_1 = __pyx_t_3;
4731     __pyx_L17_bool_binop_done:;
4732     if (__pyx_t_1) {
4733 
4734       /* "gssapi/raw/sec_contexts.pyx":466
4735  *
4736  *         if lifetime and ttl != GSS_C_INDEFINITE:
4737  *             py_ttl = ttl             # <<<<<<<<<<<<<<
4738  *         else:
4739  *             py_ttl = None
4740  */
4741       __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_ttl); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 466, __pyx_L1_error)
4742       __Pyx_GOTREF(__pyx_t_2);
4743       __pyx_v_py_ttl = __pyx_t_2;
4744       __pyx_t_2 = 0;
4745 
4746       /* "gssapi/raw/sec_contexts.pyx":465
4747  *             py_mech_type = None
4748  *
4749  *         if lifetime and ttl != GSS_C_INDEFINITE:             # <<<<<<<<<<<<<<
4750  *             py_ttl = ttl
4751  *         else:
4752  */
4753       goto __pyx_L16;
4754     }
4755 
4756     /* "gssapi/raw/sec_contexts.pyx":468
4757  *             py_ttl = ttl
4758  *         else:
4759  *             py_ttl = None             # <<<<<<<<<<<<<<
4760  *
4761  *         if flags:
4762  */
4763     /*else*/ {
4764       __Pyx_INCREF(Py_None);
4765       __pyx_v_py_ttl = Py_None;
4766     }
4767     __pyx_L16:;
4768 
4769     /* "gssapi/raw/sec_contexts.pyx":470
4770  *             py_ttl = None
4771  *
4772  *         if flags:             # <<<<<<<<<<<<<<
4773  *             py_flags = IntEnumFlagSet(RequirementFlag, output_flags)
4774  *         else:
4775  */
4776     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flags); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 470, __pyx_L1_error)
4777     if (__pyx_t_1) {
4778 
4779       /* "gssapi/raw/sec_contexts.pyx":471
4780  *
4781  *         if flags:
4782  *             py_flags = IntEnumFlagSet(RequirementFlag, output_flags)             # <<<<<<<<<<<<<<
4783  *         else:
4784  *             py_flags = None
4785  */
4786       __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_IntEnumFlagSet); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 471, __pyx_L1_error)
4787       __Pyx_GOTREF(__pyx_t_4);
4788       __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_RequirementFlag); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 471, __pyx_L1_error)
4789       __Pyx_GOTREF(__pyx_t_5);
4790       __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_output_flags); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 471, __pyx_L1_error)
4791       __Pyx_GOTREF(__pyx_t_6);
4792       __pyx_t_7 = NULL;
4793       __pyx_t_8 = 0;
4794       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
4795         __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
4796         if (likely(__pyx_t_7)) {
4797           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4798           __Pyx_INCREF(__pyx_t_7);
4799           __Pyx_INCREF(function);
4800           __Pyx_DECREF_SET(__pyx_t_4, function);
4801           __pyx_t_8 = 1;
4802         }
4803       }
4804       #if CYTHON_FAST_PYCALL
4805       if (PyFunction_Check(__pyx_t_4)) {
4806         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
4807         __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 471, __pyx_L1_error)
4808         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4809         __Pyx_GOTREF(__pyx_t_2);
4810         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4811         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4812       } else
4813       #endif
4814       #if CYTHON_FAST_PYCCALL
4815       if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
4816         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
4817         __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 471, __pyx_L1_error)
4818         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4819         __Pyx_GOTREF(__pyx_t_2);
4820         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4821         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4822       } else
4823       #endif
4824       {
4825         __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 471, __pyx_L1_error)
4826         __Pyx_GOTREF(__pyx_t_9);
4827         if (__pyx_t_7) {
4828           __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
4829         }
4830         __Pyx_GIVEREF(__pyx_t_5);
4831         PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
4832         __Pyx_GIVEREF(__pyx_t_6);
4833         PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
4834         __pyx_t_5 = 0;
4835         __pyx_t_6 = 0;
4836         __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 471, __pyx_L1_error)
4837         __Pyx_GOTREF(__pyx_t_2);
4838         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4839       }
4840       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4841       __pyx_v_py_flags = __pyx_t_2;
4842       __pyx_t_2 = 0;
4843 
4844       /* "gssapi/raw/sec_contexts.pyx":470
4845  *             py_ttl = None
4846  *
4847  *         if flags:             # <<<<<<<<<<<<<<
4848  *             py_flags = IntEnumFlagSet(RequirementFlag, output_flags)
4849  *         else:
4850  */
4851       goto __pyx_L19;
4852     }
4853 
4854     /* "gssapi/raw/sec_contexts.pyx":473
4855  *             py_flags = IntEnumFlagSet(RequirementFlag, output_flags)
4856  *         else:
4857  *             py_flags = None             # <<<<<<<<<<<<<<
4858  *
4859  *         if locally_init:
4860  */
4861     /*else*/ {
4862       __Pyx_INCREF(Py_None);
4863       __pyx_v_py_flags = Py_None;
4864     }
4865     __pyx_L19:;
4866 
4867     /* "gssapi/raw/sec_contexts.pyx":475
4868  *             py_flags = None
4869  *
4870  *         if locally_init:             # <<<<<<<<<<<<<<
4871  *             py_locally_init = <bint>output_locally_init
4872  *         else:
4873  */
4874     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_locally_init); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 475, __pyx_L1_error)
4875     if (__pyx_t_1) {
4876 
4877       /* "gssapi/raw/sec_contexts.pyx":476
4878  *
4879  *         if locally_init:
4880  *             py_locally_init = <bint>output_locally_init             # <<<<<<<<<<<<<<
4881  *         else:
4882  *             py_locally_init = None
4883  */
4884       __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_output_locally_init != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 476, __pyx_L1_error)
4885       __Pyx_GOTREF(__pyx_t_2);
4886       __pyx_v_py_locally_init = __pyx_t_2;
4887       __pyx_t_2 = 0;
4888 
4889       /* "gssapi/raw/sec_contexts.pyx":475
4890  *             py_flags = None
4891  *
4892  *         if locally_init:             # <<<<<<<<<<<<<<
4893  *             py_locally_init = <bint>output_locally_init
4894  *         else:
4895  */
4896       goto __pyx_L20;
4897     }
4898 
4899     /* "gssapi/raw/sec_contexts.pyx":478
4900  *             py_locally_init = <bint>output_locally_init
4901  *         else:
4902  *             py_locally_init = None             # <<<<<<<<<<<<<<
4903  *
4904  *         if complete:
4905  */
4906     /*else*/ {
4907       __Pyx_INCREF(Py_None);
4908       __pyx_v_py_locally_init = Py_None;
4909     }
4910     __pyx_L20:;
4911 
4912     /* "gssapi/raw/sec_contexts.pyx":480
4913  *             py_locally_init = None
4914  *
4915  *         if complete:             # <<<<<<<<<<<<<<
4916  *             py_complete = <bint>is_complete
4917  *         else:
4918  */
4919     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_complete); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 480, __pyx_L1_error)
4920     if (__pyx_t_1) {
4921 
4922       /* "gssapi/raw/sec_contexts.pyx":481
4923  *
4924  *         if complete:
4925  *             py_complete = <bint>is_complete             # <<<<<<<<<<<<<<
4926  *         else:
4927  *             py_complete = None
4928  */
4929       __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_is_complete != 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 481, __pyx_L1_error)
4930       __Pyx_GOTREF(__pyx_t_2);
4931       __pyx_v_py_complete = __pyx_t_2;
4932       __pyx_t_2 = 0;
4933 
4934       /* "gssapi/raw/sec_contexts.pyx":480
4935  *             py_locally_init = None
4936  *
4937  *         if complete:             # <<<<<<<<<<<<<<
4938  *             py_complete = <bint>is_complete
4939  *         else:
4940  */
4941       goto __pyx_L21;
4942     }
4943 
4944     /* "gssapi/raw/sec_contexts.pyx":483
4945  *             py_complete = <bint>is_complete
4946  *         else:
4947  *             py_complete = None             # <<<<<<<<<<<<<<
4948  *
4949  *         return InquireContextResult(sn, tn, py_ttl, py_mech_type, py_flags,
4950  */
4951     /*else*/ {
4952       __Pyx_INCREF(Py_None);
4953       __pyx_v_py_complete = Py_None;
4954     }
4955     __pyx_L21:;
4956 
4957     /* "gssapi/raw/sec_contexts.pyx":485
4958  *             py_complete = None
4959  *
4960  *         return InquireContextResult(sn, tn, py_ttl, py_mech_type, py_flags,             # <<<<<<<<<<<<<<
4961  *                                     py_locally_init, py_complete)
4962  *     else:
4963  */
4964     __Pyx_XDECREF(__pyx_r);
4965     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_InquireContextResult); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 485, __pyx_L1_error)
4966     __Pyx_GOTREF(__pyx_t_4);
4967 
4968     /* "gssapi/raw/sec_contexts.pyx":486
4969  *
4970  *         return InquireContextResult(sn, tn, py_ttl, py_mech_type, py_flags,
4971  *                                     py_locally_init, py_complete)             # <<<<<<<<<<<<<<
4972  *     else:
4973  *         raise GSSError(maj_stat, min_stat)
4974  */
4975     __pyx_t_9 = NULL;
4976     __pyx_t_8 = 0;
4977     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
4978       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
4979       if (likely(__pyx_t_9)) {
4980         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4981         __Pyx_INCREF(__pyx_t_9);
4982         __Pyx_INCREF(function);
4983         __Pyx_DECREF_SET(__pyx_t_4, function);
4984         __pyx_t_8 = 1;
4985       }
4986     }
4987     #if CYTHON_FAST_PYCALL
4988     if (PyFunction_Check(__pyx_t_4)) {
4989       PyObject *__pyx_temp[8] = {__pyx_t_9, ((PyObject *)__pyx_v_sn), ((PyObject *)__pyx_v_tn), __pyx_v_py_ttl, ((PyObject *)__pyx_v_py_mech_type), __pyx_v_py_flags, __pyx_v_py_locally_init, __pyx_v_py_complete};
4990       __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 7+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 485, __pyx_L1_error)
4991       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4992       __Pyx_GOTREF(__pyx_t_2);
4993     } else
4994     #endif
4995     #if CYTHON_FAST_PYCCALL
4996     if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
4997       PyObject *__pyx_temp[8] = {__pyx_t_9, ((PyObject *)__pyx_v_sn), ((PyObject *)__pyx_v_tn), __pyx_v_py_ttl, ((PyObject *)__pyx_v_py_mech_type), __pyx_v_py_flags, __pyx_v_py_locally_init, __pyx_v_py_complete};
4998       __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 7+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 485, __pyx_L1_error)
4999       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5000       __Pyx_GOTREF(__pyx_t_2);
5001     } else
5002     #endif
5003     {
5004       __pyx_t_6 = PyTuple_New(7+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 485, __pyx_L1_error)
5005       __Pyx_GOTREF(__pyx_t_6);
5006       if (__pyx_t_9) {
5007         __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL;
5008       }
5009       __Pyx_INCREF(((PyObject *)__pyx_v_sn));
5010       __Pyx_GIVEREF(((PyObject *)__pyx_v_sn));
5011       PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, ((PyObject *)__pyx_v_sn));
5012       __Pyx_INCREF(((PyObject *)__pyx_v_tn));
5013       __Pyx_GIVEREF(((PyObject *)__pyx_v_tn));
5014       PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, ((PyObject *)__pyx_v_tn));
5015       __Pyx_INCREF(__pyx_v_py_ttl);
5016       __Pyx_GIVEREF(__pyx_v_py_ttl);
5017       PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_py_ttl);
5018       __Pyx_INCREF(((PyObject *)__pyx_v_py_mech_type));
5019       __Pyx_GIVEREF(((PyObject *)__pyx_v_py_mech_type));
5020       PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, ((PyObject *)__pyx_v_py_mech_type));
5021       __Pyx_INCREF(__pyx_v_py_flags);
5022       __Pyx_GIVEREF(__pyx_v_py_flags);
5023       PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_8, __pyx_v_py_flags);
5024       __Pyx_INCREF(__pyx_v_py_locally_init);
5025       __Pyx_GIVEREF(__pyx_v_py_locally_init);
5026       PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_8, __pyx_v_py_locally_init);
5027       __Pyx_INCREF(__pyx_v_py_complete);
5028       __Pyx_GIVEREF(__pyx_v_py_complete);
5029       PyTuple_SET_ITEM(__pyx_t_6, 6+__pyx_t_8, __pyx_v_py_complete);
5030       __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 485, __pyx_L1_error)
5031       __Pyx_GOTREF(__pyx_t_2);
5032       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5033     }
5034     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5035     __pyx_r = __pyx_t_2;
5036     __pyx_t_2 = 0;
5037     goto __pyx_L0;
5038 
5039     /* "gssapi/raw/sec_contexts.pyx":446
5040  *     cdef OID py_mech_type
5041  *     cdef Name tn
5042  *     if maj_stat == GSS_S_COMPLETE:             # <<<<<<<<<<<<<<
5043  *         if initiator_name:
5044  *             sn = Name()
5045  */
5046   }
5047 
5048   /* "gssapi/raw/sec_contexts.pyx":488
5049  *                                     py_locally_init, py_complete)
5050  *     else:
5051  *         raise GSSError(maj_stat, min_stat)             # <<<<<<<<<<<<<<
5052  *
5053  *
5054  */
5055   /*else*/ {
5056     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_GSSError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 488, __pyx_L1_error)
5057     __Pyx_GOTREF(__pyx_t_4);
5058     __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_maj_stat); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 488, __pyx_L1_error)
5059     __Pyx_GOTREF(__pyx_t_6);
5060     __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_min_stat); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 488, __pyx_L1_error)
5061     __Pyx_GOTREF(__pyx_t_9);
5062     __pyx_t_5 = NULL;
5063     __pyx_t_8 = 0;
5064     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5065       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
5066       if (likely(__pyx_t_5)) {
5067         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5068         __Pyx_INCREF(__pyx_t_5);
5069         __Pyx_INCREF(function);
5070         __Pyx_DECREF_SET(__pyx_t_4, function);
5071         __pyx_t_8 = 1;
5072       }
5073     }
5074     #if CYTHON_FAST_PYCALL
5075     if (PyFunction_Check(__pyx_t_4)) {
5076       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_6, __pyx_t_9};
5077       __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 488, __pyx_L1_error)
5078       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5079       __Pyx_GOTREF(__pyx_t_2);
5080       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5081       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5082     } else
5083     #endif
5084     #if CYTHON_FAST_PYCCALL
5085     if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
5086       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_6, __pyx_t_9};
5087       __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 488, __pyx_L1_error)
5088       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5089       __Pyx_GOTREF(__pyx_t_2);
5090       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5091       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5092     } else
5093     #endif
5094     {
5095       __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 488, __pyx_L1_error)
5096       __Pyx_GOTREF(__pyx_t_7);
5097       if (__pyx_t_5) {
5098         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
5099       }
5100       __Pyx_GIVEREF(__pyx_t_6);
5101       PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_6);
5102       __Pyx_GIVEREF(__pyx_t_9);
5103       PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_9);
5104       __pyx_t_6 = 0;
5105       __pyx_t_9 = 0;
5106       __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 488, __pyx_L1_error)
5107       __Pyx_GOTREF(__pyx_t_2);
5108       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5109     }
5110     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5111     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
5112     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5113     __PYX_ERR(1, 488, __pyx_L1_error)
5114   }
5115 
5116   /* "gssapi/raw/sec_contexts.pyx":373
5117  *
5118  *
5119  * def inquire_context(SecurityContext context not None, initiator_name=True,             # <<<<<<<<<<<<<<
5120  *                     target_name=True, lifetime=True, mech=True,
5121  *                     flags=True, locally_init=True, complete=True):
5122  */
5123 
5124   /* function exit code */
5125   __pyx_L1_error:;
5126   __Pyx_XDECREF(__pyx_t_2);
5127   __Pyx_XDECREF(__pyx_t_4);
5128   __Pyx_XDECREF(__pyx_t_5);
5129   __Pyx_XDECREF(__pyx_t_6);
5130   __Pyx_XDECREF(__pyx_t_7);
5131   __Pyx_XDECREF(__pyx_t_9);
5132   __Pyx_AddTraceback("gssapi.raw.sec_contexts.inquire_context", __pyx_clineno, __pyx_lineno, __pyx_filename);
5133   __pyx_r = NULL;
5134   __pyx_L0:;
5135   __Pyx_XDECREF((PyObject *)__pyx_v_sn);
5136   __Pyx_XDECREF((PyObject *)__pyx_v_py_mech_type);
5137   __Pyx_XDECREF((PyObject *)__pyx_v_tn);
5138   __Pyx_XDECREF(__pyx_v_py_ttl);
5139   __Pyx_XDECREF(__pyx_v_py_flags);
5140   __Pyx_XDECREF(__pyx_v_py_locally_init);
5141   __Pyx_XDECREF(__pyx_v_py_complete);
5142   __Pyx_XGIVEREF(__pyx_r);
5143   __Pyx_RefNannyFinishContext();
5144   return __pyx_r;
5145 }
5146 
5147 /* "gssapi/raw/sec_contexts.pyx":491
5148  *
5149  *
5150  * def context_time(SecurityContext context not None):             # <<<<<<<<<<<<<<
5151  *     """
5152  *     context_time(context)
5153  */
5154 
5155 /* Python wrapper */
5156 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_7context_time(PyObject *__pyx_self, PyObject *__pyx_v_context); /*proto*/
5157 static char __pyx_doc_6gssapi_3raw_12sec_contexts_6context_time[] = "\n    context_time(context)\n    Get the amount of time for which the given context will remain valid.\n\n    This method determines the amount of time for which the given\n    security context will remain valid.  An expired context will\n    give a result of 0.\n\n    Args:\n        context (SecurityContext): the security context in question\n\n    Returns:\n        int: the number of seconds for which the context will be valid\n\n    Raises:\n        ExpiredContextError\n        MissingContextError\n    ";
5158 static PyMethodDef __pyx_mdef_6gssapi_3raw_12sec_contexts_7context_time = {"context_time", (PyCFunction)__pyx_pw_6gssapi_3raw_12sec_contexts_7context_time, METH_O, __pyx_doc_6gssapi_3raw_12sec_contexts_6context_time};
__pyx_pw_6gssapi_3raw_12sec_contexts_7context_time(PyObject * __pyx_self,PyObject * __pyx_v_context)5159 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_7context_time(PyObject *__pyx_self, PyObject *__pyx_v_context) {
5160   int __pyx_lineno = 0;
5161   const char *__pyx_filename = NULL;
5162   int __pyx_clineno = 0;
5163   PyObject *__pyx_r = 0;
5164   __Pyx_RefNannyDeclarations
5165   __Pyx_RefNannySetupContext("context_time (wrapper)", 0);
5166   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext, 0, "context", 0))) __PYX_ERR(1, 491, __pyx_L1_error)
5167   __pyx_r = __pyx_pf_6gssapi_3raw_12sec_contexts_6context_time(__pyx_self, ((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)__pyx_v_context));
5168 
5169   /* function exit code */
5170   goto __pyx_L0;
5171   __pyx_L1_error:;
5172   __pyx_r = NULL;
5173   __pyx_L0:;
5174   __Pyx_RefNannyFinishContext();
5175   return __pyx_r;
5176 }
5177 
__pyx_pf_6gssapi_3raw_12sec_contexts_6context_time(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_context)5178 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_6context_time(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context) {
5179   OM_uint32 __pyx_v_ttl;
5180   OM_uint32 __pyx_v_maj_stat;
5181   OM_uint32 __pyx_v_min_stat;
5182   PyObject *__pyx_r = NULL;
5183   __Pyx_RefNannyDeclarations
5184   int __pyx_t_1;
5185   PyObject *__pyx_t_2 = NULL;
5186   PyObject *__pyx_t_3 = NULL;
5187   PyObject *__pyx_t_4 = NULL;
5188   PyObject *__pyx_t_5 = NULL;
5189   PyObject *__pyx_t_6 = NULL;
5190   int __pyx_t_7;
5191   PyObject *__pyx_t_8 = NULL;
5192   int __pyx_lineno = 0;
5193   const char *__pyx_filename = NULL;
5194   int __pyx_clineno = 0;
5195   __Pyx_RefNannySetupContext("context_time", 0);
5196 
5197   /* "gssapi/raw/sec_contexts.pyx":515
5198  *     cdef OM_uint32 maj_stat, min_stat
5199  *
5200  *     maj_stat = gss_context_time(&min_stat, context.raw_ctx, &ttl)             # <<<<<<<<<<<<<<
5201  *
5202  *     if maj_stat == GSS_S_COMPLETE:
5203  */
5204   __pyx_v_maj_stat = gss_context_time((&__pyx_v_min_stat), __pyx_v_context->raw_ctx, (&__pyx_v_ttl));
5205 
5206   /* "gssapi/raw/sec_contexts.pyx":517
5207  *     maj_stat = gss_context_time(&min_stat, context.raw_ctx, &ttl)
5208  *
5209  *     if maj_stat == GSS_S_COMPLETE:             # <<<<<<<<<<<<<<
5210  *         return ttl
5211  *     else:
5212  */
5213   __pyx_t_1 = ((__pyx_v_maj_stat == GSS_S_COMPLETE) != 0);
5214   if (likely(__pyx_t_1)) {
5215 
5216     /* "gssapi/raw/sec_contexts.pyx":518
5217  *
5218  *     if maj_stat == GSS_S_COMPLETE:
5219  *         return ttl             # <<<<<<<<<<<<<<
5220  *     else:
5221  *         raise GSSError(maj_stat, min_stat)
5222  */
5223     __Pyx_XDECREF(__pyx_r);
5224     __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_ttl); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 518, __pyx_L1_error)
5225     __Pyx_GOTREF(__pyx_t_2);
5226     __pyx_r = __pyx_t_2;
5227     __pyx_t_2 = 0;
5228     goto __pyx_L0;
5229 
5230     /* "gssapi/raw/sec_contexts.pyx":517
5231  *     maj_stat = gss_context_time(&min_stat, context.raw_ctx, &ttl)
5232  *
5233  *     if maj_stat == GSS_S_COMPLETE:             # <<<<<<<<<<<<<<
5234  *         return ttl
5235  *     else:
5236  */
5237   }
5238 
5239   /* "gssapi/raw/sec_contexts.pyx":520
5240  *         return ttl
5241  *     else:
5242  *         raise GSSError(maj_stat, min_stat)             # <<<<<<<<<<<<<<
5243  *
5244  *
5245  */
5246   /*else*/ {
5247     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_GSSError); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
5248     __Pyx_GOTREF(__pyx_t_3);
5249     __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_maj_stat); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 520, __pyx_L1_error)
5250     __Pyx_GOTREF(__pyx_t_4);
5251     __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_min_stat); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 520, __pyx_L1_error)
5252     __Pyx_GOTREF(__pyx_t_5);
5253     __pyx_t_6 = NULL;
5254     __pyx_t_7 = 0;
5255     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5256       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
5257       if (likely(__pyx_t_6)) {
5258         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5259         __Pyx_INCREF(__pyx_t_6);
5260         __Pyx_INCREF(function);
5261         __Pyx_DECREF_SET(__pyx_t_3, function);
5262         __pyx_t_7 = 1;
5263       }
5264     }
5265     #if CYTHON_FAST_PYCALL
5266     if (PyFunction_Check(__pyx_t_3)) {
5267       PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
5268       __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 520, __pyx_L1_error)
5269       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5270       __Pyx_GOTREF(__pyx_t_2);
5271       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5272       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5273     } else
5274     #endif
5275     #if CYTHON_FAST_PYCCALL
5276     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
5277       PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
5278       __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 520, __pyx_L1_error)
5279       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5280       __Pyx_GOTREF(__pyx_t_2);
5281       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5282       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5283     } else
5284     #endif
5285     {
5286       __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 520, __pyx_L1_error)
5287       __Pyx_GOTREF(__pyx_t_8);
5288       if (__pyx_t_6) {
5289         __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
5290       }
5291       __Pyx_GIVEREF(__pyx_t_4);
5292       PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
5293       __Pyx_GIVEREF(__pyx_t_5);
5294       PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
5295       __pyx_t_4 = 0;
5296       __pyx_t_5 = 0;
5297       __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 520, __pyx_L1_error)
5298       __Pyx_GOTREF(__pyx_t_2);
5299       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5300     }
5301     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5302     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
5303     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5304     __PYX_ERR(1, 520, __pyx_L1_error)
5305   }
5306 
5307   /* "gssapi/raw/sec_contexts.pyx":491
5308  *
5309  *
5310  * def context_time(SecurityContext context not None):             # <<<<<<<<<<<<<<
5311  *     """
5312  *     context_time(context)
5313  */
5314 
5315   /* function exit code */
5316   __pyx_L1_error:;
5317   __Pyx_XDECREF(__pyx_t_2);
5318   __Pyx_XDECREF(__pyx_t_3);
5319   __Pyx_XDECREF(__pyx_t_4);
5320   __Pyx_XDECREF(__pyx_t_5);
5321   __Pyx_XDECREF(__pyx_t_6);
5322   __Pyx_XDECREF(__pyx_t_8);
5323   __Pyx_AddTraceback("gssapi.raw.sec_contexts.context_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
5324   __pyx_r = NULL;
5325   __pyx_L0:;
5326   __Pyx_XGIVEREF(__pyx_r);
5327   __Pyx_RefNannyFinishContext();
5328   return __pyx_r;
5329 }
5330 
5331 /* "gssapi/raw/sec_contexts.pyx":523
5332  *
5333  *
5334  * def process_context_token(SecurityContext context not None, token):             # <<<<<<<<<<<<<<
5335  *     """
5336  *     process_context_token(context, token)
5337  */
5338 
5339 /* Python wrapper */
5340 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_9process_context_token(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5341 static char __pyx_doc_6gssapi_3raw_12sec_contexts_8process_context_token[] = "\n    process_context_token(context, token)\n    Process a token asynchronously.\n\n    This method provides a way to process a token, even if the\n    given security context is not expecting one.  For example,\n    if the initiator has the initSecContext return that the context\n    is complete, but the acceptor is unable to accept the context,\n    and wishes to send a token to the initiator, letting the\n    initiator know of the error.\n\n    Warning:\n        This method has been essentially deprecated by :rfc:`2744`.\n\n    Args:\n        context (SecurityContext): the security context against which\n            to process the token\n        token (bytes): the token to process\n\n    Raises:\n        InvalidTokenError\n        MissingContextError\n    ";
5342 static PyMethodDef __pyx_mdef_6gssapi_3raw_12sec_contexts_9process_context_token = {"process_context_token", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gssapi_3raw_12sec_contexts_9process_context_token, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gssapi_3raw_12sec_contexts_8process_context_token};
__pyx_pw_6gssapi_3raw_12sec_contexts_9process_context_token(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5343 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_9process_context_token(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5344   struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context = 0;
5345   PyObject *__pyx_v_token = 0;
5346   int __pyx_lineno = 0;
5347   const char *__pyx_filename = NULL;
5348   int __pyx_clineno = 0;
5349   PyObject *__pyx_r = 0;
5350   __Pyx_RefNannyDeclarations
5351   __Pyx_RefNannySetupContext("process_context_token (wrapper)", 0);
5352   {
5353     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_token,0};
5354     PyObject* values[2] = {0,0};
5355     if (unlikely(__pyx_kwds)) {
5356       Py_ssize_t kw_args;
5357       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5358       switch (pos_args) {
5359         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5360         CYTHON_FALLTHROUGH;
5361         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5362         CYTHON_FALLTHROUGH;
5363         case  0: break;
5364         default: goto __pyx_L5_argtuple_error;
5365       }
5366       kw_args = PyDict_Size(__pyx_kwds);
5367       switch (pos_args) {
5368         case  0:
5369         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
5370         else goto __pyx_L5_argtuple_error;
5371         CYTHON_FALLTHROUGH;
5372         case  1:
5373         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_token)) != 0)) kw_args--;
5374         else {
5375           __Pyx_RaiseArgtupleInvalid("process_context_token", 1, 2, 2, 1); __PYX_ERR(1, 523, __pyx_L3_error)
5376         }
5377       }
5378       if (unlikely(kw_args > 0)) {
5379         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_context_token") < 0)) __PYX_ERR(1, 523, __pyx_L3_error)
5380       }
5381     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5382       goto __pyx_L5_argtuple_error;
5383     } else {
5384       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5385       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5386     }
5387     __pyx_v_context = ((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)values[0]);
5388     __pyx_v_token = values[1];
5389   }
5390   goto __pyx_L4_argument_unpacking_done;
5391   __pyx_L5_argtuple_error:;
5392   __Pyx_RaiseArgtupleInvalid("process_context_token", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 523, __pyx_L3_error)
5393   __pyx_L3_error:;
5394   __Pyx_AddTraceback("gssapi.raw.sec_contexts.process_context_token", __pyx_clineno, __pyx_lineno, __pyx_filename);
5395   __Pyx_RefNannyFinishContext();
5396   return NULL;
5397   __pyx_L4_argument_unpacking_done:;
5398   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext, 0, "context", 0))) __PYX_ERR(1, 523, __pyx_L1_error)
5399   __pyx_r = __pyx_pf_6gssapi_3raw_12sec_contexts_8process_context_token(__pyx_self, __pyx_v_context, __pyx_v_token);
5400 
5401   /* function exit code */
5402   goto __pyx_L0;
5403   __pyx_L1_error:;
5404   __pyx_r = NULL;
5405   __pyx_L0:;
5406   __Pyx_RefNannyFinishContext();
5407   return __pyx_r;
5408 }
5409 
__pyx_pf_6gssapi_3raw_12sec_contexts_8process_context_token(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_context,PyObject * __pyx_v_token)5410 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_8process_context_token(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, PyObject *__pyx_v_token) {
5411   gss_buffer_desc __pyx_v_token_buffer;
5412   OM_uint32 __pyx_v_maj_stat;
5413   OM_uint32 __pyx_v_min_stat;
5414   PyObject *__pyx_r = NULL;
5415   __Pyx_RefNannyDeclarations
5416   gss_buffer_desc __pyx_t_1;
5417   Py_ssize_t __pyx_t_2;
5418   char *__pyx_t_3;
5419   int __pyx_t_4;
5420   PyObject *__pyx_t_5 = NULL;
5421   PyObject *__pyx_t_6 = NULL;
5422   PyObject *__pyx_t_7 = NULL;
5423   PyObject *__pyx_t_8 = NULL;
5424   PyObject *__pyx_t_9 = NULL;
5425   int __pyx_t_10;
5426   PyObject *__pyx_t_11 = NULL;
5427   int __pyx_lineno = 0;
5428   const char *__pyx_filename = NULL;
5429   int __pyx_clineno = 0;
5430   __Pyx_RefNannySetupContext("process_context_token", 0);
5431 
5432   /* "gssapi/raw/sec_contexts.pyx":548
5433  *     """
5434  *
5435  *     cdef gss_buffer_desc token_buffer = gss_buffer_desc(len(token), token)             # <<<<<<<<<<<<<<
5436  *
5437  *     cdef OM_uint32 maj_stat, min_stat
5438  */
5439   __pyx_t_2 = PyObject_Length(__pyx_v_token); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 548, __pyx_L1_error)
5440   __pyx_t_1.length = __pyx_t_2;
5441   __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v_token); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(1, 548, __pyx_L1_error)
5442   __pyx_t_1.value = __pyx_t_3;
5443   __pyx_v_token_buffer = __pyx_t_1;
5444 
5445   /* "gssapi/raw/sec_contexts.pyx":552
5446  *     cdef OM_uint32 maj_stat, min_stat
5447  *
5448  *     with nogil:             # <<<<<<<<<<<<<<
5449  *         maj_stat = gss_process_context_token(&min_stat, context.raw_ctx,
5450  *                                              &token_buffer)
5451  */
5452   {
5453       #ifdef WITH_THREAD
5454       PyThreadState *_save;
5455       Py_UNBLOCK_THREADS
5456       __Pyx_FastGIL_Remember();
5457       #endif
5458       /*try:*/ {
5459 
5460         /* "gssapi/raw/sec_contexts.pyx":553
5461  *
5462  *     with nogil:
5463  *         maj_stat = gss_process_context_token(&min_stat, context.raw_ctx,             # <<<<<<<<<<<<<<
5464  *                                              &token_buffer)
5465  *
5466  */
5467         __pyx_v_maj_stat = gss_process_context_token((&__pyx_v_min_stat), __pyx_v_context->raw_ctx, (&__pyx_v_token_buffer));
5468       }
5469 
5470       /* "gssapi/raw/sec_contexts.pyx":552
5471  *     cdef OM_uint32 maj_stat, min_stat
5472  *
5473  *     with nogil:             # <<<<<<<<<<<<<<
5474  *         maj_stat = gss_process_context_token(&min_stat, context.raw_ctx,
5475  *                                              &token_buffer)
5476  */
5477       /*finally:*/ {
5478         /*normal exit:*/{
5479           #ifdef WITH_THREAD
5480           __Pyx_FastGIL_Forget();
5481           Py_BLOCK_THREADS
5482           #endif
5483           goto __pyx_L5;
5484         }
5485         __pyx_L5:;
5486       }
5487   }
5488 
5489   /* "gssapi/raw/sec_contexts.pyx":556
5490  *                                              &token_buffer)
5491  *
5492  *     if maj_stat != GSS_S_COMPLETE:             # <<<<<<<<<<<<<<
5493  *         raise GSSError(maj_stat, min_stat)
5494  *
5495  */
5496   __pyx_t_4 = ((__pyx_v_maj_stat != GSS_S_COMPLETE) != 0);
5497   if (unlikely(__pyx_t_4)) {
5498 
5499     /* "gssapi/raw/sec_contexts.pyx":557
5500  *
5501  *     if maj_stat != GSS_S_COMPLETE:
5502  *         raise GSSError(maj_stat, min_stat)             # <<<<<<<<<<<<<<
5503  *
5504  *
5505  */
5506     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_GSSError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 557, __pyx_L1_error)
5507     __Pyx_GOTREF(__pyx_t_6);
5508     __pyx_t_7 = __Pyx_PyInt_From_uint32_t(__pyx_v_maj_stat); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 557, __pyx_L1_error)
5509     __Pyx_GOTREF(__pyx_t_7);
5510     __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_min_stat); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 557, __pyx_L1_error)
5511     __Pyx_GOTREF(__pyx_t_8);
5512     __pyx_t_9 = NULL;
5513     __pyx_t_10 = 0;
5514     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
5515       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
5516       if (likely(__pyx_t_9)) {
5517         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
5518         __Pyx_INCREF(__pyx_t_9);
5519         __Pyx_INCREF(function);
5520         __Pyx_DECREF_SET(__pyx_t_6, function);
5521         __pyx_t_10 = 1;
5522       }
5523     }
5524     #if CYTHON_FAST_PYCALL
5525     if (PyFunction_Check(__pyx_t_6)) {
5526       PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
5527       __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 557, __pyx_L1_error)
5528       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5529       __Pyx_GOTREF(__pyx_t_5);
5530       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5531       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5532     } else
5533     #endif
5534     #if CYTHON_FAST_PYCCALL
5535     if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
5536       PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
5537       __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 557, __pyx_L1_error)
5538       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5539       __Pyx_GOTREF(__pyx_t_5);
5540       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5541       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5542     } else
5543     #endif
5544     {
5545       __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 557, __pyx_L1_error)
5546       __Pyx_GOTREF(__pyx_t_11);
5547       if (__pyx_t_9) {
5548         __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
5549       }
5550       __Pyx_GIVEREF(__pyx_t_7);
5551       PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_7);
5552       __Pyx_GIVEREF(__pyx_t_8);
5553       PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_8);
5554       __pyx_t_7 = 0;
5555       __pyx_t_8 = 0;
5556       __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 557, __pyx_L1_error)
5557       __Pyx_GOTREF(__pyx_t_5);
5558       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5559     }
5560     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5561     __Pyx_Raise(__pyx_t_5, 0, 0, 0);
5562     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5563     __PYX_ERR(1, 557, __pyx_L1_error)
5564 
5565     /* "gssapi/raw/sec_contexts.pyx":556
5566  *                                              &token_buffer)
5567  *
5568  *     if maj_stat != GSS_S_COMPLETE:             # <<<<<<<<<<<<<<
5569  *         raise GSSError(maj_stat, min_stat)
5570  *
5571  */
5572   }
5573 
5574   /* "gssapi/raw/sec_contexts.pyx":523
5575  *
5576  *
5577  * def process_context_token(SecurityContext context not None, token):             # <<<<<<<<<<<<<<
5578  *     """
5579  *     process_context_token(context, token)
5580  */
5581 
5582   /* function exit code */
5583   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5584   goto __pyx_L0;
5585   __pyx_L1_error:;
5586   __Pyx_XDECREF(__pyx_t_5);
5587   __Pyx_XDECREF(__pyx_t_6);
5588   __Pyx_XDECREF(__pyx_t_7);
5589   __Pyx_XDECREF(__pyx_t_8);
5590   __Pyx_XDECREF(__pyx_t_9);
5591   __Pyx_XDECREF(__pyx_t_11);
5592   __Pyx_AddTraceback("gssapi.raw.sec_contexts.process_context_token", __pyx_clineno, __pyx_lineno, __pyx_filename);
5593   __pyx_r = NULL;
5594   __pyx_L0:;
5595   __Pyx_XGIVEREF(__pyx_r);
5596   __Pyx_RefNannyFinishContext();
5597   return __pyx_r;
5598 }
5599 
5600 /* "gssapi/raw/sec_contexts.pyx":560
5601  *
5602  *
5603  * def import_sec_context(token not None):             # <<<<<<<<<<<<<<
5604  *     """
5605  *     import_sec_context(token)
5606  */
5607 
5608 /* Python wrapper */
5609 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_11import_sec_context(PyObject *__pyx_self, PyObject *__pyx_v_token); /*proto*/
5610 static char __pyx_doc_6gssapi_3raw_12sec_contexts_10import_sec_context[] = "\n    import_sec_context(token)\n    Import a context from another process.\n\n    This method imports a security context established in another process\n    by reading the specified token which was output by\n    :func:`export_sec_context`.\n\n    Raises:\n        MissingContextError\n        InvalidTokenError\n        OperationUnavailableError\n        UnauthorizedError\n    ";
5611 static PyMethodDef __pyx_mdef_6gssapi_3raw_12sec_contexts_11import_sec_context = {"import_sec_context", (PyCFunction)__pyx_pw_6gssapi_3raw_12sec_contexts_11import_sec_context, METH_O, __pyx_doc_6gssapi_3raw_12sec_contexts_10import_sec_context};
__pyx_pw_6gssapi_3raw_12sec_contexts_11import_sec_context(PyObject * __pyx_self,PyObject * __pyx_v_token)5612 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_11import_sec_context(PyObject *__pyx_self, PyObject *__pyx_v_token) {
5613   int __pyx_lineno = 0;
5614   const char *__pyx_filename = NULL;
5615   int __pyx_clineno = 0;
5616   PyObject *__pyx_r = 0;
5617   __Pyx_RefNannyDeclarations
5618   __Pyx_RefNannySetupContext("import_sec_context (wrapper)", 0);
5619   if (unlikely(((PyObject *)__pyx_v_token) == Py_None)) {
5620     PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "token"); __PYX_ERR(1, 560, __pyx_L1_error)
5621   }
5622   __pyx_r = __pyx_pf_6gssapi_3raw_12sec_contexts_10import_sec_context(__pyx_self, ((PyObject *)__pyx_v_token));
5623 
5624   /* function exit code */
5625   goto __pyx_L0;
5626   __pyx_L1_error:;
5627   __pyx_r = NULL;
5628   __pyx_L0:;
5629   __Pyx_RefNannyFinishContext();
5630   return __pyx_r;
5631 }
5632 
__pyx_pf_6gssapi_3raw_12sec_contexts_10import_sec_context(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_token)5633 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_10import_sec_context(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_token) {
5634   gss_buffer_desc __pyx_v_token_buffer;
5635   gss_ctx_id_t __pyx_v_ctx;
5636   OM_uint32 __pyx_v_maj_stat;
5637   OM_uint32 __pyx_v_min_stat;
5638   struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_res = NULL;
5639   PyObject *__pyx_r = NULL;
5640   __Pyx_RefNannyDeclarations
5641   gss_buffer_desc __pyx_t_1;
5642   Py_ssize_t __pyx_t_2;
5643   char *__pyx_t_3;
5644   int __pyx_t_4;
5645   PyObject *__pyx_t_5 = NULL;
5646   PyObject *__pyx_t_6 = NULL;
5647   PyObject *__pyx_t_7 = NULL;
5648   PyObject *__pyx_t_8 = NULL;
5649   PyObject *__pyx_t_9 = NULL;
5650   int __pyx_t_10;
5651   PyObject *__pyx_t_11 = NULL;
5652   int __pyx_lineno = 0;
5653   const char *__pyx_filename = NULL;
5654   int __pyx_clineno = 0;
5655   __Pyx_RefNannySetupContext("import_sec_context", 0);
5656 
5657   /* "gssapi/raw/sec_contexts.pyx":576
5658  *     """
5659  *
5660  *     cdef gss_buffer_desc token_buffer = gss_buffer_desc(len(token), token)             # <<<<<<<<<<<<<<
5661  *
5662  *     cdef gss_ctx_id_t ctx
5663  */
5664   __pyx_t_2 = PyObject_Length(__pyx_v_token); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 576, __pyx_L1_error)
5665   __pyx_t_1.length = __pyx_t_2;
5666   __pyx_t_3 = __Pyx_PyObject_AsWritableString(__pyx_v_token); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(1, 576, __pyx_L1_error)
5667   __pyx_t_1.value = __pyx_t_3;
5668   __pyx_v_token_buffer = __pyx_t_1;
5669 
5670   /* "gssapi/raw/sec_contexts.pyx":582
5671  *     cdef OM_uint32 maj_stat, min_stat
5672  *
5673  *     with nogil:             # <<<<<<<<<<<<<<
5674  *         maj_stat = gss_import_sec_context(&min_stat, &token_buffer, &ctx)
5675  *
5676  */
5677   {
5678       #ifdef WITH_THREAD
5679       PyThreadState *_save;
5680       Py_UNBLOCK_THREADS
5681       __Pyx_FastGIL_Remember();
5682       #endif
5683       /*try:*/ {
5684 
5685         /* "gssapi/raw/sec_contexts.pyx":583
5686  *
5687  *     with nogil:
5688  *         maj_stat = gss_import_sec_context(&min_stat, &token_buffer, &ctx)             # <<<<<<<<<<<<<<
5689  *
5690  *     if maj_stat == GSS_S_COMPLETE:
5691  */
5692         __pyx_v_maj_stat = gss_import_sec_context((&__pyx_v_min_stat), (&__pyx_v_token_buffer), (&__pyx_v_ctx));
5693       }
5694 
5695       /* "gssapi/raw/sec_contexts.pyx":582
5696  *     cdef OM_uint32 maj_stat, min_stat
5697  *
5698  *     with nogil:             # <<<<<<<<<<<<<<
5699  *         maj_stat = gss_import_sec_context(&min_stat, &token_buffer, &ctx)
5700  *
5701  */
5702       /*finally:*/ {
5703         /*normal exit:*/{
5704           #ifdef WITH_THREAD
5705           __Pyx_FastGIL_Forget();
5706           Py_BLOCK_THREADS
5707           #endif
5708           goto __pyx_L5;
5709         }
5710         __pyx_L5:;
5711       }
5712   }
5713 
5714   /* "gssapi/raw/sec_contexts.pyx":585
5715  *         maj_stat = gss_import_sec_context(&min_stat, &token_buffer, &ctx)
5716  *
5717  *     if maj_stat == GSS_S_COMPLETE:             # <<<<<<<<<<<<<<
5718  *         res = SecurityContext()
5719  *         res.raw_ctx = ctx
5720  */
5721   __pyx_t_4 = ((__pyx_v_maj_stat == GSS_S_COMPLETE) != 0);
5722   if (likely(__pyx_t_4)) {
5723 
5724     /* "gssapi/raw/sec_contexts.pyx":586
5725  *
5726  *     if maj_stat == GSS_S_COMPLETE:
5727  *         res = SecurityContext()             # <<<<<<<<<<<<<<
5728  *         res.raw_ctx = ctx
5729  *         return res
5730  */
5731     __pyx_t_5 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 586, __pyx_L1_error)
5732     __Pyx_GOTREF(__pyx_t_5);
5733     __pyx_v_res = ((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)__pyx_t_5);
5734     __pyx_t_5 = 0;
5735 
5736     /* "gssapi/raw/sec_contexts.pyx":587
5737  *     if maj_stat == GSS_S_COMPLETE:
5738  *         res = SecurityContext()
5739  *         res.raw_ctx = ctx             # <<<<<<<<<<<<<<
5740  *         return res
5741  *     else:
5742  */
5743     __pyx_v_res->raw_ctx = __pyx_v_ctx;
5744 
5745     /* "gssapi/raw/sec_contexts.pyx":588
5746  *         res = SecurityContext()
5747  *         res.raw_ctx = ctx
5748  *         return res             # <<<<<<<<<<<<<<
5749  *     else:
5750  *         raise GSSError(maj_stat, min_stat)
5751  */
5752     __Pyx_XDECREF(__pyx_r);
5753     __Pyx_INCREF(((PyObject *)__pyx_v_res));
5754     __pyx_r = ((PyObject *)__pyx_v_res);
5755     goto __pyx_L0;
5756 
5757     /* "gssapi/raw/sec_contexts.pyx":585
5758  *         maj_stat = gss_import_sec_context(&min_stat, &token_buffer, &ctx)
5759  *
5760  *     if maj_stat == GSS_S_COMPLETE:             # <<<<<<<<<<<<<<
5761  *         res = SecurityContext()
5762  *         res.raw_ctx = ctx
5763  */
5764   }
5765 
5766   /* "gssapi/raw/sec_contexts.pyx":590
5767  *         return res
5768  *     else:
5769  *         raise GSSError(maj_stat, min_stat)             # <<<<<<<<<<<<<<
5770  *
5771  *
5772  */
5773   /*else*/ {
5774     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_GSSError); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 590, __pyx_L1_error)
5775     __Pyx_GOTREF(__pyx_t_6);
5776     __pyx_t_7 = __Pyx_PyInt_From_uint32_t(__pyx_v_maj_stat); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 590, __pyx_L1_error)
5777     __Pyx_GOTREF(__pyx_t_7);
5778     __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_min_stat); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 590, __pyx_L1_error)
5779     __Pyx_GOTREF(__pyx_t_8);
5780     __pyx_t_9 = NULL;
5781     __pyx_t_10 = 0;
5782     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
5783       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
5784       if (likely(__pyx_t_9)) {
5785         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
5786         __Pyx_INCREF(__pyx_t_9);
5787         __Pyx_INCREF(function);
5788         __Pyx_DECREF_SET(__pyx_t_6, function);
5789         __pyx_t_10 = 1;
5790       }
5791     }
5792     #if CYTHON_FAST_PYCALL
5793     if (PyFunction_Check(__pyx_t_6)) {
5794       PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
5795       __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 590, __pyx_L1_error)
5796       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5797       __Pyx_GOTREF(__pyx_t_5);
5798       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5799       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5800     } else
5801     #endif
5802     #if CYTHON_FAST_PYCCALL
5803     if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
5804       PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_7, __pyx_t_8};
5805       __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 590, __pyx_L1_error)
5806       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5807       __Pyx_GOTREF(__pyx_t_5);
5808       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5809       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5810     } else
5811     #endif
5812     {
5813       __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 590, __pyx_L1_error)
5814       __Pyx_GOTREF(__pyx_t_11);
5815       if (__pyx_t_9) {
5816         __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
5817       }
5818       __Pyx_GIVEREF(__pyx_t_7);
5819       PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_7);
5820       __Pyx_GIVEREF(__pyx_t_8);
5821       PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_8);
5822       __pyx_t_7 = 0;
5823       __pyx_t_8 = 0;
5824       __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 590, __pyx_L1_error)
5825       __Pyx_GOTREF(__pyx_t_5);
5826       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5827     }
5828     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5829     __Pyx_Raise(__pyx_t_5, 0, 0, 0);
5830     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5831     __PYX_ERR(1, 590, __pyx_L1_error)
5832   }
5833 
5834   /* "gssapi/raw/sec_contexts.pyx":560
5835  *
5836  *
5837  * def import_sec_context(token not None):             # <<<<<<<<<<<<<<
5838  *     """
5839  *     import_sec_context(token)
5840  */
5841 
5842   /* function exit code */
5843   __pyx_L1_error:;
5844   __Pyx_XDECREF(__pyx_t_5);
5845   __Pyx_XDECREF(__pyx_t_6);
5846   __Pyx_XDECREF(__pyx_t_7);
5847   __Pyx_XDECREF(__pyx_t_8);
5848   __Pyx_XDECREF(__pyx_t_9);
5849   __Pyx_XDECREF(__pyx_t_11);
5850   __Pyx_AddTraceback("gssapi.raw.sec_contexts.import_sec_context", __pyx_clineno, __pyx_lineno, __pyx_filename);
5851   __pyx_r = NULL;
5852   __pyx_L0:;
5853   __Pyx_XDECREF((PyObject *)__pyx_v_res);
5854   __Pyx_XGIVEREF(__pyx_r);
5855   __Pyx_RefNannyFinishContext();
5856   return __pyx_r;
5857 }
5858 
5859 /* "gssapi/raw/sec_contexts.pyx":593
5860  *
5861  *
5862  * def export_sec_context(SecurityContext context not None):             # <<<<<<<<<<<<<<
5863  *     """
5864  *     export_sec_context(context)
5865  */
5866 
5867 /* Python wrapper */
5868 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_13export_sec_context(PyObject *__pyx_self, PyObject *__pyx_v_context); /*proto*/
5869 static char __pyx_doc_6gssapi_3raw_12sec_contexts_12export_sec_context[] = "\n    export_sec_context(context)\n    Export a context for use in another process.\n\n    This method exports a security context, deactivating in the current process\n    and creating a token which can then be imported into another process\n    with :func:`import_sec_context`.\n\n    Warning: this modifies the input context\n\n    Args:\n        context (SecurityContext): the context to send to another process\n\n    Returns:\n        bytes: the output token to be imported\n\n    Raises:\n        ExpiredContextError\n        MissingContextError\n        OperationUnavailableError\n    ";
5870 static PyMethodDef __pyx_mdef_6gssapi_3raw_12sec_contexts_13export_sec_context = {"export_sec_context", (PyCFunction)__pyx_pw_6gssapi_3raw_12sec_contexts_13export_sec_context, METH_O, __pyx_doc_6gssapi_3raw_12sec_contexts_12export_sec_context};
__pyx_pw_6gssapi_3raw_12sec_contexts_13export_sec_context(PyObject * __pyx_self,PyObject * __pyx_v_context)5871 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_13export_sec_context(PyObject *__pyx_self, PyObject *__pyx_v_context) {
5872   int __pyx_lineno = 0;
5873   const char *__pyx_filename = NULL;
5874   int __pyx_clineno = 0;
5875   PyObject *__pyx_r = 0;
5876   __Pyx_RefNannyDeclarations
5877   __Pyx_RefNannySetupContext("export_sec_context (wrapper)", 0);
5878   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext, 0, "context", 0))) __PYX_ERR(1, 593, __pyx_L1_error)
5879   __pyx_r = __pyx_pf_6gssapi_3raw_12sec_contexts_12export_sec_context(__pyx_self, ((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)__pyx_v_context));
5880 
5881   /* function exit code */
5882   goto __pyx_L0;
5883   __pyx_L1_error:;
5884   __pyx_r = NULL;
5885   __pyx_L0:;
5886   __Pyx_RefNannyFinishContext();
5887   return __pyx_r;
5888 }
5889 
__pyx_pf_6gssapi_3raw_12sec_contexts_12export_sec_context(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_context)5890 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_12export_sec_context(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context) {
5891   gss_buffer_desc __pyx_v_output_token;
5892   OM_uint32 __pyx_v_maj_stat;
5893   OM_uint32 __pyx_v_min_stat;
5894   PyObject *__pyx_v_res_token = NULL;
5895   PyObject *__pyx_r = NULL;
5896   __Pyx_RefNannyDeclarations
5897   gss_buffer_desc __pyx_t_1;
5898   int __pyx_t_2;
5899   PyObject *__pyx_t_3 = NULL;
5900   PyObject *__pyx_t_4 = NULL;
5901   PyObject *__pyx_t_5 = NULL;
5902   PyObject *__pyx_t_6 = NULL;
5903   PyObject *__pyx_t_7 = NULL;
5904   int __pyx_t_8;
5905   PyObject *__pyx_t_9 = NULL;
5906   int __pyx_lineno = 0;
5907   const char *__pyx_filename = NULL;
5908   int __pyx_clineno = 0;
5909   __Pyx_RefNannySetupContext("export_sec_context", 0);
5910 
5911   /* "gssapi/raw/sec_contexts.pyx":616
5912  *     """
5913  *
5914  *     cdef gss_buffer_desc output_token = gss_buffer_desc(0, NULL)             # <<<<<<<<<<<<<<
5915  *
5916  *     cdef OM_uint32 maj_stat, min_stat
5917  */
5918   __pyx_t_1.length = 0;
5919   __pyx_t_1.value = NULL;
5920   __pyx_v_output_token = __pyx_t_1;
5921 
5922   /* "gssapi/raw/sec_contexts.pyx":620
5923  *     cdef OM_uint32 maj_stat, min_stat
5924  *
5925  *     with nogil:             # <<<<<<<<<<<<<<
5926  *         maj_stat = gss_export_sec_context(&min_stat, &context.raw_ctx,
5927  *                                           &output_token)
5928  */
5929   {
5930       #ifdef WITH_THREAD
5931       PyThreadState *_save;
5932       Py_UNBLOCK_THREADS
5933       __Pyx_FastGIL_Remember();
5934       #endif
5935       /*try:*/ {
5936 
5937         /* "gssapi/raw/sec_contexts.pyx":621
5938  *
5939  *     with nogil:
5940  *         maj_stat = gss_export_sec_context(&min_stat, &context.raw_ctx,             # <<<<<<<<<<<<<<
5941  *                                           &output_token)
5942  *
5943  */
5944         __pyx_v_maj_stat = gss_export_sec_context((&__pyx_v_min_stat), (&__pyx_v_context->raw_ctx), (&__pyx_v_output_token));
5945       }
5946 
5947       /* "gssapi/raw/sec_contexts.pyx":620
5948  *     cdef OM_uint32 maj_stat, min_stat
5949  *
5950  *     with nogil:             # <<<<<<<<<<<<<<
5951  *         maj_stat = gss_export_sec_context(&min_stat, &context.raw_ctx,
5952  *                                           &output_token)
5953  */
5954       /*finally:*/ {
5955         /*normal exit:*/{
5956           #ifdef WITH_THREAD
5957           __Pyx_FastGIL_Forget();
5958           Py_BLOCK_THREADS
5959           #endif
5960           goto __pyx_L5;
5961         }
5962         __pyx_L5:;
5963       }
5964   }
5965 
5966   /* "gssapi/raw/sec_contexts.pyx":624
5967  *                                           &output_token)
5968  *
5969  *     if maj_stat == GSS_S_COMPLETE:             # <<<<<<<<<<<<<<
5970  *         res_token = (<char*>output_token.value)[:output_token.length]
5971  *         gss_release_buffer(&min_stat, &output_token)
5972  */
5973   __pyx_t_2 = ((__pyx_v_maj_stat == GSS_S_COMPLETE) != 0);
5974   if (likely(__pyx_t_2)) {
5975 
5976     /* "gssapi/raw/sec_contexts.pyx":625
5977  *
5978  *     if maj_stat == GSS_S_COMPLETE:
5979  *         res_token = (<char*>output_token.value)[:output_token.length]             # <<<<<<<<<<<<<<
5980  *         gss_release_buffer(&min_stat, &output_token)
5981  *         return res_token
5982  */
5983     __pyx_t_3 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_output_token.value) + 0, __pyx_v_output_token.length - 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 625, __pyx_L1_error)
5984     __Pyx_GOTREF(__pyx_t_3);
5985     __pyx_v_res_token = ((PyObject*)__pyx_t_3);
5986     __pyx_t_3 = 0;
5987 
5988     /* "gssapi/raw/sec_contexts.pyx":626
5989  *     if maj_stat == GSS_S_COMPLETE:
5990  *         res_token = (<char*>output_token.value)[:output_token.length]
5991  *         gss_release_buffer(&min_stat, &output_token)             # <<<<<<<<<<<<<<
5992  *         return res_token
5993  *     else:
5994  */
5995     (void)(gss_release_buffer((&__pyx_v_min_stat), (&__pyx_v_output_token)));
5996 
5997     /* "gssapi/raw/sec_contexts.pyx":627
5998  *         res_token = (<char*>output_token.value)[:output_token.length]
5999  *         gss_release_buffer(&min_stat, &output_token)
6000  *         return res_token             # <<<<<<<<<<<<<<
6001  *     else:
6002  *         raise GSSError(maj_stat, min_stat)
6003  */
6004     __Pyx_XDECREF(__pyx_r);
6005     __Pyx_INCREF(__pyx_v_res_token);
6006     __pyx_r = __pyx_v_res_token;
6007     goto __pyx_L0;
6008 
6009     /* "gssapi/raw/sec_contexts.pyx":624
6010  *                                           &output_token)
6011  *
6012  *     if maj_stat == GSS_S_COMPLETE:             # <<<<<<<<<<<<<<
6013  *         res_token = (<char*>output_token.value)[:output_token.length]
6014  *         gss_release_buffer(&min_stat, &output_token)
6015  */
6016   }
6017 
6018   /* "gssapi/raw/sec_contexts.pyx":629
6019  *         return res_token
6020  *     else:
6021  *         raise GSSError(maj_stat, min_stat)             # <<<<<<<<<<<<<<
6022  *
6023  *
6024  */
6025   /*else*/ {
6026     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_GSSError); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 629, __pyx_L1_error)
6027     __Pyx_GOTREF(__pyx_t_4);
6028     __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_maj_stat); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 629, __pyx_L1_error)
6029     __Pyx_GOTREF(__pyx_t_5);
6030     __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_min_stat); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 629, __pyx_L1_error)
6031     __Pyx_GOTREF(__pyx_t_6);
6032     __pyx_t_7 = NULL;
6033     __pyx_t_8 = 0;
6034     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
6035       __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
6036       if (likely(__pyx_t_7)) {
6037         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
6038         __Pyx_INCREF(__pyx_t_7);
6039         __Pyx_INCREF(function);
6040         __Pyx_DECREF_SET(__pyx_t_4, function);
6041         __pyx_t_8 = 1;
6042       }
6043     }
6044     #if CYTHON_FAST_PYCALL
6045     if (PyFunction_Check(__pyx_t_4)) {
6046       PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
6047       __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 629, __pyx_L1_error)
6048       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6049       __Pyx_GOTREF(__pyx_t_3);
6050       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6051       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6052     } else
6053     #endif
6054     #if CYTHON_FAST_PYCCALL
6055     if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
6056       PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
6057       __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 629, __pyx_L1_error)
6058       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6059       __Pyx_GOTREF(__pyx_t_3);
6060       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6061       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6062     } else
6063     #endif
6064     {
6065       __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 629, __pyx_L1_error)
6066       __Pyx_GOTREF(__pyx_t_9);
6067       if (__pyx_t_7) {
6068         __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
6069       }
6070       __Pyx_GIVEREF(__pyx_t_5);
6071       PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
6072       __Pyx_GIVEREF(__pyx_t_6);
6073       PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
6074       __pyx_t_5 = 0;
6075       __pyx_t_6 = 0;
6076       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 629, __pyx_L1_error)
6077       __Pyx_GOTREF(__pyx_t_3);
6078       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6079     }
6080     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6081     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6082     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6083     __PYX_ERR(1, 629, __pyx_L1_error)
6084   }
6085 
6086   /* "gssapi/raw/sec_contexts.pyx":593
6087  *
6088  *
6089  * def export_sec_context(SecurityContext context not None):             # <<<<<<<<<<<<<<
6090  *     """
6091  *     export_sec_context(context)
6092  */
6093 
6094   /* function exit code */
6095   __pyx_L1_error:;
6096   __Pyx_XDECREF(__pyx_t_3);
6097   __Pyx_XDECREF(__pyx_t_4);
6098   __Pyx_XDECREF(__pyx_t_5);
6099   __Pyx_XDECREF(__pyx_t_6);
6100   __Pyx_XDECREF(__pyx_t_7);
6101   __Pyx_XDECREF(__pyx_t_9);
6102   __Pyx_AddTraceback("gssapi.raw.sec_contexts.export_sec_context", __pyx_clineno, __pyx_lineno, __pyx_filename);
6103   __pyx_r = NULL;
6104   __pyx_L0:;
6105   __Pyx_XDECREF(__pyx_v_res_token);
6106   __Pyx_XGIVEREF(__pyx_r);
6107   __Pyx_RefNannyFinishContext();
6108   return __pyx_r;
6109 }
6110 
6111 /* "gssapi/raw/sec_contexts.pyx":632
6112  *
6113  *
6114  * def delete_sec_context(SecurityContext context not None, local_only=True):             # <<<<<<<<<<<<<<
6115  *     """
6116  *     delete_sec_context(context, local_only=True)
6117  */
6118 
6119 /* Python wrapper */
6120 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_15delete_sec_context(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6121 static char __pyx_doc_6gssapi_3raw_12sec_contexts_14delete_sec_context[] = "\n    delete_sec_context(context, local_only=True)\n    Delete a GSSAPI security context.\n\n    This method deletes a GSSAPI security context,\n    returning an output token to send to the other\n    holder of the security context to notify them\n    of the deletion.\n\n    Note:\n        This method generally should not be used.  :class:`SecurityContext`\n        objects will automatically be freed by Python.\n\n    Args:\n        context (SecurityContext): the security context in question\n        local_only (bool): should we request local deletion (True), or also\n            remote deletion (False), in which case a token is also returned\n\n    Returns:\n        bytes: the output token (if remote deletion is requested).  Generally\n            this is None, but bytes for compatibility.\n\n    Raises:\n        MissingContextError\n    ";
6122 static PyMethodDef __pyx_mdef_6gssapi_3raw_12sec_contexts_15delete_sec_context = {"delete_sec_context", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gssapi_3raw_12sec_contexts_15delete_sec_context, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gssapi_3raw_12sec_contexts_14delete_sec_context};
__pyx_pw_6gssapi_3raw_12sec_contexts_15delete_sec_context(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6123 static PyObject *__pyx_pw_6gssapi_3raw_12sec_contexts_15delete_sec_context(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6124   struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context = 0;
6125   PyObject *__pyx_v_local_only = 0;
6126   int __pyx_lineno = 0;
6127   const char *__pyx_filename = NULL;
6128   int __pyx_clineno = 0;
6129   PyObject *__pyx_r = 0;
6130   __Pyx_RefNannyDeclarations
6131   __Pyx_RefNannySetupContext("delete_sec_context (wrapper)", 0);
6132   {
6133     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_local_only,0};
6134     PyObject* values[2] = {0,0};
6135     values[1] = ((PyObject *)Py_True);
6136     if (unlikely(__pyx_kwds)) {
6137       Py_ssize_t kw_args;
6138       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6139       switch (pos_args) {
6140         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6141         CYTHON_FALLTHROUGH;
6142         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6143         CYTHON_FALLTHROUGH;
6144         case  0: break;
6145         default: goto __pyx_L5_argtuple_error;
6146       }
6147       kw_args = PyDict_Size(__pyx_kwds);
6148       switch (pos_args) {
6149         case  0:
6150         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
6151         else goto __pyx_L5_argtuple_error;
6152         CYTHON_FALLTHROUGH;
6153         case  1:
6154         if (kw_args > 0) {
6155           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_local_only);
6156           if (value) { values[1] = value; kw_args--; }
6157         }
6158       }
6159       if (unlikely(kw_args > 0)) {
6160         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_sec_context") < 0)) __PYX_ERR(1, 632, __pyx_L3_error)
6161       }
6162     } else {
6163       switch (PyTuple_GET_SIZE(__pyx_args)) {
6164         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6165         CYTHON_FALLTHROUGH;
6166         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6167         break;
6168         default: goto __pyx_L5_argtuple_error;
6169       }
6170     }
6171     __pyx_v_context = ((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)values[0]);
6172     __pyx_v_local_only = values[1];
6173   }
6174   goto __pyx_L4_argument_unpacking_done;
6175   __pyx_L5_argtuple_error:;
6176   __Pyx_RaiseArgtupleInvalid("delete_sec_context", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 632, __pyx_L3_error)
6177   __pyx_L3_error:;
6178   __Pyx_AddTraceback("gssapi.raw.sec_contexts.delete_sec_context", __pyx_clineno, __pyx_lineno, __pyx_filename);
6179   __Pyx_RefNannyFinishContext();
6180   return NULL;
6181   __pyx_L4_argument_unpacking_done:;
6182   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext, 0, "context", 0))) __PYX_ERR(1, 632, __pyx_L1_error)
6183   __pyx_r = __pyx_pf_6gssapi_3raw_12sec_contexts_14delete_sec_context(__pyx_self, __pyx_v_context, __pyx_v_local_only);
6184 
6185   /* function exit code */
6186   goto __pyx_L0;
6187   __pyx_L1_error:;
6188   __pyx_r = NULL;
6189   __pyx_L0:;
6190   __Pyx_RefNannyFinishContext();
6191   return __pyx_r;
6192 }
6193 
__pyx_pf_6gssapi_3raw_12sec_contexts_14delete_sec_context(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_context,PyObject * __pyx_v_local_only)6194 static PyObject *__pyx_pf_6gssapi_3raw_12sec_contexts_14delete_sec_context(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, PyObject *__pyx_v_local_only) {
6195   OM_uint32 __pyx_v_maj_stat;
6196   OM_uint32 __pyx_v_min_stat;
6197   gss_buffer_desc __pyx_v_output_token;
6198   PyObject *__pyx_v_res = NULL;
6199   PyObject *__pyx_r = NULL;
6200   __Pyx_RefNannyDeclarations
6201   gss_buffer_desc __pyx_t_1;
6202   int __pyx_t_2;
6203   int __pyx_t_3;
6204   PyObject *__pyx_t_4 = NULL;
6205   PyObject *__pyx_t_5 = NULL;
6206   PyObject *__pyx_t_6 = NULL;
6207   PyObject *__pyx_t_7 = NULL;
6208   PyObject *__pyx_t_8 = NULL;
6209   int __pyx_t_9;
6210   PyObject *__pyx_t_10 = NULL;
6211   int __pyx_lineno = 0;
6212   const char *__pyx_filename = NULL;
6213   int __pyx_clineno = 0;
6214   __Pyx_RefNannySetupContext("delete_sec_context", 0);
6215 
6216   /* "gssapi/raw/sec_contexts.pyx":661
6217  *     cdef OM_uint32 maj_stat, min_stat
6218  *     # GSS_C_EMPTY_BUFFER
6219  *     cdef gss_buffer_desc output_token = gss_buffer_desc(0, NULL)             # <<<<<<<<<<<<<<
6220  *     if not local_only:
6221  *         maj_stat = gss_delete_sec_context(&min_stat, &context.raw_ctx,
6222  */
6223   __pyx_t_1.length = 0;
6224   __pyx_t_1.value = NULL;
6225   __pyx_v_output_token = __pyx_t_1;
6226 
6227   /* "gssapi/raw/sec_contexts.pyx":662
6228  *     # GSS_C_EMPTY_BUFFER
6229  *     cdef gss_buffer_desc output_token = gss_buffer_desc(0, NULL)
6230  *     if not local_only:             # <<<<<<<<<<<<<<
6231  *         maj_stat = gss_delete_sec_context(&min_stat, &context.raw_ctx,
6232  *                                           &output_token)
6233  */
6234   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_local_only); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 662, __pyx_L1_error)
6235   __pyx_t_3 = ((!__pyx_t_2) != 0);
6236   if (__pyx_t_3) {
6237 
6238     /* "gssapi/raw/sec_contexts.pyx":663
6239  *     cdef gss_buffer_desc output_token = gss_buffer_desc(0, NULL)
6240  *     if not local_only:
6241  *         maj_stat = gss_delete_sec_context(&min_stat, &context.raw_ctx,             # <<<<<<<<<<<<<<
6242  *                                           &output_token)
6243  *     else:
6244  */
6245     __pyx_v_maj_stat = gss_delete_sec_context((&__pyx_v_min_stat), (&__pyx_v_context->raw_ctx), (&__pyx_v_output_token));
6246 
6247     /* "gssapi/raw/sec_contexts.pyx":662
6248  *     # GSS_C_EMPTY_BUFFER
6249  *     cdef gss_buffer_desc output_token = gss_buffer_desc(0, NULL)
6250  *     if not local_only:             # <<<<<<<<<<<<<<
6251  *         maj_stat = gss_delete_sec_context(&min_stat, &context.raw_ctx,
6252  *                                           &output_token)
6253  */
6254     goto __pyx_L3;
6255   }
6256 
6257   /* "gssapi/raw/sec_contexts.pyx":666
6258  *                                           &output_token)
6259  *     else:
6260  *         maj_stat = gss_delete_sec_context(&min_stat, &context.raw_ctx,             # <<<<<<<<<<<<<<
6261  *                                           GSS_C_NO_BUFFER)
6262  *
6263  */
6264   /*else*/ {
6265 
6266     /* "gssapi/raw/sec_contexts.pyx":667
6267  *     else:
6268  *         maj_stat = gss_delete_sec_context(&min_stat, &context.raw_ctx,
6269  *                                           GSS_C_NO_BUFFER)             # <<<<<<<<<<<<<<
6270  *
6271  *     if maj_stat == GSS_S_COMPLETE:
6272  */
6273     __pyx_v_maj_stat = gss_delete_sec_context((&__pyx_v_min_stat), (&__pyx_v_context->raw_ctx), GSS_C_NO_BUFFER);
6274   }
6275   __pyx_L3:;
6276 
6277   /* "gssapi/raw/sec_contexts.pyx":669
6278  *                                           GSS_C_NO_BUFFER)
6279  *
6280  *     if maj_stat == GSS_S_COMPLETE:             # <<<<<<<<<<<<<<
6281  *         res = (<char*>output_token.value)[:output_token.length]
6282  *         context.raw_ctx = NULL
6283  */
6284   __pyx_t_3 = ((__pyx_v_maj_stat == GSS_S_COMPLETE) != 0);
6285   if (likely(__pyx_t_3)) {
6286 
6287     /* "gssapi/raw/sec_contexts.pyx":670
6288  *
6289  *     if maj_stat == GSS_S_COMPLETE:
6290  *         res = (<char*>output_token.value)[:output_token.length]             # <<<<<<<<<<<<<<
6291  *         context.raw_ctx = NULL
6292  *         return res
6293  */
6294     __pyx_t_4 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_output_token.value) + 0, __pyx_v_output_token.length - 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 670, __pyx_L1_error)
6295     __Pyx_GOTREF(__pyx_t_4);
6296     __pyx_v_res = ((PyObject*)__pyx_t_4);
6297     __pyx_t_4 = 0;
6298 
6299     /* "gssapi/raw/sec_contexts.pyx":671
6300  *     if maj_stat == GSS_S_COMPLETE:
6301  *         res = (<char*>output_token.value)[:output_token.length]
6302  *         context.raw_ctx = NULL             # <<<<<<<<<<<<<<
6303  *         return res
6304  *     else:
6305  */
6306     __pyx_v_context->raw_ctx = NULL;
6307 
6308     /* "gssapi/raw/sec_contexts.pyx":672
6309  *         res = (<char*>output_token.value)[:output_token.length]
6310  *         context.raw_ctx = NULL
6311  *         return res             # <<<<<<<<<<<<<<
6312  *     else:
6313  *         raise GSSError(maj_stat, min_stat)
6314  */
6315     __Pyx_XDECREF(__pyx_r);
6316     __Pyx_INCREF(__pyx_v_res);
6317     __pyx_r = __pyx_v_res;
6318     goto __pyx_L0;
6319 
6320     /* "gssapi/raw/sec_contexts.pyx":669
6321  *                                           GSS_C_NO_BUFFER)
6322  *
6323  *     if maj_stat == GSS_S_COMPLETE:             # <<<<<<<<<<<<<<
6324  *         res = (<char*>output_token.value)[:output_token.length]
6325  *         context.raw_ctx = NULL
6326  */
6327   }
6328 
6329   /* "gssapi/raw/sec_contexts.pyx":674
6330  *         return res
6331  *     else:
6332  *         raise GSSError(maj_stat, min_stat)             # <<<<<<<<<<<<<<
6333  */
6334   /*else*/ {
6335     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_GSSError); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 674, __pyx_L1_error)
6336     __Pyx_GOTREF(__pyx_t_5);
6337     __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_maj_stat); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 674, __pyx_L1_error)
6338     __Pyx_GOTREF(__pyx_t_6);
6339     __pyx_t_7 = __Pyx_PyInt_From_uint32_t(__pyx_v_min_stat); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
6340     __Pyx_GOTREF(__pyx_t_7);
6341     __pyx_t_8 = NULL;
6342     __pyx_t_9 = 0;
6343     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
6344       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
6345       if (likely(__pyx_t_8)) {
6346         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
6347         __Pyx_INCREF(__pyx_t_8);
6348         __Pyx_INCREF(function);
6349         __Pyx_DECREF_SET(__pyx_t_5, function);
6350         __pyx_t_9 = 1;
6351       }
6352     }
6353     #if CYTHON_FAST_PYCALL
6354     if (PyFunction_Check(__pyx_t_5)) {
6355       PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
6356       __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 674, __pyx_L1_error)
6357       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6358       __Pyx_GOTREF(__pyx_t_4);
6359       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6360       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6361     } else
6362     #endif
6363     #if CYTHON_FAST_PYCCALL
6364     if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
6365       PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_7};
6366       __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 674, __pyx_L1_error)
6367       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6368       __Pyx_GOTREF(__pyx_t_4);
6369       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6370       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6371     } else
6372     #endif
6373     {
6374       __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 674, __pyx_L1_error)
6375       __Pyx_GOTREF(__pyx_t_10);
6376       if (__pyx_t_8) {
6377         __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
6378       }
6379       __Pyx_GIVEREF(__pyx_t_6);
6380       PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6);
6381       __Pyx_GIVEREF(__pyx_t_7);
6382       PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
6383       __pyx_t_6 = 0;
6384       __pyx_t_7 = 0;
6385       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 674, __pyx_L1_error)
6386       __Pyx_GOTREF(__pyx_t_4);
6387       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6388     }
6389     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6390     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
6391     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6392     __PYX_ERR(1, 674, __pyx_L1_error)
6393   }
6394 
6395   /* "gssapi/raw/sec_contexts.pyx":632
6396  *
6397  *
6398  * def delete_sec_context(SecurityContext context not None, local_only=True):             # <<<<<<<<<<<<<<
6399  *     """
6400  *     delete_sec_context(context, local_only=True)
6401  */
6402 
6403   /* function exit code */
6404   __pyx_L1_error:;
6405   __Pyx_XDECREF(__pyx_t_4);
6406   __Pyx_XDECREF(__pyx_t_5);
6407   __Pyx_XDECREF(__pyx_t_6);
6408   __Pyx_XDECREF(__pyx_t_7);
6409   __Pyx_XDECREF(__pyx_t_8);
6410   __Pyx_XDECREF(__pyx_t_10);
6411   __Pyx_AddTraceback("gssapi.raw.sec_contexts.delete_sec_context", __pyx_clineno, __pyx_lineno, __pyx_filename);
6412   __pyx_r = NULL;
6413   __pyx_L0:;
6414   __Pyx_XDECREF(__pyx_v_res);
6415   __Pyx_XGIVEREF(__pyx_r);
6416   __Pyx_RefNannyFinishContext();
6417   return __pyx_r;
6418 }
6419 
6420 /* "gssapi/raw/cython_converters.pxd":16
6421  * cdef OID c_make_oid(gss_OID oid)
6422  *
6423  * cdef inline OM_uint32 c_py_ttl_to_c(object ttl) except? 1:             # <<<<<<<<<<<<<<
6424  *     """Converts None to GSS_C_INDEFINITE, otherwise returns input."""
6425  *     if ttl is None:
6426  */
6427 
__pyx_f_6gssapi_3raw_17cython_converters_c_py_ttl_to_c(PyObject * __pyx_v_ttl)6428 static CYTHON_INLINE OM_uint32 __pyx_f_6gssapi_3raw_17cython_converters_c_py_ttl_to_c(PyObject *__pyx_v_ttl) {
6429   OM_uint32 __pyx_r;
6430   __Pyx_RefNannyDeclarations
6431   int __pyx_t_1;
6432   int __pyx_t_2;
6433   OM_uint32 __pyx_t_3;
6434   int __pyx_lineno = 0;
6435   const char *__pyx_filename = NULL;
6436   int __pyx_clineno = 0;
6437   __Pyx_RefNannySetupContext("c_py_ttl_to_c", 0);
6438 
6439   /* "gssapi/raw/cython_converters.pxd":18
6440  * cdef inline OM_uint32 c_py_ttl_to_c(object ttl) except? 1:
6441  *     """Converts None to GSS_C_INDEFINITE, otherwise returns input."""
6442  *     if ttl is None:             # <<<<<<<<<<<<<<
6443  *         return GSS_C_INDEFINITE
6444  *     else:
6445  */
6446   __pyx_t_1 = (__pyx_v_ttl == Py_None);
6447   __pyx_t_2 = (__pyx_t_1 != 0);
6448   if (__pyx_t_2) {
6449 
6450     /* "gssapi/raw/cython_converters.pxd":19
6451  *     """Converts None to GSS_C_INDEFINITE, otherwise returns input."""
6452  *     if ttl is None:
6453  *         return GSS_C_INDEFINITE             # <<<<<<<<<<<<<<
6454  *     else:
6455  *         return <OM_uint32>ttl
6456  */
6457     __pyx_r = GSS_C_INDEFINITE;
6458     goto __pyx_L0;
6459 
6460     /* "gssapi/raw/cython_converters.pxd":18
6461  * cdef inline OM_uint32 c_py_ttl_to_c(object ttl) except? 1:
6462  *     """Converts None to GSS_C_INDEFINITE, otherwise returns input."""
6463  *     if ttl is None:             # <<<<<<<<<<<<<<
6464  *         return GSS_C_INDEFINITE
6465  *     else:
6466  */
6467   }
6468 
6469   /* "gssapi/raw/cython_converters.pxd":21
6470  *         return GSS_C_INDEFINITE
6471  *     else:
6472  *         return <OM_uint32>ttl             # <<<<<<<<<<<<<<
6473  *
6474  *
6475  */
6476   /*else*/ {
6477     __pyx_t_3 = __Pyx_PyInt_As_uint32_t(__pyx_v_ttl); if (unlikely((__pyx_t_3 == ((OM_uint32)-1)) && PyErr_Occurred())) __PYX_ERR(2, 21, __pyx_L1_error)
6478     __pyx_r = ((OM_uint32)__pyx_t_3);
6479     goto __pyx_L0;
6480   }
6481 
6482   /* "gssapi/raw/cython_converters.pxd":16
6483  * cdef OID c_make_oid(gss_OID oid)
6484  *
6485  * cdef inline OM_uint32 c_py_ttl_to_c(object ttl) except? 1:             # <<<<<<<<<<<<<<
6486  *     """Converts None to GSS_C_INDEFINITE, otherwise returns input."""
6487  *     if ttl is None:
6488  */
6489 
6490   /* function exit code */
6491   __pyx_L1_error:;
6492   __Pyx_AddTraceback("gssapi.raw.cython_converters.c_py_ttl_to_c", __pyx_clineno, __pyx_lineno, __pyx_filename);
6493   __pyx_r = 1;
6494   __pyx_L0:;
6495   __Pyx_RefNannyFinishContext();
6496   return __pyx_r;
6497 }
6498 
6499 /* "gssapi/raw/cython_converters.pxd":24
6500  *
6501  *
6502  * cdef inline object c_c_ttl_to_py(OM_uint32 ttl):             # <<<<<<<<<<<<<<
6503  *     """Converts GSS_C_INDEFINITE to None, otherwise return input."""
6504  *     if ttl == GSS_C_INDEFINITE:
6505  */
6506 
__pyx_f_6gssapi_3raw_17cython_converters_c_c_ttl_to_py(OM_uint32 __pyx_v_ttl)6507 static CYTHON_INLINE PyObject *__pyx_f_6gssapi_3raw_17cython_converters_c_c_ttl_to_py(OM_uint32 __pyx_v_ttl) {
6508   PyObject *__pyx_r = NULL;
6509   __Pyx_RefNannyDeclarations
6510   int __pyx_t_1;
6511   PyObject *__pyx_t_2 = NULL;
6512   int __pyx_lineno = 0;
6513   const char *__pyx_filename = NULL;
6514   int __pyx_clineno = 0;
6515   __Pyx_RefNannySetupContext("c_c_ttl_to_py", 0);
6516 
6517   /* "gssapi/raw/cython_converters.pxd":26
6518  * cdef inline object c_c_ttl_to_py(OM_uint32 ttl):
6519  *     """Converts GSS_C_INDEFINITE to None, otherwise return input."""
6520  *     if ttl == GSS_C_INDEFINITE:             # <<<<<<<<<<<<<<
6521  *         return None
6522  *     else:
6523  */
6524   __pyx_t_1 = ((__pyx_v_ttl == GSS_C_INDEFINITE) != 0);
6525   if (__pyx_t_1) {
6526 
6527     /* "gssapi/raw/cython_converters.pxd":27
6528  *     """Converts GSS_C_INDEFINITE to None, otherwise return input."""
6529  *     if ttl == GSS_C_INDEFINITE:
6530  *         return None             # <<<<<<<<<<<<<<
6531  *     else:
6532  *         return ttl
6533  */
6534     __Pyx_XDECREF(__pyx_r);
6535     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6536     goto __pyx_L0;
6537 
6538     /* "gssapi/raw/cython_converters.pxd":26
6539  * cdef inline object c_c_ttl_to_py(OM_uint32 ttl):
6540  *     """Converts GSS_C_INDEFINITE to None, otherwise return input."""
6541  *     if ttl == GSS_C_INDEFINITE:             # <<<<<<<<<<<<<<
6542  *         return None
6543  *     else:
6544  */
6545   }
6546 
6547   /* "gssapi/raw/cython_converters.pxd":29
6548  *         return None
6549  *     else:
6550  *         return ttl             # <<<<<<<<<<<<<<
6551  *
6552  *
6553  */
6554   /*else*/ {
6555     __Pyx_XDECREF(__pyx_r);
6556     __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_ttl); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 29, __pyx_L1_error)
6557     __Pyx_GOTREF(__pyx_t_2);
6558     __pyx_r = __pyx_t_2;
6559     __pyx_t_2 = 0;
6560     goto __pyx_L0;
6561   }
6562 
6563   /* "gssapi/raw/cython_converters.pxd":24
6564  *
6565  *
6566  * cdef inline object c_c_ttl_to_py(OM_uint32 ttl):             # <<<<<<<<<<<<<<
6567  *     """Converts GSS_C_INDEFINITE to None, otherwise return input."""
6568  *     if ttl == GSS_C_INDEFINITE:
6569  */
6570 
6571   /* function exit code */
6572   __pyx_L1_error:;
6573   __Pyx_XDECREF(__pyx_t_2);
6574   __Pyx_AddTraceback("gssapi.raw.cython_converters.c_c_ttl_to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
6575   __pyx_r = 0;
6576   __pyx_L0:;
6577   __Pyx_XGIVEREF(__pyx_r);
6578   __Pyx_RefNannyFinishContext();
6579   return __pyx_r;
6580 }
6581 
6582 /* "gssapi/raw/cython_converters.pxd":32
6583  *
6584  *
6585  * cdef inline bint c_compare_oids(gss_OID a, gss_OID b):             # <<<<<<<<<<<<<<
6586  *     """Compare two OIDs to see if they are the same."""
6587  *
6588  */
6589 
__pyx_f_6gssapi_3raw_17cython_converters_c_compare_oids(gss_OID __pyx_v_a,gss_OID __pyx_v_b)6590 static CYTHON_INLINE int __pyx_f_6gssapi_3raw_17cython_converters_c_compare_oids(gss_OID __pyx_v_a, gss_OID __pyx_v_b) {
6591   int __pyx_r;
6592   __Pyx_RefNannyDeclarations
6593   int __pyx_t_1;
6594   int __pyx_t_2;
6595   __Pyx_RefNannySetupContext("c_compare_oids", 0);
6596 
6597   /* "gssapi/raw/cython_converters.pxd":35
6598  *     """Compare two OIDs to see if they are the same."""
6599  *
6600  *     return (a.length == b.length and not             # <<<<<<<<<<<<<<
6601  *             memcmp(a.elements, b.elements, a.length))
6602  */
6603   __pyx_t_2 = ((__pyx_v_a->length == __pyx_v_b->length) != 0);
6604   if (__pyx_t_2) {
6605   } else {
6606     __pyx_t_1 = __pyx_t_2;
6607     goto __pyx_L3_bool_binop_done;
6608   }
6609 
6610   /* "gssapi/raw/cython_converters.pxd":36
6611  *
6612  *     return (a.length == b.length and not
6613  *             memcmp(a.elements, b.elements, a.length))             # <<<<<<<<<<<<<<
6614  */
6615   __pyx_t_2 = ((!(memcmp(__pyx_v_a->elements, __pyx_v_b->elements, __pyx_v_a->length) != 0)) != 0);
6616   __pyx_t_1 = __pyx_t_2;
6617   __pyx_L3_bool_binop_done:;
6618   __pyx_r = __pyx_t_1;
6619   goto __pyx_L0;
6620 
6621   /* "gssapi/raw/cython_converters.pxd":32
6622  *
6623  *
6624  * cdef inline bint c_compare_oids(gss_OID a, gss_OID b):             # <<<<<<<<<<<<<<
6625  *     """Compare two OIDs to see if they are the same."""
6626  *
6627  */
6628 
6629   /* function exit code */
6630   __pyx_L0:;
6631   __Pyx_RefNannyFinishContext();
6632   return __pyx_r;
6633 }
6634 
__pyx_tp_new_6gssapi_3raw_12sec_contexts_SecurityContext(PyTypeObject * t,PyObject * a,PyObject * k)6635 static PyObject *__pyx_tp_new_6gssapi_3raw_12sec_contexts_SecurityContext(PyTypeObject *t, PyObject *a, PyObject *k) {
6636   PyObject *o;
6637   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
6638     o = (*t->tp_alloc)(t, 0);
6639   } else {
6640     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
6641   }
6642   if (unlikely(!o)) return 0;
6643   if (unlikely(__pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_1__cinit__(o, a, k) < 0)) goto bad;
6644   return o;
6645   bad:
6646   Py_DECREF(o); o = 0;
6647   return NULL;
6648 }
6649 
__pyx_tp_dealloc_6gssapi_3raw_12sec_contexts_SecurityContext(PyObject * o)6650 static void __pyx_tp_dealloc_6gssapi_3raw_12sec_contexts_SecurityContext(PyObject *o) {
6651   #if CYTHON_USE_TP_FINALIZE
6652   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
6653     if (PyObject_CallFinalizerFromDealloc(o)) return;
6654   }
6655   #endif
6656   {
6657     PyObject *etype, *eval, *etb;
6658     PyErr_Fetch(&etype, &eval, &etb);
6659     __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
6660     __pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_3__dealloc__(o);
6661     __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
6662     PyErr_Restore(etype, eval, etb);
6663   }
6664   (*Py_TYPE(o)->tp_free)(o);
6665 }
6666 
__pyx_getprop_6gssapi_3raw_12sec_contexts_15SecurityContext__started(PyObject * o,CYTHON_UNUSED void * x)6667 static PyObject *__pyx_getprop_6gssapi_3raw_12sec_contexts_15SecurityContext__started(PyObject *o, CYTHON_UNUSED void *x) {
6668   return __pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_8_started_1__get__(o);
6669 }
6670 
6671 static PyMethodDef __pyx_methods_6gssapi_3raw_12sec_contexts_SecurityContext[] = {
6672   {"__reduce_cython__", (PyCFunction)__pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_5__reduce_cython__, METH_NOARGS, 0},
6673   {"__setstate_cython__", (PyCFunction)__pyx_pw_6gssapi_3raw_12sec_contexts_15SecurityContext_7__setstate_cython__, METH_O, 0},
6674   {0, 0, 0, 0}
6675 };
6676 
6677 static struct PyGetSetDef __pyx_getsets_6gssapi_3raw_12sec_contexts_SecurityContext[] = {
6678   {(char *)"_started", __pyx_getprop_6gssapi_3raw_12sec_contexts_15SecurityContext__started, 0, (char *)"Whether the underlying context is NULL.", 0},
6679   {0, 0, 0, 0, 0}
6680 };
6681 
6682 static PyTypeObject __pyx_type_6gssapi_3raw_12sec_contexts_SecurityContext = {
6683   PyVarObject_HEAD_INIT(0, 0)
6684   "gssapi.raw.sec_contexts.SecurityContext", /*tp_name*/
6685   sizeof(struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext), /*tp_basicsize*/
6686   0, /*tp_itemsize*/
6687   __pyx_tp_dealloc_6gssapi_3raw_12sec_contexts_SecurityContext, /*tp_dealloc*/
6688   #if PY_VERSION_HEX < 0x030800b4
6689   0, /*tp_print*/
6690   #endif
6691   #if PY_VERSION_HEX >= 0x030800b4
6692   0, /*tp_vectorcall_offset*/
6693   #endif
6694   0, /*tp_getattr*/
6695   0, /*tp_setattr*/
6696   #if PY_MAJOR_VERSION < 3
6697   0, /*tp_compare*/
6698   #endif
6699   #if PY_MAJOR_VERSION >= 3
6700   0, /*tp_as_async*/
6701   #endif
6702   0, /*tp_repr*/
6703   0, /*tp_as_number*/
6704   0, /*tp_as_sequence*/
6705   0, /*tp_as_mapping*/
6706   0, /*tp_hash*/
6707   0, /*tp_call*/
6708   0, /*tp_str*/
6709   0, /*tp_getattro*/
6710   0, /*tp_setattro*/
6711   0, /*tp_as_buffer*/
6712   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
6713   "\n    A GSSAPI Security Context\n    ", /*tp_doc*/
6714   0, /*tp_traverse*/
6715   0, /*tp_clear*/
6716   0, /*tp_richcompare*/
6717   0, /*tp_weaklistoffset*/
6718   0, /*tp_iter*/
6719   0, /*tp_iternext*/
6720   __pyx_methods_6gssapi_3raw_12sec_contexts_SecurityContext, /*tp_methods*/
6721   0, /*tp_members*/
6722   __pyx_getsets_6gssapi_3raw_12sec_contexts_SecurityContext, /*tp_getset*/
6723   0, /*tp_base*/
6724   0, /*tp_dict*/
6725   0, /*tp_descr_get*/
6726   0, /*tp_descr_set*/
6727   0, /*tp_dictoffset*/
6728   0, /*tp_init*/
6729   0, /*tp_alloc*/
6730   __pyx_tp_new_6gssapi_3raw_12sec_contexts_SecurityContext, /*tp_new*/
6731   0, /*tp_free*/
6732   0, /*tp_is_gc*/
6733   0, /*tp_bases*/
6734   0, /*tp_mro*/
6735   0, /*tp_cache*/
6736   0, /*tp_subclasses*/
6737   0, /*tp_weaklist*/
6738   0, /*tp_del*/
6739   0, /*tp_version_tag*/
6740   #if PY_VERSION_HEX >= 0x030400a1
6741   0, /*tp_finalize*/
6742   #endif
6743   #if PY_VERSION_HEX >= 0x030800b1
6744   0, /*tp_vectorcall*/
6745   #endif
6746   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
6747   0, /*tp_print*/
6748   #endif
6749 };
6750 
6751 static PyMethodDef __pyx_methods[] = {
6752   {0, 0, 0, 0}
6753 };
6754 
6755 #if PY_MAJOR_VERSION >= 3
6756 #if CYTHON_PEP489_MULTI_PHASE_INIT
6757 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
6758 static int __pyx_pymod_exec_sec_contexts(PyObject* module); /*proto*/
6759 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
6760   {Py_mod_create, (void*)__pyx_pymod_create},
6761   {Py_mod_exec, (void*)__pyx_pymod_exec_sec_contexts},
6762   {0, NULL}
6763 };
6764 #endif
6765 
6766 static struct PyModuleDef __pyx_moduledef = {
6767     PyModuleDef_HEAD_INIT,
6768     "sec_contexts",
6769     0, /* m_doc */
6770   #if CYTHON_PEP489_MULTI_PHASE_INIT
6771     0, /* m_size */
6772   #else
6773     -1, /* m_size */
6774   #endif
6775     __pyx_methods /* m_methods */,
6776   #if CYTHON_PEP489_MULTI_PHASE_INIT
6777     __pyx_moduledef_slots, /* m_slots */
6778   #else
6779     NULL, /* m_reload */
6780   #endif
6781     NULL, /* m_traverse */
6782     NULL, /* m_clear */
6783     NULL /* m_free */
6784 };
6785 #endif
6786 #ifndef CYTHON_SMALL_CODE
6787 #if defined(__clang__)
6788     #define CYTHON_SMALL_CODE
6789 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
6790     #define CYTHON_SMALL_CODE __attribute__((cold))
6791 #else
6792     #define CYTHON_SMALL_CODE
6793 #endif
6794 #endif
6795 
6796 static __Pyx_StringTabEntry __pyx_string_tab[] = {
6797   {&__pyx_n_s_AcceptSecContextResult, __pyx_k_AcceptSecContextResult, sizeof(__pyx_k_AcceptSecContextResult), 0, 0, 1, 1},
6798   {&__pyx_n_s_BASE, __pyx_k_BASE, sizeof(__pyx_k_BASE), 0, 0, 1, 1},
6799   {&__pyx_n_s_GSSAPI, __pyx_k_GSSAPI, sizeof(__pyx_k_GSSAPI), 0, 0, 1, 1},
6800   {&__pyx_n_s_GSSError, __pyx_k_GSSError, sizeof(__pyx_k_GSSError), 0, 0, 1, 1},
6801   {&__pyx_n_s_InitSecContextResult, __pyx_k_InitSecContextResult, sizeof(__pyx_k_InitSecContextResult), 0, 0, 1, 1},
6802   {&__pyx_n_s_InquireContextResult, __pyx_k_InquireContextResult, sizeof(__pyx_k_InquireContextResult), 0, 0, 1, 1},
6803   {&__pyx_n_s_IntEnumFlagSet, __pyx_k_IntEnumFlagSet, sizeof(__pyx_k_IntEnumFlagSet), 0, 0, 1, 1},
6804   {&__pyx_n_s_MechType, __pyx_k_MechType, sizeof(__pyx_k_MechType), 0, 0, 1, 1},
6805   {&__pyx_n_s_RequirementFlag, __pyx_k_RequirementFlag, sizeof(__pyx_k_RequirementFlag), 0, 0, 1, 1},
6806   {&__pyx_n_s_SecurityContext, __pyx_k_SecurityContext, sizeof(__pyx_k_SecurityContext), 0, 0, 1, 1},
6807   {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
6808   {&__pyx_n_s_accept_sec_context, __pyx_k_accept_sec_context, sizeof(__pyx_k_accept_sec_context), 0, 0, 1, 1},
6809   {&__pyx_n_s_acceptor_creds, __pyx_k_acceptor_creds, sizeof(__pyx_k_acceptor_creds), 0, 0, 1, 1},
6810   {&__pyx_n_s_act_acceptor_cred, __pyx_k_act_acceptor_cred, sizeof(__pyx_k_act_acceptor_cred), 0, 0, 1, 1},
6811   {&__pyx_n_s_act_cred, __pyx_k_act_cred, sizeof(__pyx_k_act_cred), 0, 0, 1, 1},
6812   {&__pyx_n_s_actual_mech_type, __pyx_k_actual_mech_type, sizeof(__pyx_k_actual_mech_type), 0, 0, 1, 1},
6813   {&__pyx_n_s_bdng, __pyx_k_bdng, sizeof(__pyx_k_bdng), 0, 0, 1, 1},
6814   {&__pyx_n_s_channel_bindings, __pyx_k_channel_bindings, sizeof(__pyx_k_channel_bindings), 0, 0, 1, 1},
6815   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
6816   {&__pyx_n_s_complete, __pyx_k_complete, sizeof(__pyx_k_complete), 0, 0, 1, 1},
6817   {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1},
6818   {&__pyx_n_s_context_time, __pyx_k_context_time, sizeof(__pyx_k_context_time), 0, 0, 1, 1},
6819   {&__pyx_n_s_cpy, __pyx_k_cpy, sizeof(__pyx_k_cpy), 0, 0, 1, 1},
6820   {&__pyx_n_s_creds, __pyx_k_creds, sizeof(__pyx_k_creds), 0, 0, 1, 1},
6821   {&__pyx_n_s_ctx, __pyx_k_ctx, sizeof(__pyx_k_ctx), 0, 0, 1, 1},
6822   {&__pyx_n_s_delegated_cred, __pyx_k_delegated_cred, sizeof(__pyx_k_delegated_cred), 0, 0, 1, 1},
6823   {&__pyx_n_s_delete_sec_context, __pyx_k_delete_sec_context, sizeof(__pyx_k_delete_sec_context), 0, 0, 1, 1},
6824   {&__pyx_n_s_export_sec_context, __pyx_k_export_sec_context, sizeof(__pyx_k_export_sec_context), 0, 0, 1, 1},
6825   {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
6826   {&__pyx_n_s_flags_ptr, __pyx_k_flags_ptr, sizeof(__pyx_k_flags_ptr), 0, 0, 1, 1},
6827   {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
6828   {&__pyx_n_s_gssapi_raw_misc, __pyx_k_gssapi_raw_misc, sizeof(__pyx_k_gssapi_raw_misc), 0, 0, 1, 1},
6829   {&__pyx_n_s_gssapi_raw_named_tuples, __pyx_k_gssapi_raw_named_tuples, sizeof(__pyx_k_gssapi_raw_named_tuples), 0, 0, 1, 1},
6830   {&__pyx_n_s_gssapi_raw_sec_contexts, __pyx_k_gssapi_raw_sec_contexts, sizeof(__pyx_k_gssapi_raw_sec_contexts), 0, 0, 1, 1},
6831   {&__pyx_kp_s_gssapi_raw_sec_contexts_pyx, __pyx_k_gssapi_raw_sec_contexts_pyx, sizeof(__pyx_k_gssapi_raw_sec_contexts_pyx), 0, 0, 1, 0},
6832   {&__pyx_n_s_gssapi_raw_types, __pyx_k_gssapi_raw_types, sizeof(__pyx_k_gssapi_raw_types), 0, 0, 1, 1},
6833   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
6834   {&__pyx_n_s_import_sec_context, __pyx_k_import_sec_context, sizeof(__pyx_k_import_sec_context), 0, 0, 1, 1},
6835   {&__pyx_n_s_init_name_ptr, __pyx_k_init_name_ptr, sizeof(__pyx_k_init_name_ptr), 0, 0, 1, 1},
6836   {&__pyx_n_s_init_sec_context, __pyx_k_init_sec_context, sizeof(__pyx_k_init_sec_context), 0, 0, 1, 1},
6837   {&__pyx_n_s_initiator_name, __pyx_k_initiator_name, sizeof(__pyx_k_initiator_name), 0, 0, 1, 1},
6838   {&__pyx_n_s_input_token, __pyx_k_input_token, sizeof(__pyx_k_input_token), 0, 0, 1, 1},
6839   {&__pyx_n_s_input_token_buffer, __pyx_k_input_token_buffer, sizeof(__pyx_k_input_token_buffer), 0, 0, 1, 1},
6840   {&__pyx_n_s_input_ttl, __pyx_k_input_ttl, sizeof(__pyx_k_input_ttl), 0, 0, 1, 1},
6841   {&__pyx_n_s_inquire_context, __pyx_k_inquire_context, sizeof(__pyx_k_inquire_context), 0, 0, 1, 1},
6842   {&__pyx_n_s_is_complete, __pyx_k_is_complete, sizeof(__pyx_k_is_complete), 0, 0, 1, 1},
6843   {&__pyx_n_s_is_complete_ptr, __pyx_k_is_complete_ptr, sizeof(__pyx_k_is_complete_ptr), 0, 0, 1, 1},
6844   {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
6845   {&__pyx_n_s_lifetime, __pyx_k_lifetime, sizeof(__pyx_k_lifetime), 0, 0, 1, 1},
6846   {&__pyx_n_s_local_only, __pyx_k_local_only, sizeof(__pyx_k_local_only), 0, 0, 1, 1},
6847   {&__pyx_n_s_locally_init, __pyx_k_locally_init, sizeof(__pyx_k_locally_init), 0, 0, 1, 1},
6848   {&__pyx_n_s_locally_init_ptr, __pyx_k_locally_init_ptr, sizeof(__pyx_k_locally_init_ptr), 0, 0, 1, 1},
6849   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
6850   {&__pyx_n_s_maj_stat, __pyx_k_maj_stat, sizeof(__pyx_k_maj_stat), 0, 0, 1, 1},
6851   {&__pyx_n_s_mech, __pyx_k_mech, sizeof(__pyx_k_mech), 0, 0, 1, 1},
6852   {&__pyx_n_s_mech_oid, __pyx_k_mech_oid, sizeof(__pyx_k_mech_oid), 0, 0, 1, 1},
6853   {&__pyx_n_s_mech_type, __pyx_k_mech_type, sizeof(__pyx_k_mech_type), 0, 0, 1, 1},
6854   {&__pyx_n_s_mech_type_ptr, __pyx_k_mech_type_ptr, sizeof(__pyx_k_mech_type_ptr), 0, 0, 1, 1},
6855   {&__pyx_n_s_min_stat, __pyx_k_min_stat, sizeof(__pyx_k_min_stat), 0, 0, 1, 1},
6856   {&__pyx_n_s_mutual_authentication, __pyx_k_mutual_authentication, sizeof(__pyx_k_mutual_authentication), 0, 0, 1, 1},
6857   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
6858   {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
6859   {&__pyx_n_s_oc, __pyx_k_oc, sizeof(__pyx_k_oc), 0, 0, 1, 1},
6860   {&__pyx_n_s_on, __pyx_k_on, sizeof(__pyx_k_on), 0, 0, 1, 1},
6861   {&__pyx_n_s_out_of_sequence_detection, __pyx_k_out_of_sequence_detection, sizeof(__pyx_k_out_of_sequence_detection), 0, 0, 1, 1},
6862   {&__pyx_n_s_output_context, __pyx_k_output_context, sizeof(__pyx_k_output_context), 0, 0, 1, 1},
6863   {&__pyx_n_s_output_flags, __pyx_k_output_flags, sizeof(__pyx_k_output_flags), 0, 0, 1, 1},
6864   {&__pyx_n_s_output_init_name, __pyx_k_output_init_name, sizeof(__pyx_k_output_init_name), 0, 0, 1, 1},
6865   {&__pyx_n_s_output_locally_init, __pyx_k_output_locally_init, sizeof(__pyx_k_output_locally_init), 0, 0, 1, 1},
6866   {&__pyx_n_s_output_mech_type, __pyx_k_output_mech_type, sizeof(__pyx_k_output_mech_type), 0, 0, 1, 1},
6867   {&__pyx_n_s_output_target_name, __pyx_k_output_target_name, sizeof(__pyx_k_output_target_name), 0, 0, 1, 1},
6868   {&__pyx_n_s_output_token, __pyx_k_output_token, sizeof(__pyx_k_output_token), 0, 0, 1, 1},
6869   {&__pyx_n_s_output_token_buffer, __pyx_k_output_token_buffer, sizeof(__pyx_k_output_token_buffer), 0, 0, 1, 1},
6870   {&__pyx_n_s_output_ttl, __pyx_k_output_ttl, sizeof(__pyx_k_output_ttl), 0, 0, 1, 1},
6871   {&__pyx_n_s_output_ttl_py, __pyx_k_output_ttl_py, sizeof(__pyx_k_output_ttl_py), 0, 0, 1, 1},
6872   {&__pyx_n_s_process_context_token, __pyx_k_process_context_token, sizeof(__pyx_k_process_context_token), 0, 0, 1, 1},
6873   {&__pyx_n_s_py_complete, __pyx_k_py_complete, sizeof(__pyx_k_py_complete), 0, 0, 1, 1},
6874   {&__pyx_n_s_py_flags, __pyx_k_py_flags, sizeof(__pyx_k_py_flags), 0, 0, 1, 1},
6875   {&__pyx_n_s_py_locally_init, __pyx_k_py_locally_init, sizeof(__pyx_k_py_locally_init), 0, 0, 1, 1},
6876   {&__pyx_n_s_py_mech_type, __pyx_k_py_mech_type, sizeof(__pyx_k_py_mech_type), 0, 0, 1, 1},
6877   {&__pyx_n_s_py_ttl, __pyx_k_py_ttl, sizeof(__pyx_k_py_ttl), 0, 0, 1, 1},
6878   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
6879   {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
6880   {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
6881   {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
6882   {&__pyx_n_s_req_flags, __pyx_k_req_flags, sizeof(__pyx_k_req_flags), 0, 0, 1, 1},
6883   {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
6884   {&__pyx_n_s_res_token, __pyx_k_res_token, sizeof(__pyx_k_res_token), 0, 0, 1, 1},
6885   {&__pyx_n_s_ret_flags, __pyx_k_ret_flags, sizeof(__pyx_k_ret_flags), 0, 0, 1, 1},
6886   {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
6887   {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
6888   {&__pyx_n_s_sn, __pyx_k_sn, sizeof(__pyx_k_sn), 0, 0, 1, 1},
6889   {&__pyx_n_s_target_name, __pyx_k_target_name, sizeof(__pyx_k_target_name), 0, 0, 1, 1},
6890   {&__pyx_n_s_target_name_ptr, __pyx_k_target_name_ptr, sizeof(__pyx_k_target_name_ptr), 0, 0, 1, 1},
6891   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
6892   {&__pyx_n_s_tmp_min_stat, __pyx_k_tmp_min_stat, sizeof(__pyx_k_tmp_min_stat), 0, 0, 1, 1},
6893   {&__pyx_n_s_tn, __pyx_k_tn, sizeof(__pyx_k_tn), 0, 0, 1, 1},
6894   {&__pyx_n_s_token, __pyx_k_token, sizeof(__pyx_k_token), 0, 0, 1, 1},
6895   {&__pyx_n_s_token_buffer, __pyx_k_token_buffer, sizeof(__pyx_k_token_buffer), 0, 0, 1, 1},
6896   {&__pyx_n_s_ttl, __pyx_k_ttl, sizeof(__pyx_k_ttl), 0, 0, 1, 1},
6897   {&__pyx_n_s_ttl_ptr, __pyx_k_ttl_ptr, sizeof(__pyx_k_ttl_ptr), 0, 0, 1, 1},
6898   {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
6899   {0, 0, 0, 0, 0, 0, 0}
6900 };
__Pyx_InitCachedBuiltins(void)6901 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
6902   __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
6903   return 0;
6904   __pyx_L1_error:;
6905   return -1;
6906 }
6907 
__Pyx_InitCachedConstants(void)6908 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
6909   __Pyx_RefNannyDeclarations
6910   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
6911 
6912   /* "(tree fragment)":2
6913  * def __reduce_cython__(self):
6914  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
6915  * def __setstate_cython__(self, __pyx_state):
6916  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6917  */
6918   __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 2, __pyx_L1_error)
6919   __Pyx_GOTREF(__pyx_tuple_);
6920   __Pyx_GIVEREF(__pyx_tuple_);
6921 
6922   /* "(tree fragment)":4
6923  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6924  * def __setstate_cython__(self, __pyx_state):
6925  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
6926  */
6927   __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4, __pyx_L1_error)
6928   __Pyx_GOTREF(__pyx_tuple__2);
6929   __Pyx_GIVEREF(__pyx_tuple__2);
6930 
6931   /* "gssapi/raw/sec_contexts.pyx":112
6932  *
6933  * # TODO(directxman12): figure out whether GSS_C_NO_NAME can be passed in here
6934  * def init_sec_context(Name target_name not None, Creds creds=None,             # <<<<<<<<<<<<<<
6935  *                      SecurityContext context=None,
6936  *                      OID mech=None,
6937  */
6938   __pyx_tuple__3 = PyTuple_Pack(24, __pyx_n_s_target_name, __pyx_n_s_creds, __pyx_n_s_context, __pyx_n_s_mech, __pyx_n_s_flags, __pyx_n_s_lifetime, __pyx_n_s_channel_bindings, __pyx_n_s_input_token, __pyx_n_s_mech_oid, __pyx_n_s_req_flags, __pyx_n_s_bdng, __pyx_n_s_input_token_buffer, __pyx_n_s_input_ttl, __pyx_n_s_output_context, __pyx_n_s_act_cred, __pyx_n_s_actual_mech_type, __pyx_n_s_output_token_buffer, __pyx_n_s_ret_flags, __pyx_n_s_output_ttl, __pyx_n_s_maj_stat, __pyx_n_s_min_stat, __pyx_n_s_output_token, __pyx_n_s_tmp_min_stat, __pyx_n_s_output_mech_type); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 112, __pyx_L1_error)
6939   __Pyx_GOTREF(__pyx_tuple__3);
6940   __Pyx_GIVEREF(__pyx_tuple__3);
6941   __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(8, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gssapi_raw_sec_contexts_pyx, __pyx_n_s_init_sec_context, 112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(1, 112, __pyx_L1_error)
6942 
6943   /* "gssapi/raw/sec_contexts.pyx":248
6944  *
6945  *
6946  * def accept_sec_context(input_token not None, Creds acceptor_creds=None,             # <<<<<<<<<<<<<<
6947  *                        SecurityContext context=None,
6948  *                        ChannelBindings channel_bindings=None):
6949  */
6950   __pyx_tuple__5 = PyTuple_Pack(22, __pyx_n_s_input_token, __pyx_n_s_acceptor_creds, __pyx_n_s_context, __pyx_n_s_channel_bindings, __pyx_n_s_bdng, __pyx_n_s_input_token_buffer, __pyx_n_s_output_context, __pyx_n_s_act_acceptor_cred, __pyx_n_s_initiator_name, __pyx_n_s_mech_type, __pyx_n_s_output_token_buffer, __pyx_n_s_ret_flags, __pyx_n_s_output_ttl, __pyx_n_s_delegated_cred, __pyx_n_s_maj_stat, __pyx_n_s_min_stat, __pyx_n_s_output_token, __pyx_n_s_tmp_min_stat, __pyx_n_s_on, __pyx_n_s_oc, __pyx_n_s_py_mech_type, __pyx_n_s_output_ttl_py); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 248, __pyx_L1_error)
6951   __Pyx_GOTREF(__pyx_tuple__5);
6952   __Pyx_GIVEREF(__pyx_tuple__5);
6953   __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(4, 0, 22, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gssapi_raw_sec_contexts_pyx, __pyx_n_s_accept_sec_context, 248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(1, 248, __pyx_L1_error)
6954 
6955   /* "gssapi/raw/sec_contexts.pyx":373
6956  *
6957  *
6958  * def inquire_context(SecurityContext context not None, initiator_name=True,             # <<<<<<<<<<<<<<
6959  *                     target_name=True, lifetime=True, mech=True,
6960  *                     flags=True, locally_init=True, complete=True):
6961  */
6962   __pyx_tuple__7 = PyTuple_Pack(31, __pyx_n_s_context, __pyx_n_s_initiator_name, __pyx_n_s_target_name, __pyx_n_s_lifetime, __pyx_n_s_mech, __pyx_n_s_flags, __pyx_n_s_locally_init, __pyx_n_s_complete, __pyx_n_s_output_init_name, __pyx_n_s_init_name_ptr, __pyx_n_s_output_target_name, __pyx_n_s_target_name_ptr, __pyx_n_s_ttl, __pyx_n_s_ttl_ptr, __pyx_n_s_output_mech_type, __pyx_n_s_mech_type_ptr, __pyx_n_s_output_flags, __pyx_n_s_flags_ptr, __pyx_n_s_output_locally_init, __pyx_n_s_locally_init_ptr, __pyx_n_s_is_complete, __pyx_n_s_is_complete_ptr, __pyx_n_s_maj_stat, __pyx_n_s_min_stat, __pyx_n_s_sn, __pyx_n_s_py_mech_type, __pyx_n_s_tn, __pyx_n_s_py_ttl, __pyx_n_s_py_flags, __pyx_n_s_py_locally_init, __pyx_n_s_py_complete); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 373, __pyx_L1_error)
6963   __Pyx_GOTREF(__pyx_tuple__7);
6964   __Pyx_GIVEREF(__pyx_tuple__7);
6965   __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(8, 0, 31, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gssapi_raw_sec_contexts_pyx, __pyx_n_s_inquire_context, 373, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 373, __pyx_L1_error)
6966 
6967   /* "gssapi/raw/sec_contexts.pyx":491
6968  *
6969  *
6970  * def context_time(SecurityContext context not None):             # <<<<<<<<<<<<<<
6971  *     """
6972  *     context_time(context)
6973  */
6974   __pyx_tuple__9 = PyTuple_Pack(4, __pyx_n_s_context, __pyx_n_s_ttl, __pyx_n_s_maj_stat, __pyx_n_s_min_stat); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 491, __pyx_L1_error)
6975   __Pyx_GOTREF(__pyx_tuple__9);
6976   __Pyx_GIVEREF(__pyx_tuple__9);
6977   __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gssapi_raw_sec_contexts_pyx, __pyx_n_s_context_time, 491, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 491, __pyx_L1_error)
6978 
6979   /* "gssapi/raw/sec_contexts.pyx":523
6980  *
6981  *
6982  * def process_context_token(SecurityContext context not None, token):             # <<<<<<<<<<<<<<
6983  *     """
6984  *     process_context_token(context, token)
6985  */
6986   __pyx_tuple__11 = PyTuple_Pack(5, __pyx_n_s_context, __pyx_n_s_token, __pyx_n_s_token_buffer, __pyx_n_s_maj_stat, __pyx_n_s_min_stat); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 523, __pyx_L1_error)
6987   __Pyx_GOTREF(__pyx_tuple__11);
6988   __Pyx_GIVEREF(__pyx_tuple__11);
6989   __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gssapi_raw_sec_contexts_pyx, __pyx_n_s_process_context_token, 523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 523, __pyx_L1_error)
6990 
6991   /* "gssapi/raw/sec_contexts.pyx":560
6992  *
6993  *
6994  * def import_sec_context(token not None):             # <<<<<<<<<<<<<<
6995  *     """
6996  *     import_sec_context(token)
6997  */
6998   __pyx_tuple__13 = PyTuple_Pack(6, __pyx_n_s_token, __pyx_n_s_token_buffer, __pyx_n_s_ctx, __pyx_n_s_maj_stat, __pyx_n_s_min_stat, __pyx_n_s_res); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 560, __pyx_L1_error)
6999   __Pyx_GOTREF(__pyx_tuple__13);
7000   __Pyx_GIVEREF(__pyx_tuple__13);
7001   __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gssapi_raw_sec_contexts_pyx, __pyx_n_s_import_sec_context, 560, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 560, __pyx_L1_error)
7002 
7003   /* "gssapi/raw/sec_contexts.pyx":593
7004  *
7005  *
7006  * def export_sec_context(SecurityContext context not None):             # <<<<<<<<<<<<<<
7007  *     """
7008  *     export_sec_context(context)
7009  */
7010   __pyx_tuple__15 = PyTuple_Pack(5, __pyx_n_s_context, __pyx_n_s_output_token, __pyx_n_s_maj_stat, __pyx_n_s_min_stat, __pyx_n_s_res_token); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 593, __pyx_L1_error)
7011   __Pyx_GOTREF(__pyx_tuple__15);
7012   __Pyx_GIVEREF(__pyx_tuple__15);
7013   __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gssapi_raw_sec_contexts_pyx, __pyx_n_s_export_sec_context, 593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 593, __pyx_L1_error)
7014 
7015   /* "gssapi/raw/sec_contexts.pyx":632
7016  *
7017  *
7018  * def delete_sec_context(SecurityContext context not None, local_only=True):             # <<<<<<<<<<<<<<
7019  *     """
7020  *     delete_sec_context(context, local_only=True)
7021  */
7022   __pyx_tuple__17 = PyTuple_Pack(6, __pyx_n_s_context, __pyx_n_s_local_only, __pyx_n_s_maj_stat, __pyx_n_s_min_stat, __pyx_n_s_output_token, __pyx_n_s_res); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 632, __pyx_L1_error)
7023   __Pyx_GOTREF(__pyx_tuple__17);
7024   __Pyx_GIVEREF(__pyx_tuple__17);
7025   __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gssapi_raw_sec_contexts_pyx, __pyx_n_s_delete_sec_context, 632, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 632, __pyx_L1_error)
7026   __Pyx_RefNannyFinishContext();
7027   return 0;
7028   __pyx_L1_error:;
7029   __Pyx_RefNannyFinishContext();
7030   return -1;
7031 }
7032 
__Pyx_InitGlobals(void)7033 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
7034   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
7035   return 0;
7036   __pyx_L1_error:;
7037   return -1;
7038 }
7039 
7040 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
7041 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
7042 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
7043 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
7044 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
7045 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
7046 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
7047 
__Pyx_modinit_global_init_code(void)7048 static int __Pyx_modinit_global_init_code(void) {
7049   __Pyx_RefNannyDeclarations
7050   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
7051   /*--- Global init code ---*/
7052   __Pyx_RefNannyFinishContext();
7053   return 0;
7054 }
7055 
__Pyx_modinit_variable_export_code(void)7056 static int __Pyx_modinit_variable_export_code(void) {
7057   __Pyx_RefNannyDeclarations
7058   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
7059   /*--- Variable export code ---*/
7060   __Pyx_RefNannyFinishContext();
7061   return 0;
7062 }
7063 
__Pyx_modinit_function_export_code(void)7064 static int __Pyx_modinit_function_export_code(void) {
7065   __Pyx_RefNannyDeclarations
7066   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
7067   /*--- Function export code ---*/
7068   __Pyx_RefNannyFinishContext();
7069   return 0;
7070 }
7071 
__Pyx_modinit_type_init_code(void)7072 static int __Pyx_modinit_type_init_code(void) {
7073   __Pyx_RefNannyDeclarations
7074   int __pyx_lineno = 0;
7075   const char *__pyx_filename = NULL;
7076   int __pyx_clineno = 0;
7077   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
7078   /*--- Type init code ---*/
7079   if (PyType_Ready(&__pyx_type_6gssapi_3raw_12sec_contexts_SecurityContext) < 0) __PYX_ERR(1, 77, __pyx_L1_error)
7080   #if PY_VERSION_HEX < 0x030800B1
7081   __pyx_type_6gssapi_3raw_12sec_contexts_SecurityContext.tp_print = 0;
7082   #endif
7083   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gssapi_3raw_12sec_contexts_SecurityContext.tp_dictoffset && __pyx_type_6gssapi_3raw_12sec_contexts_SecurityContext.tp_getattro == PyObject_GenericGetAttr)) {
7084     __pyx_type_6gssapi_3raw_12sec_contexts_SecurityContext.tp_getattro = __Pyx_PyObject_GenericGetAttr;
7085   }
7086   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SecurityContext, (PyObject *)&__pyx_type_6gssapi_3raw_12sec_contexts_SecurityContext) < 0) __PYX_ERR(1, 77, __pyx_L1_error)
7087   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6gssapi_3raw_12sec_contexts_SecurityContext) < 0) __PYX_ERR(1, 77, __pyx_L1_error)
7088   __pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext = &__pyx_type_6gssapi_3raw_12sec_contexts_SecurityContext;
7089   __Pyx_RefNannyFinishContext();
7090   return 0;
7091   __pyx_L1_error:;
7092   __Pyx_RefNannyFinishContext();
7093   return -1;
7094 }
7095 
__Pyx_modinit_type_import_code(void)7096 static int __Pyx_modinit_type_import_code(void) {
7097   __Pyx_RefNannyDeclarations
7098   PyObject *__pyx_t_1 = NULL;
7099   int __pyx_lineno = 0;
7100   const char *__pyx_filename = NULL;
7101   int __pyx_clineno = 0;
7102   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
7103   /*--- Type import code ---*/
7104   __pyx_t_1 = PyImport_ImportModule("gssapi.raw.oids"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4, __pyx_L1_error)
7105   __Pyx_GOTREF(__pyx_t_1);
7106   __pyx_ptype_6gssapi_3raw_4oids_OID = __Pyx_ImportType(__pyx_t_1, "gssapi.raw.oids", "OID", sizeof(struct __pyx_obj_6gssapi_3raw_4oids_OID), __Pyx_ImportType_CheckSize_Warn);
7107    if (!__pyx_ptype_6gssapi_3raw_4oids_OID) __PYX_ERR(3, 4, __pyx_L1_error)
7108   __pyx_vtabptr_6gssapi_3raw_4oids_OID = (struct __pyx_vtabstruct_6gssapi_3raw_4oids_OID*)__Pyx_GetVtable(__pyx_ptype_6gssapi_3raw_4oids_OID->tp_dict); if (unlikely(!__pyx_vtabptr_6gssapi_3raw_4oids_OID)) __PYX_ERR(3, 4, __pyx_L1_error)
7109   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7110   __pyx_t_1 = PyImport_ImportModule("gssapi.raw.creds"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
7111   __Pyx_GOTREF(__pyx_t_1);
7112   __pyx_ptype_6gssapi_3raw_5creds_Creds = __Pyx_ImportType(__pyx_t_1, "gssapi.raw.creds", "Creds", sizeof(struct __pyx_obj_6gssapi_3raw_5creds_Creds), __Pyx_ImportType_CheckSize_Warn);
7113    if (!__pyx_ptype_6gssapi_3raw_5creds_Creds) __PYX_ERR(4, 4, __pyx_L1_error)
7114   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7115   __pyx_t_1 = PyImport_ImportModule("gssapi.raw.names"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 3, __pyx_L1_error)
7116   __Pyx_GOTREF(__pyx_t_1);
7117   __pyx_ptype_6gssapi_3raw_5names_Name = __Pyx_ImportType(__pyx_t_1, "gssapi.raw.names", "Name", sizeof(struct __pyx_obj_6gssapi_3raw_5names_Name), __Pyx_ImportType_CheckSize_Warn);
7118    if (!__pyx_ptype_6gssapi_3raw_5names_Name) __PYX_ERR(5, 3, __pyx_L1_error)
7119   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7120   __pyx_t_1 = PyImport_ImportModule("gssapi.raw.chan_bindings"); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 5, __pyx_L1_error)
7121   __Pyx_GOTREF(__pyx_t_1);
7122   __pyx_ptype_6gssapi_3raw_13chan_bindings_ChannelBindings = __Pyx_ImportType(__pyx_t_1, "gssapi.raw.chan_bindings", "ChannelBindings", sizeof(struct __pyx_obj_6gssapi_3raw_13chan_bindings_ChannelBindings), __Pyx_ImportType_CheckSize_Warn);
7123    if (!__pyx_ptype_6gssapi_3raw_13chan_bindings_ChannelBindings) __PYX_ERR(6, 5, __pyx_L1_error)
7124   __pyx_vtabptr_6gssapi_3raw_13chan_bindings_ChannelBindings = (struct __pyx_vtabstruct_6gssapi_3raw_13chan_bindings_ChannelBindings*)__Pyx_GetVtable(__pyx_ptype_6gssapi_3raw_13chan_bindings_ChannelBindings->tp_dict); if (unlikely(!__pyx_vtabptr_6gssapi_3raw_13chan_bindings_ChannelBindings)) __PYX_ERR(6, 5, __pyx_L1_error)
7125   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7126   __Pyx_RefNannyFinishContext();
7127   return 0;
7128   __pyx_L1_error:;
7129   __Pyx_XDECREF(__pyx_t_1);
7130   __Pyx_RefNannyFinishContext();
7131   return -1;
7132 }
7133 
__Pyx_modinit_variable_import_code(void)7134 static int __Pyx_modinit_variable_import_code(void) {
7135   __Pyx_RefNannyDeclarations
7136   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
7137   /*--- Variable import code ---*/
7138   __Pyx_RefNannyFinishContext();
7139   return 0;
7140 }
7141 
__Pyx_modinit_function_import_code(void)7142 static int __Pyx_modinit_function_import_code(void) {
7143   __Pyx_RefNannyDeclarations
7144   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
7145   /*--- Function import code ---*/
7146   __Pyx_RefNannyFinishContext();
7147   return 0;
7148 }
7149 
7150 
7151 #ifndef CYTHON_NO_PYINIT_EXPORT
7152 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
7153 #elif PY_MAJOR_VERSION < 3
7154 #ifdef __cplusplus
7155 #define __Pyx_PyMODINIT_FUNC extern "C" void
7156 #else
7157 #define __Pyx_PyMODINIT_FUNC void
7158 #endif
7159 #else
7160 #ifdef __cplusplus
7161 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
7162 #else
7163 #define __Pyx_PyMODINIT_FUNC PyObject *
7164 #endif
7165 #endif
7166 
7167 
7168 #if PY_MAJOR_VERSION < 3
7169 __Pyx_PyMODINIT_FUNC initsec_contexts(void) CYTHON_SMALL_CODE; /*proto*/
initsec_contexts(void)7170 __Pyx_PyMODINIT_FUNC initsec_contexts(void)
7171 #else
7172 __Pyx_PyMODINIT_FUNC PyInit_sec_contexts(void) CYTHON_SMALL_CODE; /*proto*/
7173 __Pyx_PyMODINIT_FUNC PyInit_sec_contexts(void)
7174 #if CYTHON_PEP489_MULTI_PHASE_INIT
7175 {
7176   return PyModuleDef_Init(&__pyx_moduledef);
7177 }
7178 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
7179     #if PY_VERSION_HEX >= 0x030700A1
7180     static PY_INT64_T main_interpreter_id = -1;
7181     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
7182     if (main_interpreter_id == -1) {
7183         main_interpreter_id = current_id;
7184         return (unlikely(current_id == -1)) ? -1 : 0;
7185     } else if (unlikely(main_interpreter_id != current_id))
7186     #else
7187     static PyInterpreterState *main_interpreter = NULL;
7188     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
7189     if (!main_interpreter) {
7190         main_interpreter = current_interpreter;
7191     } else if (unlikely(main_interpreter != current_interpreter))
7192     #endif
7193     {
7194         PyErr_SetString(
7195             PyExc_ImportError,
7196             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
7197         return -1;
7198     }
7199     return 0;
7200 }
7201 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
7202     PyObject *value = PyObject_GetAttrString(spec, from_name);
7203     int result = 0;
7204     if (likely(value)) {
7205         if (allow_none || value != Py_None) {
7206             result = PyDict_SetItemString(moddict, to_name, value);
7207         }
7208         Py_DECREF(value);
7209     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
7210         PyErr_Clear();
7211     } else {
7212         result = -1;
7213     }
7214     return result;
7215 }
7216 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
7217     PyObject *module = NULL, *moddict, *modname;
7218     if (__Pyx_check_single_interpreter())
7219         return NULL;
7220     if (__pyx_m)
7221         return __Pyx_NewRef(__pyx_m);
7222     modname = PyObject_GetAttrString(spec, "name");
7223     if (unlikely(!modname)) goto bad;
7224     module = PyModule_NewObject(modname);
7225     Py_DECREF(modname);
7226     if (unlikely(!module)) goto bad;
7227     moddict = PyModule_GetDict(module);
7228     if (unlikely(!moddict)) goto bad;
7229     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
7230     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
7231     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
7232     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
7233     return module;
7234 bad:
7235     Py_XDECREF(module);
7236     return NULL;
7237 }
7238 
7239 
7240 static CYTHON_SMALL_CODE int __pyx_pymod_exec_sec_contexts(PyObject *__pyx_pyinit_module)
7241 #endif
7242 #endif
7243 {
7244   PyObject *__pyx_t_1 = NULL;
7245   PyObject *__pyx_t_2 = NULL;
7246   int __pyx_lineno = 0;
7247   const char *__pyx_filename = NULL;
7248   int __pyx_clineno = 0;
7249   __Pyx_RefNannyDeclarations
7250   #if CYTHON_PEP489_MULTI_PHASE_INIT
7251   if (__pyx_m) {
7252     if (__pyx_m == __pyx_pyinit_module) return 0;
7253     PyErr_SetString(PyExc_RuntimeError, "Module 'sec_contexts' has already been imported. Re-initialisation is not supported.");
7254     return -1;
7255   }
7256   #elif PY_MAJOR_VERSION >= 3
7257   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
7258   #endif
7259   #if CYTHON_REFNANNY
7260 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
7261 if (!__Pyx_RefNanny) {
7262   PyErr_Clear();
7263   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
7264   if (!__Pyx_RefNanny)
7265       Py_FatalError("failed to import 'refnanny' module");
7266 }
7267 #endif
7268   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_sec_contexts(void)", 0);
7269   if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
7270   #ifdef __Pxy_PyFrame_Initialize_Offsets
7271   __Pxy_PyFrame_Initialize_Offsets();
7272   #endif
7273   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
7274   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
7275   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
7276   #ifdef __Pyx_CyFunction_USED
7277   if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
7278   #endif
7279   #ifdef __Pyx_FusedFunction_USED
7280   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
7281   #endif
7282   #ifdef __Pyx_Coroutine_USED
7283   if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
7284   #endif
7285   #ifdef __Pyx_Generator_USED
7286   if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
7287   #endif
7288   #ifdef __Pyx_AsyncGen_USED
7289   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
7290   #endif
7291   #ifdef __Pyx_StopAsyncIteration_USED
7292   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
7293   #endif
7294   /*--- Library function declarations ---*/
7295   /*--- Threads initialization code ---*/
7296   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
7297   #ifdef WITH_THREAD /* Python build with threading support? */
7298   PyEval_InitThreads();
7299   #endif
7300   #endif
7301   /*--- Module creation code ---*/
7302   #if CYTHON_PEP489_MULTI_PHASE_INIT
7303   __pyx_m = __pyx_pyinit_module;
7304   Py_INCREF(__pyx_m);
7305   #else
7306   #if PY_MAJOR_VERSION < 3
7307   __pyx_m = Py_InitModule4("sec_contexts", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
7308   #else
7309   __pyx_m = PyModule_Create(&__pyx_moduledef);
7310   #endif
7311   if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
7312   #endif
7313   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
7314   Py_INCREF(__pyx_d);
7315   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
7316   Py_INCREF(__pyx_b);
7317   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
7318   Py_INCREF(__pyx_cython_runtime);
7319   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
7320   /*--- Initialize various global constants etc. ---*/
7321   if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
7322   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
7323   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
7324   #endif
7325   if (__pyx_module_is_main_gssapi__raw__sec_contexts) {
7326     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
7327   }
7328   #if PY_MAJOR_VERSION >= 3
7329   {
7330     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
7331     if (!PyDict_GetItemString(modules, "gssapi.raw.sec_contexts")) {
7332       if (unlikely(PyDict_SetItemString(modules, "gssapi.raw.sec_contexts", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
7333     }
7334   }
7335   #endif
7336   /*--- Builtin init code ---*/
7337   if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
7338   /*--- Constants init code ---*/
7339   if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
7340   /*--- Global type/function init code ---*/
7341   (void)__Pyx_modinit_global_init_code();
7342   (void)__Pyx_modinit_variable_export_code();
7343   (void)__Pyx_modinit_function_export_code();
7344   if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
7345   if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
7346   (void)__Pyx_modinit_variable_import_code();
7347   (void)__Pyx_modinit_function_import_code();
7348   /*--- Execution code ---*/
7349   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
7350   if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
7351   #endif
7352 
7353   /* "gssapi/raw/sec_contexts.pyx":1
7354  * GSSAPI="BASE"  # This ensures that a full module is generated by Cython             # <<<<<<<<<<<<<<
7355  *
7356  * from libc.stdlib cimport free
7357  */
7358   if (PyDict_SetItem(__pyx_d, __pyx_n_s_GSSAPI, __pyx_n_s_BASE) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
7359 
7360   /* "gssapi/raw/sec_contexts.pyx":12
7361  * from gssapi.raw.chan_bindings cimport ChannelBindings
7362  *
7363  * from gssapi.raw.types import MechType, RequirementFlag, IntEnumFlagSet             # <<<<<<<<<<<<<<
7364  * from gssapi.raw.misc import GSSError
7365  * from gssapi.raw.named_tuples import AcceptSecContextResult
7366  */
7367   __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
7368   __Pyx_GOTREF(__pyx_t_1);
7369   __Pyx_INCREF(__pyx_n_s_MechType);
7370   __Pyx_GIVEREF(__pyx_n_s_MechType);
7371   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_MechType);
7372   __Pyx_INCREF(__pyx_n_s_RequirementFlag);
7373   __Pyx_GIVEREF(__pyx_n_s_RequirementFlag);
7374   PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_RequirementFlag);
7375   __Pyx_INCREF(__pyx_n_s_IntEnumFlagSet);
7376   __Pyx_GIVEREF(__pyx_n_s_IntEnumFlagSet);
7377   PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_IntEnumFlagSet);
7378   __pyx_t_2 = __Pyx_Import(__pyx_n_s_gssapi_raw_types, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error)
7379   __Pyx_GOTREF(__pyx_t_2);
7380   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7381   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MechType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
7382   __Pyx_GOTREF(__pyx_t_1);
7383   if (PyDict_SetItem(__pyx_d, __pyx_n_s_MechType, __pyx_t_1) < 0) __PYX_ERR(1, 12, __pyx_L1_error)
7384   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7385   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_RequirementFlag); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
7386   __Pyx_GOTREF(__pyx_t_1);
7387   if (PyDict_SetItem(__pyx_d, __pyx_n_s_RequirementFlag, __pyx_t_1) < 0) __PYX_ERR(1, 12, __pyx_L1_error)
7388   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7389   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_IntEnumFlagSet); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
7390   __Pyx_GOTREF(__pyx_t_1);
7391   if (PyDict_SetItem(__pyx_d, __pyx_n_s_IntEnumFlagSet, __pyx_t_1) < 0) __PYX_ERR(1, 12, __pyx_L1_error)
7392   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7393   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7394 
7395   /* "gssapi/raw/sec_contexts.pyx":13
7396  *
7397  * from gssapi.raw.types import MechType, RequirementFlag, IntEnumFlagSet
7398  * from gssapi.raw.misc import GSSError             # <<<<<<<<<<<<<<
7399  * from gssapi.raw.named_tuples import AcceptSecContextResult
7400  * from gssapi.raw.named_tuples import InitSecContextResult
7401  */
7402   __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
7403   __Pyx_GOTREF(__pyx_t_2);
7404   __Pyx_INCREF(__pyx_n_s_GSSError);
7405   __Pyx_GIVEREF(__pyx_n_s_GSSError);
7406   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_GSSError);
7407   __pyx_t_1 = __Pyx_Import(__pyx_n_s_gssapi_raw_misc, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
7408   __Pyx_GOTREF(__pyx_t_1);
7409   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7410   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_GSSError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
7411   __Pyx_GOTREF(__pyx_t_2);
7412   if (PyDict_SetItem(__pyx_d, __pyx_n_s_GSSError, __pyx_t_2) < 0) __PYX_ERR(1, 13, __pyx_L1_error)
7413   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7414   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7415 
7416   /* "gssapi/raw/sec_contexts.pyx":14
7417  * from gssapi.raw.types import MechType, RequirementFlag, IntEnumFlagSet
7418  * from gssapi.raw.misc import GSSError
7419  * from gssapi.raw.named_tuples import AcceptSecContextResult             # <<<<<<<<<<<<<<
7420  * from gssapi.raw.named_tuples import InitSecContextResult
7421  * from gssapi.raw.named_tuples import InquireContextResult
7422  */
7423   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
7424   __Pyx_GOTREF(__pyx_t_1);
7425   __Pyx_INCREF(__pyx_n_s_AcceptSecContextResult);
7426   __Pyx_GIVEREF(__pyx_n_s_AcceptSecContextResult);
7427   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_AcceptSecContextResult);
7428   __pyx_t_2 = __Pyx_Import(__pyx_n_s_gssapi_raw_named_tuples, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error)
7429   __Pyx_GOTREF(__pyx_t_2);
7430   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7431   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_AcceptSecContextResult); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
7432   __Pyx_GOTREF(__pyx_t_1);
7433   if (PyDict_SetItem(__pyx_d, __pyx_n_s_AcceptSecContextResult, __pyx_t_1) < 0) __PYX_ERR(1, 14, __pyx_L1_error)
7434   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7435   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7436 
7437   /* "gssapi/raw/sec_contexts.pyx":15
7438  * from gssapi.raw.misc import GSSError
7439  * from gssapi.raw.named_tuples import AcceptSecContextResult
7440  * from gssapi.raw.named_tuples import InitSecContextResult             # <<<<<<<<<<<<<<
7441  * from gssapi.raw.named_tuples import InquireContextResult
7442  *
7443  */
7444   __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
7445   __Pyx_GOTREF(__pyx_t_2);
7446   __Pyx_INCREF(__pyx_n_s_InitSecContextResult);
7447   __Pyx_GIVEREF(__pyx_n_s_InitSecContextResult);
7448   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InitSecContextResult);
7449   __pyx_t_1 = __Pyx_Import(__pyx_n_s_gssapi_raw_named_tuples, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
7450   __Pyx_GOTREF(__pyx_t_1);
7451   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7452   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InitSecContextResult); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
7453   __Pyx_GOTREF(__pyx_t_2);
7454   if (PyDict_SetItem(__pyx_d, __pyx_n_s_InitSecContextResult, __pyx_t_2) < 0) __PYX_ERR(1, 15, __pyx_L1_error)
7455   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7456   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7457 
7458   /* "gssapi/raw/sec_contexts.pyx":16
7459  * from gssapi.raw.named_tuples import AcceptSecContextResult
7460  * from gssapi.raw.named_tuples import InitSecContextResult
7461  * from gssapi.raw.named_tuples import InquireContextResult             # <<<<<<<<<<<<<<
7462  *
7463  *
7464  */
7465   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
7466   __Pyx_GOTREF(__pyx_t_1);
7467   __Pyx_INCREF(__pyx_n_s_InquireContextResult);
7468   __Pyx_GIVEREF(__pyx_n_s_InquireContextResult);
7469   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_InquireContextResult);
7470   __pyx_t_2 = __Pyx_Import(__pyx_n_s_gssapi_raw_named_tuples, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
7471   __Pyx_GOTREF(__pyx_t_2);
7472   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7473   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_InquireContextResult); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
7474   __Pyx_GOTREF(__pyx_t_1);
7475   if (PyDict_SetItem(__pyx_d, __pyx_n_s_InquireContextResult, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
7476   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7477   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7478 
7479   /* "gssapi/raw/sec_contexts.pyx":112
7480  *
7481  * # TODO(directxman12): figure out whether GSS_C_NO_NAME can be passed in here
7482  * def init_sec_context(Name target_name not None, Creds creds=None,             # <<<<<<<<<<<<<<
7483  *                      SecurityContext context=None,
7484  *                      OID mech=None,
7485  */
7486   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gssapi_3raw_12sec_contexts_1init_sec_context, NULL, __pyx_n_s_gssapi_raw_sec_contexts); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 112, __pyx_L1_error)
7487   __Pyx_GOTREF(__pyx_t_2);
7488   if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_sec_context, __pyx_t_2) < 0) __PYX_ERR(1, 112, __pyx_L1_error)
7489   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7490 
7491   /* "gssapi/raw/sec_contexts.pyx":248
7492  *
7493  *
7494  * def accept_sec_context(input_token not None, Creds acceptor_creds=None,             # <<<<<<<<<<<<<<
7495  *                        SecurityContext context=None,
7496  *                        ChannelBindings channel_bindings=None):
7497  */
7498   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gssapi_3raw_12sec_contexts_3accept_sec_context, NULL, __pyx_n_s_gssapi_raw_sec_contexts); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 248, __pyx_L1_error)
7499   __Pyx_GOTREF(__pyx_t_2);
7500   if (PyDict_SetItem(__pyx_d, __pyx_n_s_accept_sec_context, __pyx_t_2) < 0) __PYX_ERR(1, 248, __pyx_L1_error)
7501   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7502 
7503   /* "gssapi/raw/sec_contexts.pyx":373
7504  *
7505  *
7506  * def inquire_context(SecurityContext context not None, initiator_name=True,             # <<<<<<<<<<<<<<
7507  *                     target_name=True, lifetime=True, mech=True,
7508  *                     flags=True, locally_init=True, complete=True):
7509  */
7510   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gssapi_3raw_12sec_contexts_5inquire_context, NULL, __pyx_n_s_gssapi_raw_sec_contexts); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 373, __pyx_L1_error)
7511   __Pyx_GOTREF(__pyx_t_2);
7512   if (PyDict_SetItem(__pyx_d, __pyx_n_s_inquire_context, __pyx_t_2) < 0) __PYX_ERR(1, 373, __pyx_L1_error)
7513   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7514 
7515   /* "gssapi/raw/sec_contexts.pyx":491
7516  *
7517  *
7518  * def context_time(SecurityContext context not None):             # <<<<<<<<<<<<<<
7519  *     """
7520  *     context_time(context)
7521  */
7522   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gssapi_3raw_12sec_contexts_7context_time, NULL, __pyx_n_s_gssapi_raw_sec_contexts); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 491, __pyx_L1_error)
7523   __Pyx_GOTREF(__pyx_t_2);
7524   if (PyDict_SetItem(__pyx_d, __pyx_n_s_context_time, __pyx_t_2) < 0) __PYX_ERR(1, 491, __pyx_L1_error)
7525   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7526 
7527   /* "gssapi/raw/sec_contexts.pyx":523
7528  *
7529  *
7530  * def process_context_token(SecurityContext context not None, token):             # <<<<<<<<<<<<<<
7531  *     """
7532  *     process_context_token(context, token)
7533  */
7534   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gssapi_3raw_12sec_contexts_9process_context_token, NULL, __pyx_n_s_gssapi_raw_sec_contexts); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 523, __pyx_L1_error)
7535   __Pyx_GOTREF(__pyx_t_2);
7536   if (PyDict_SetItem(__pyx_d, __pyx_n_s_process_context_token, __pyx_t_2) < 0) __PYX_ERR(1, 523, __pyx_L1_error)
7537   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7538 
7539   /* "gssapi/raw/sec_contexts.pyx":560
7540  *
7541  *
7542  * def import_sec_context(token not None):             # <<<<<<<<<<<<<<
7543  *     """
7544  *     import_sec_context(token)
7545  */
7546   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gssapi_3raw_12sec_contexts_11import_sec_context, NULL, __pyx_n_s_gssapi_raw_sec_contexts); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 560, __pyx_L1_error)
7547   __Pyx_GOTREF(__pyx_t_2);
7548   if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_sec_context, __pyx_t_2) < 0) __PYX_ERR(1, 560, __pyx_L1_error)
7549   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7550 
7551   /* "gssapi/raw/sec_contexts.pyx":593
7552  *
7553  *
7554  * def export_sec_context(SecurityContext context not None):             # <<<<<<<<<<<<<<
7555  *     """
7556  *     export_sec_context(context)
7557  */
7558   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gssapi_3raw_12sec_contexts_13export_sec_context, NULL, __pyx_n_s_gssapi_raw_sec_contexts); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 593, __pyx_L1_error)
7559   __Pyx_GOTREF(__pyx_t_2);
7560   if (PyDict_SetItem(__pyx_d, __pyx_n_s_export_sec_context, __pyx_t_2) < 0) __PYX_ERR(1, 593, __pyx_L1_error)
7561   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7562 
7563   /* "gssapi/raw/sec_contexts.pyx":632
7564  *
7565  *
7566  * def delete_sec_context(SecurityContext context not None, local_only=True):             # <<<<<<<<<<<<<<
7567  *     """
7568  *     delete_sec_context(context, local_only=True)
7569  */
7570   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gssapi_3raw_12sec_contexts_15delete_sec_context, NULL, __pyx_n_s_gssapi_raw_sec_contexts); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 632, __pyx_L1_error)
7571   __Pyx_GOTREF(__pyx_t_2);
7572   if (PyDict_SetItem(__pyx_d, __pyx_n_s_delete_sec_context, __pyx_t_2) < 0) __PYX_ERR(1, 632, __pyx_L1_error)
7573   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7574 
7575   /* "gssapi/raw/sec_contexts.pyx":1
7576  * GSSAPI="BASE"  # This ensures that a full module is generated by Cython             # <<<<<<<<<<<<<<
7577  *
7578  * from libc.stdlib cimport free
7579  */
7580   __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
7581   __Pyx_GOTREF(__pyx_t_2);
7582   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
7583   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7584 
7585   /* "gssapi/raw/cython_converters.pxd":32
7586  *
7587  *
7588  * cdef inline bint c_compare_oids(gss_OID a, gss_OID b):             # <<<<<<<<<<<<<<
7589  *     """Compare two OIDs to see if they are the same."""
7590  *
7591  */
7592 
7593   /*--- Wrapped vars code ---*/
7594 
7595   goto __pyx_L0;
7596   __pyx_L1_error:;
7597   __Pyx_XDECREF(__pyx_t_1);
7598   __Pyx_XDECREF(__pyx_t_2);
7599   if (__pyx_m) {
7600     if (__pyx_d) {
7601       __Pyx_AddTraceback("init gssapi.raw.sec_contexts", __pyx_clineno, __pyx_lineno, __pyx_filename);
7602     }
7603     Py_CLEAR(__pyx_m);
7604   } else if (!PyErr_Occurred()) {
7605     PyErr_SetString(PyExc_ImportError, "init gssapi.raw.sec_contexts");
7606   }
7607   __pyx_L0:;
7608   __Pyx_RefNannyFinishContext();
7609   #if CYTHON_PEP489_MULTI_PHASE_INIT
7610   return (__pyx_m != NULL) ? 0 : -1;
7611   #elif PY_MAJOR_VERSION >= 3
7612   return __pyx_m;
7613   #else
7614   return;
7615   #endif
7616 }
7617 
7618 /* --- Runtime support code --- */
7619 /* Refnanny */
7620 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)7621 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
7622     PyObject *m = NULL, *p = NULL;
7623     void *r = NULL;
7624     m = PyImport_ImportModule(modname);
7625     if (!m) goto end;
7626     p = PyObject_GetAttrString(m, "RefNannyAPI");
7627     if (!p) goto end;
7628     r = PyLong_AsVoidPtr(p);
7629 end:
7630     Py_XDECREF(p);
7631     Py_XDECREF(m);
7632     return (__Pyx_RefNannyAPIStruct *)r;
7633 }
7634 #endif
7635 
7636 /* PyObjectGetAttrStr */
7637 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)7638 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
7639     PyTypeObject* tp = Py_TYPE(obj);
7640     if (likely(tp->tp_getattro))
7641         return tp->tp_getattro(obj, attr_name);
7642 #if PY_MAJOR_VERSION < 3
7643     if (likely(tp->tp_getattr))
7644         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
7645 #endif
7646     return PyObject_GetAttr(obj, attr_name);
7647 }
7648 #endif
7649 
7650 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)7651 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
7652     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
7653     if (unlikely(!result)) {
7654         PyErr_Format(PyExc_NameError,
7655 #if PY_MAJOR_VERSION >= 3
7656             "name '%U' is not defined", name);
7657 #else
7658             "name '%.200s' is not defined", PyString_AS_STRING(name));
7659 #endif
7660     }
7661     return result;
7662 }
7663 
7664 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)7665 static void __Pyx_RaiseDoubleKeywordsError(
7666     const char* func_name,
7667     PyObject* kw_name)
7668 {
7669     PyErr_Format(PyExc_TypeError,
7670         #if PY_MAJOR_VERSION >= 3
7671         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
7672         #else
7673         "%s() got multiple values for keyword argument '%s'", func_name,
7674         PyString_AsString(kw_name));
7675         #endif
7676 }
7677 
7678 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)7679 static int __Pyx_ParseOptionalKeywords(
7680     PyObject *kwds,
7681     PyObject **argnames[],
7682     PyObject *kwds2,
7683     PyObject *values[],
7684     Py_ssize_t num_pos_args,
7685     const char* function_name)
7686 {
7687     PyObject *key = 0, *value = 0;
7688     Py_ssize_t pos = 0;
7689     PyObject*** name;
7690     PyObject*** first_kw_arg = argnames + num_pos_args;
7691     while (PyDict_Next(kwds, &pos, &key, &value)) {
7692         name = first_kw_arg;
7693         while (*name && (**name != key)) name++;
7694         if (*name) {
7695             values[name-argnames] = value;
7696             continue;
7697         }
7698         name = first_kw_arg;
7699         #if PY_MAJOR_VERSION < 3
7700         if (likely(PyString_Check(key))) {
7701             while (*name) {
7702                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
7703                         && _PyString_Eq(**name, key)) {
7704                     values[name-argnames] = value;
7705                     break;
7706                 }
7707                 name++;
7708             }
7709             if (*name) continue;
7710             else {
7711                 PyObject*** argname = argnames;
7712                 while (argname != first_kw_arg) {
7713                     if ((**argname == key) || (
7714                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
7715                              && _PyString_Eq(**argname, key))) {
7716                         goto arg_passed_twice;
7717                     }
7718                     argname++;
7719                 }
7720             }
7721         } else
7722         #endif
7723         if (likely(PyUnicode_Check(key))) {
7724             while (*name) {
7725                 int cmp = (**name == key) ? 0 :
7726                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
7727                     (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
7728                 #endif
7729                     PyUnicode_Compare(**name, key);
7730                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
7731                 if (cmp == 0) {
7732                     values[name-argnames] = value;
7733                     break;
7734                 }
7735                 name++;
7736             }
7737             if (*name) continue;
7738             else {
7739                 PyObject*** argname = argnames;
7740                 while (argname != first_kw_arg) {
7741                     int cmp = (**argname == key) ? 0 :
7742                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
7743                         (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
7744                     #endif
7745                         PyUnicode_Compare(**argname, key);
7746                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
7747                     if (cmp == 0) goto arg_passed_twice;
7748                     argname++;
7749                 }
7750             }
7751         } else
7752             goto invalid_keyword_type;
7753         if (kwds2) {
7754             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
7755         } else {
7756             goto invalid_keyword;
7757         }
7758     }
7759     return 0;
7760 arg_passed_twice:
7761     __Pyx_RaiseDoubleKeywordsError(function_name, key);
7762     goto bad;
7763 invalid_keyword_type:
7764     PyErr_Format(PyExc_TypeError,
7765         "%.200s() keywords must be strings", function_name);
7766     goto bad;
7767 invalid_keyword:
7768     PyErr_Format(PyExc_TypeError,
7769     #if PY_MAJOR_VERSION < 3
7770         "%.200s() got an unexpected keyword argument '%.200s'",
7771         function_name, PyString_AsString(key));
7772     #else
7773         "%s() got an unexpected keyword argument '%U'",
7774         function_name, key);
7775     #endif
7776 bad:
7777     return -1;
7778 }
7779 
7780 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)7781 static void __Pyx_RaiseArgtupleInvalid(
7782     const char* func_name,
7783     int exact,
7784     Py_ssize_t num_min,
7785     Py_ssize_t num_max,
7786     Py_ssize_t num_found)
7787 {
7788     Py_ssize_t num_expected;
7789     const char *more_or_less;
7790     if (num_found < num_min) {
7791         num_expected = num_min;
7792         more_or_less = "at least";
7793     } else {
7794         num_expected = num_max;
7795         more_or_less = "at most";
7796     }
7797     if (exact) {
7798         more_or_less = "exactly";
7799     }
7800     PyErr_Format(PyExc_TypeError,
7801                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
7802                  func_name, more_or_less, num_expected,
7803                  (num_expected == 1) ? "" : "s", num_found);
7804 }
7805 
7806 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)7807 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
7808 {
7809     if (unlikely(!type)) {
7810         PyErr_SetString(PyExc_SystemError, "Missing type object");
7811         return 0;
7812     }
7813     else if (exact) {
7814         #if PY_MAJOR_VERSION == 2
7815         if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
7816         #endif
7817     }
7818     else {
7819         if (likely(__Pyx_TypeCheck(obj, type))) return 1;
7820     }
7821     PyErr_Format(PyExc_TypeError,
7822         "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
7823         name, type->tp_name, Py_TYPE(obj)->tp_name);
7824     return 0;
7825 }
7826 
7827 /* PyDictVersioning */
7828 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)7829 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
7830     PyObject *dict = Py_TYPE(obj)->tp_dict;
7831     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
7832 }
__Pyx_get_object_dict_version(PyObject * obj)7833 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
7834     PyObject **dictptr = NULL;
7835     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
7836     if (offset) {
7837 #if CYTHON_COMPILING_IN_CPYTHON
7838         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
7839 #else
7840         dictptr = _PyObject_GetDictPtr(obj);
7841 #endif
7842     }
7843     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
7844 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)7845 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
7846     PyObject *dict = Py_TYPE(obj)->tp_dict;
7847     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
7848         return 0;
7849     return obj_dict_version == __Pyx_get_object_dict_version(obj);
7850 }
7851 #endif
7852 
7853 /* GetModuleGlobalName */
7854 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)7855 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
7856 #else
7857 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
7858 #endif
7859 {
7860     PyObject *result;
7861 #if !CYTHON_AVOID_BORROWED_REFS
7862 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
7863     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
7864     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
7865     if (likely(result)) {
7866         return __Pyx_NewRef(result);
7867     } else if (unlikely(PyErr_Occurred())) {
7868         return NULL;
7869     }
7870 #else
7871     result = PyDict_GetItem(__pyx_d, name);
7872     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
7873     if (likely(result)) {
7874         return __Pyx_NewRef(result);
7875     }
7876 #endif
7877 #else
7878     result = PyObject_GetItem(__pyx_d, name);
7879     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
7880     if (likely(result)) {
7881         return __Pyx_NewRef(result);
7882     }
7883     PyErr_Clear();
7884 #endif
7885     return __Pyx_GetBuiltinName(name);
7886 }
7887 
7888 /* PyFunctionFastCall */
7889 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)7890 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
7891                                                PyObject *globals) {
7892     PyFrameObject *f;
7893     PyThreadState *tstate = __Pyx_PyThreadState_Current;
7894     PyObject **fastlocals;
7895     Py_ssize_t i;
7896     PyObject *result;
7897     assert(globals != NULL);
7898     /* XXX Perhaps we should create a specialized
7899        PyFrame_New() that doesn't take locals, but does
7900        take builtins without sanity checking them.
7901        */
7902     assert(tstate != NULL);
7903     f = PyFrame_New(tstate, co, globals, NULL);
7904     if (f == NULL) {
7905         return NULL;
7906     }
7907     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
7908     for (i = 0; i < na; i++) {
7909         Py_INCREF(*args);
7910         fastlocals[i] = *args++;
7911     }
7912     result = PyEval_EvalFrameEx(f,0);
7913     ++tstate->recursion_depth;
7914     Py_DECREF(f);
7915     --tstate->recursion_depth;
7916     return result;
7917 }
7918 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)7919 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
7920     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
7921     PyObject *globals = PyFunction_GET_GLOBALS(func);
7922     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
7923     PyObject *closure;
7924 #if PY_MAJOR_VERSION >= 3
7925     PyObject *kwdefs;
7926 #endif
7927     PyObject *kwtuple, **k;
7928     PyObject **d;
7929     Py_ssize_t nd;
7930     Py_ssize_t nk;
7931     PyObject *result;
7932     assert(kwargs == NULL || PyDict_Check(kwargs));
7933     nk = kwargs ? PyDict_Size(kwargs) : 0;
7934     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
7935         return NULL;
7936     }
7937     if (
7938 #if PY_MAJOR_VERSION >= 3
7939             co->co_kwonlyargcount == 0 &&
7940 #endif
7941             likely(kwargs == NULL || nk == 0) &&
7942             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
7943         if (argdefs == NULL && co->co_argcount == nargs) {
7944             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
7945             goto done;
7946         }
7947         else if (nargs == 0 && argdefs != NULL
7948                  && co->co_argcount == Py_SIZE(argdefs)) {
7949             /* function called with no arguments, but all parameters have
7950                a default value: use default values as arguments .*/
7951             args = &PyTuple_GET_ITEM(argdefs, 0);
7952             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
7953             goto done;
7954         }
7955     }
7956     if (kwargs != NULL) {
7957         Py_ssize_t pos, i;
7958         kwtuple = PyTuple_New(2 * nk);
7959         if (kwtuple == NULL) {
7960             result = NULL;
7961             goto done;
7962         }
7963         k = &PyTuple_GET_ITEM(kwtuple, 0);
7964         pos = i = 0;
7965         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
7966             Py_INCREF(k[i]);
7967             Py_INCREF(k[i+1]);
7968             i += 2;
7969         }
7970         nk = i / 2;
7971     }
7972     else {
7973         kwtuple = NULL;
7974         k = NULL;
7975     }
7976     closure = PyFunction_GET_CLOSURE(func);
7977 #if PY_MAJOR_VERSION >= 3
7978     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
7979 #endif
7980     if (argdefs != NULL) {
7981         d = &PyTuple_GET_ITEM(argdefs, 0);
7982         nd = Py_SIZE(argdefs);
7983     }
7984     else {
7985         d = NULL;
7986         nd = 0;
7987     }
7988 #if PY_MAJOR_VERSION >= 3
7989     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
7990                                args, (int)nargs,
7991                                k, (int)nk,
7992                                d, (int)nd, kwdefs, closure);
7993 #else
7994     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
7995                                args, (int)nargs,
7996                                k, (int)nk,
7997                                d, (int)nd, closure);
7998 #endif
7999     Py_XDECREF(kwtuple);
8000 done:
8001     Py_LeaveRecursiveCall();
8002     return result;
8003 }
8004 #endif
8005 #endif
8006 
8007 /* PyCFunctionFastCall */
8008 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)8009 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
8010     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
8011     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
8012     PyObject *self = PyCFunction_GET_SELF(func);
8013     int flags = PyCFunction_GET_FLAGS(func);
8014     assert(PyCFunction_Check(func));
8015     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
8016     assert(nargs >= 0);
8017     assert(nargs == 0 || args != NULL);
8018     /* _PyCFunction_FastCallDict() must not be called with an exception set,
8019        because it may clear it (directly or indirectly) and so the
8020        caller loses its exception */
8021     assert(!PyErr_Occurred());
8022     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
8023         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
8024     } else {
8025         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
8026     }
8027 }
8028 #endif
8029 
8030 /* PyObjectCall */
8031 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)8032 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
8033     PyObject *result;
8034     ternaryfunc call = func->ob_type->tp_call;
8035     if (unlikely(!call))
8036         return PyObject_Call(func, arg, kw);
8037     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
8038         return NULL;
8039     result = (*call)(func, arg, kw);
8040     Py_LeaveRecursiveCall();
8041     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
8042         PyErr_SetString(
8043             PyExc_SystemError,
8044             "NULL result without error in PyObject_Call");
8045     }
8046     return result;
8047 }
8048 #endif
8049 
8050 /* PyErrFetchRestore */
8051 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)8052 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
8053     PyObject *tmp_type, *tmp_value, *tmp_tb;
8054     tmp_type = tstate->curexc_type;
8055     tmp_value = tstate->curexc_value;
8056     tmp_tb = tstate->curexc_traceback;
8057     tstate->curexc_type = type;
8058     tstate->curexc_value = value;
8059     tstate->curexc_traceback = tb;
8060     Py_XDECREF(tmp_type);
8061     Py_XDECREF(tmp_value);
8062     Py_XDECREF(tmp_tb);
8063 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)8064 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
8065     *type = tstate->curexc_type;
8066     *value = tstate->curexc_value;
8067     *tb = tstate->curexc_traceback;
8068     tstate->curexc_type = 0;
8069     tstate->curexc_value = 0;
8070     tstate->curexc_traceback = 0;
8071 }
8072 #endif
8073 
8074 /* RaiseException */
8075 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)8076 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
8077                         CYTHON_UNUSED PyObject *cause) {
8078     __Pyx_PyThreadState_declare
8079     Py_XINCREF(type);
8080     if (!value || value == Py_None)
8081         value = NULL;
8082     else
8083         Py_INCREF(value);
8084     if (!tb || tb == Py_None)
8085         tb = NULL;
8086     else {
8087         Py_INCREF(tb);
8088         if (!PyTraceBack_Check(tb)) {
8089             PyErr_SetString(PyExc_TypeError,
8090                 "raise: arg 3 must be a traceback or None");
8091             goto raise_error;
8092         }
8093     }
8094     if (PyType_Check(type)) {
8095 #if CYTHON_COMPILING_IN_PYPY
8096         if (!value) {
8097             Py_INCREF(Py_None);
8098             value = Py_None;
8099         }
8100 #endif
8101         PyErr_NormalizeException(&type, &value, &tb);
8102     } else {
8103         if (value) {
8104             PyErr_SetString(PyExc_TypeError,
8105                 "instance exception may not have a separate value");
8106             goto raise_error;
8107         }
8108         value = type;
8109         type = (PyObject*) Py_TYPE(type);
8110         Py_INCREF(type);
8111         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
8112             PyErr_SetString(PyExc_TypeError,
8113                 "raise: exception class must be a subclass of BaseException");
8114             goto raise_error;
8115         }
8116     }
8117     __Pyx_PyThreadState_assign
8118     __Pyx_ErrRestore(type, value, tb);
8119     return;
8120 raise_error:
8121     Py_XDECREF(value);
8122     Py_XDECREF(type);
8123     Py_XDECREF(tb);
8124     return;
8125 }
8126 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)8127 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
8128     PyObject* owned_instance = NULL;
8129     if (tb == Py_None) {
8130         tb = 0;
8131     } else if (tb && !PyTraceBack_Check(tb)) {
8132         PyErr_SetString(PyExc_TypeError,
8133             "raise: arg 3 must be a traceback or None");
8134         goto bad;
8135     }
8136     if (value == Py_None)
8137         value = 0;
8138     if (PyExceptionInstance_Check(type)) {
8139         if (value) {
8140             PyErr_SetString(PyExc_TypeError,
8141                 "instance exception may not have a separate value");
8142             goto bad;
8143         }
8144         value = type;
8145         type = (PyObject*) Py_TYPE(value);
8146     } else if (PyExceptionClass_Check(type)) {
8147         PyObject *instance_class = NULL;
8148         if (value && PyExceptionInstance_Check(value)) {
8149             instance_class = (PyObject*) Py_TYPE(value);
8150             if (instance_class != type) {
8151                 int is_subclass = PyObject_IsSubclass(instance_class, type);
8152                 if (!is_subclass) {
8153                     instance_class = NULL;
8154                 } else if (unlikely(is_subclass == -1)) {
8155                     goto bad;
8156                 } else {
8157                     type = instance_class;
8158                 }
8159             }
8160         }
8161         if (!instance_class) {
8162             PyObject *args;
8163             if (!value)
8164                 args = PyTuple_New(0);
8165             else if (PyTuple_Check(value)) {
8166                 Py_INCREF(value);
8167                 args = value;
8168             } else
8169                 args = PyTuple_Pack(1, value);
8170             if (!args)
8171                 goto bad;
8172             owned_instance = PyObject_Call(type, args, NULL);
8173             Py_DECREF(args);
8174             if (!owned_instance)
8175                 goto bad;
8176             value = owned_instance;
8177             if (!PyExceptionInstance_Check(value)) {
8178                 PyErr_Format(PyExc_TypeError,
8179                              "calling %R should have returned an instance of "
8180                              "BaseException, not %R",
8181                              type, Py_TYPE(value));
8182                 goto bad;
8183             }
8184         }
8185     } else {
8186         PyErr_SetString(PyExc_TypeError,
8187             "raise: exception class must be a subclass of BaseException");
8188         goto bad;
8189     }
8190     if (cause) {
8191         PyObject *fixed_cause;
8192         if (cause == Py_None) {
8193             fixed_cause = NULL;
8194         } else if (PyExceptionClass_Check(cause)) {
8195             fixed_cause = PyObject_CallObject(cause, NULL);
8196             if (fixed_cause == NULL)
8197                 goto bad;
8198         } else if (PyExceptionInstance_Check(cause)) {
8199             fixed_cause = cause;
8200             Py_INCREF(fixed_cause);
8201         } else {
8202             PyErr_SetString(PyExc_TypeError,
8203                             "exception causes must derive from "
8204                             "BaseException");
8205             goto bad;
8206         }
8207         PyException_SetCause(value, fixed_cause);
8208     }
8209     PyErr_SetObject(type, value);
8210     if (tb) {
8211 #if CYTHON_COMPILING_IN_PYPY
8212         PyObject *tmp_type, *tmp_value, *tmp_tb;
8213         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
8214         Py_INCREF(tb);
8215         PyErr_Restore(tmp_type, tmp_value, tb);
8216         Py_XDECREF(tmp_tb);
8217 #else
8218         PyThreadState *tstate = __Pyx_PyThreadState_Current;
8219         PyObject* tmp_tb = tstate->curexc_traceback;
8220         if (tb != tmp_tb) {
8221             Py_INCREF(tb);
8222             tstate->curexc_traceback = tb;
8223             Py_XDECREF(tmp_tb);
8224         }
8225 #endif
8226     }
8227 bad:
8228     Py_XDECREF(owned_instance);
8229     return;
8230 }
8231 #endif
8232 
8233 /* WriteUnraisableException */
__Pyx_WriteUnraisable(const char * name,CYTHON_UNUSED int clineno,CYTHON_UNUSED int lineno,CYTHON_UNUSED const char * filename,int full_traceback,CYTHON_UNUSED int nogil)8234 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
8235                                   CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
8236                                   int full_traceback, CYTHON_UNUSED int nogil) {
8237     PyObject *old_exc, *old_val, *old_tb;
8238     PyObject *ctx;
8239     __Pyx_PyThreadState_declare
8240 #ifdef WITH_THREAD
8241     PyGILState_STATE state;
8242     if (nogil)
8243         state = PyGILState_Ensure();
8244 #ifdef _MSC_VER
8245     else state = (PyGILState_STATE)-1;
8246 #endif
8247 #endif
8248     __Pyx_PyThreadState_assign
8249     __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
8250     if (full_traceback) {
8251         Py_XINCREF(old_exc);
8252         Py_XINCREF(old_val);
8253         Py_XINCREF(old_tb);
8254         __Pyx_ErrRestore(old_exc, old_val, old_tb);
8255         PyErr_PrintEx(1);
8256     }
8257     #if PY_MAJOR_VERSION < 3
8258     ctx = PyString_FromString(name);
8259     #else
8260     ctx = PyUnicode_FromString(name);
8261     #endif
8262     __Pyx_ErrRestore(old_exc, old_val, old_tb);
8263     if (!ctx) {
8264         PyErr_WriteUnraisable(Py_None);
8265     } else {
8266         PyErr_WriteUnraisable(ctx);
8267         Py_DECREF(ctx);
8268     }
8269 #ifdef WITH_THREAD
8270     if (nogil)
8271         PyGILState_Release(state);
8272 #endif
8273 }
8274 
8275 /* PyObjectCallMethO */
8276 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)8277 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
8278     PyObject *self, *result;
8279     PyCFunction cfunc;
8280     cfunc = PyCFunction_GET_FUNCTION(func);
8281     self = PyCFunction_GET_SELF(func);
8282     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
8283         return NULL;
8284     result = cfunc(self, arg);
8285     Py_LeaveRecursiveCall();
8286     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
8287         PyErr_SetString(
8288             PyExc_SystemError,
8289             "NULL result without error in PyObject_Call");
8290     }
8291     return result;
8292 }
8293 #endif
8294 
8295 /* PyObjectCallNoArg */
8296 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallNoArg(PyObject * func)8297 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
8298 #if CYTHON_FAST_PYCALL
8299     if (PyFunction_Check(func)) {
8300         return __Pyx_PyFunction_FastCall(func, NULL, 0);
8301     }
8302 #endif
8303 #ifdef __Pyx_CyFunction_USED
8304     if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
8305 #else
8306     if (likely(PyCFunction_Check(func)))
8307 #endif
8308     {
8309         if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
8310             return __Pyx_PyObject_CallMethO(func, NULL);
8311         }
8312     }
8313     return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
8314 }
8315 #endif
8316 
8317 /* PyObject_GenericGetAttrNoDict */
8318 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)8319 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
8320     PyErr_Format(PyExc_AttributeError,
8321 #if PY_MAJOR_VERSION >= 3
8322                  "'%.50s' object has no attribute '%U'",
8323                  tp->tp_name, attr_name);
8324 #else
8325                  "'%.50s' object has no attribute '%.400s'",
8326                  tp->tp_name, PyString_AS_STRING(attr_name));
8327 #endif
8328     return NULL;
8329 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)8330 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
8331     PyObject *descr;
8332     PyTypeObject *tp = Py_TYPE(obj);
8333     if (unlikely(!PyString_Check(attr_name))) {
8334         return PyObject_GenericGetAttr(obj, attr_name);
8335     }
8336     assert(!tp->tp_dictoffset);
8337     descr = _PyType_Lookup(tp, attr_name);
8338     if (unlikely(!descr)) {
8339         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
8340     }
8341     Py_INCREF(descr);
8342     #if PY_MAJOR_VERSION < 3
8343     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
8344     #endif
8345     {
8346         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
8347         if (unlikely(f)) {
8348             PyObject *res = f(descr, obj, (PyObject *)tp);
8349             Py_DECREF(descr);
8350             return res;
8351         }
8352     }
8353     return descr;
8354 }
8355 #endif
8356 
8357 /* PyObject_GenericGetAttr */
8358 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)8359 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
8360     if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
8361         return PyObject_GenericGetAttr(obj, attr_name);
8362     }
8363     return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
8364 }
8365 #endif
8366 
8367 /* PyErrExceptionMatches */
8368 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)8369 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
8370     Py_ssize_t i, n;
8371     n = PyTuple_GET_SIZE(tuple);
8372 #if PY_MAJOR_VERSION >= 3
8373     for (i=0; i<n; i++) {
8374         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
8375     }
8376 #endif
8377     for (i=0; i<n; i++) {
8378         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
8379     }
8380     return 0;
8381 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)8382 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
8383     PyObject *exc_type = tstate->curexc_type;
8384     if (exc_type == err) return 1;
8385     if (unlikely(!exc_type)) return 0;
8386     if (unlikely(PyTuple_Check(err)))
8387         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
8388     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
8389 }
8390 #endif
8391 
8392 /* PyObjectGetAttrStrNoError */
__Pyx_PyObject_GetAttrStr_ClearAttributeError(void)8393 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
8394     __Pyx_PyThreadState_declare
8395     __Pyx_PyThreadState_assign
8396     if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
8397         __Pyx_PyErr_Clear();
8398 }
__Pyx_PyObject_GetAttrStrNoError(PyObject * obj,PyObject * attr_name)8399 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
8400     PyObject *result;
8401 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
8402     PyTypeObject* tp = Py_TYPE(obj);
8403     if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
8404         return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
8405     }
8406 #endif
8407     result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
8408     if (unlikely(!result)) {
8409         __Pyx_PyObject_GetAttrStr_ClearAttributeError();
8410     }
8411     return result;
8412 }
8413 
8414 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)8415 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
8416   int ret;
8417   PyObject *name_attr;
8418   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
8419   if (likely(name_attr)) {
8420       ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
8421   } else {
8422       ret = -1;
8423   }
8424   if (unlikely(ret < 0)) {
8425       PyErr_Clear();
8426       ret = 0;
8427   }
8428   Py_XDECREF(name_attr);
8429   return ret;
8430 }
__Pyx_setup_reduce(PyObject * type_obj)8431 static int __Pyx_setup_reduce(PyObject* type_obj) {
8432     int ret = 0;
8433     PyObject *object_reduce = NULL;
8434     PyObject *object_reduce_ex = NULL;
8435     PyObject *reduce = NULL;
8436     PyObject *reduce_ex = NULL;
8437     PyObject *reduce_cython = NULL;
8438     PyObject *setstate = NULL;
8439     PyObject *setstate_cython = NULL;
8440 #if CYTHON_USE_PYTYPE_LOOKUP
8441     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
8442 #else
8443     if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
8444 #endif
8445 #if CYTHON_USE_PYTYPE_LOOKUP
8446     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
8447 #else
8448     object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
8449 #endif
8450     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
8451     if (reduce_ex == object_reduce_ex) {
8452 #if CYTHON_USE_PYTYPE_LOOKUP
8453         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
8454 #else
8455         object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
8456 #endif
8457         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
8458         if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
8459             reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
8460             if (likely(reduce_cython)) {
8461                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
8462                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
8463             } else if (reduce == object_reduce || PyErr_Occurred()) {
8464                 goto __PYX_BAD;
8465             }
8466             setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
8467             if (!setstate) PyErr_Clear();
8468             if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
8469                 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
8470                 if (likely(setstate_cython)) {
8471                     ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
8472                     ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
8473                 } else if (!setstate || PyErr_Occurred()) {
8474                     goto __PYX_BAD;
8475                 }
8476             }
8477             PyType_Modified((PyTypeObject*)type_obj);
8478         }
8479     }
8480     goto __PYX_GOOD;
8481 __PYX_BAD:
8482     if (!PyErr_Occurred())
8483         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
8484     ret = -1;
8485 __PYX_GOOD:
8486 #if !CYTHON_USE_PYTYPE_LOOKUP
8487     Py_XDECREF(object_reduce);
8488     Py_XDECREF(object_reduce_ex);
8489 #endif
8490     Py_XDECREF(reduce);
8491     Py_XDECREF(reduce_ex);
8492     Py_XDECREF(reduce_cython);
8493     Py_XDECREF(setstate);
8494     Py_XDECREF(setstate_cython);
8495     return ret;
8496 }
8497 
8498 /* TypeImport */
8499 #ifndef __PYX_HAVE_RT_ImportType
8500 #define __PYX_HAVE_RT_ImportType
__Pyx_ImportType(PyObject * module,const char * module_name,const char * class_name,size_t size,enum __Pyx_ImportType_CheckSize check_size)8501 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
8502     size_t size, enum __Pyx_ImportType_CheckSize check_size)
8503 {
8504     PyObject *result = 0;
8505     char warning[200];
8506     Py_ssize_t basicsize;
8507 #ifdef Py_LIMITED_API
8508     PyObject *py_basicsize;
8509 #endif
8510     result = PyObject_GetAttrString(module, class_name);
8511     if (!result)
8512         goto bad;
8513     if (!PyType_Check(result)) {
8514         PyErr_Format(PyExc_TypeError,
8515             "%.200s.%.200s is not a type object",
8516             module_name, class_name);
8517         goto bad;
8518     }
8519 #ifndef Py_LIMITED_API
8520     basicsize = ((PyTypeObject *)result)->tp_basicsize;
8521 #else
8522     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
8523     if (!py_basicsize)
8524         goto bad;
8525     basicsize = PyLong_AsSsize_t(py_basicsize);
8526     Py_DECREF(py_basicsize);
8527     py_basicsize = 0;
8528     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
8529         goto bad;
8530 #endif
8531     if ((size_t)basicsize < size) {
8532         PyErr_Format(PyExc_ValueError,
8533             "%.200s.%.200s size changed, may indicate binary incompatibility. "
8534             "Expected %zd from C header, got %zd from PyObject",
8535             module_name, class_name, size, basicsize);
8536         goto bad;
8537     }
8538     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
8539         PyErr_Format(PyExc_ValueError,
8540             "%.200s.%.200s size changed, may indicate binary incompatibility. "
8541             "Expected %zd from C header, got %zd from PyObject",
8542             module_name, class_name, size, basicsize);
8543         goto bad;
8544     }
8545     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
8546         PyOS_snprintf(warning, sizeof(warning),
8547             "%s.%s size changed, may indicate binary incompatibility. "
8548             "Expected %zd from C header, got %zd from PyObject",
8549             module_name, class_name, size, basicsize);
8550         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
8551     }
8552     return (PyTypeObject *)result;
8553 bad:
8554     Py_XDECREF(result);
8555     return NULL;
8556 }
8557 #endif
8558 
8559 /* GetVTable */
__Pyx_GetVtable(PyObject * dict)8560 static void* __Pyx_GetVtable(PyObject *dict) {
8561     void* ptr;
8562     PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
8563     if (!ob)
8564         goto bad;
8565 #if PY_VERSION_HEX >= 0x02070000
8566     ptr = PyCapsule_GetPointer(ob, 0);
8567 #else
8568     ptr = PyCObject_AsVoidPtr(ob);
8569 #endif
8570     if (!ptr && !PyErr_Occurred())
8571         PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
8572     Py_DECREF(ob);
8573     return ptr;
8574 bad:
8575     Py_XDECREF(ob);
8576     return NULL;
8577 }
8578 
8579 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)8580 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
8581     PyObject *empty_list = 0;
8582     PyObject *module = 0;
8583     PyObject *global_dict = 0;
8584     PyObject *empty_dict = 0;
8585     PyObject *list;
8586     #if PY_MAJOR_VERSION < 3
8587     PyObject *py_import;
8588     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
8589     if (!py_import)
8590         goto bad;
8591     #endif
8592     if (from_list)
8593         list = from_list;
8594     else {
8595         empty_list = PyList_New(0);
8596         if (!empty_list)
8597             goto bad;
8598         list = empty_list;
8599     }
8600     global_dict = PyModule_GetDict(__pyx_m);
8601     if (!global_dict)
8602         goto bad;
8603     empty_dict = PyDict_New();
8604     if (!empty_dict)
8605         goto bad;
8606     {
8607         #if PY_MAJOR_VERSION >= 3
8608         if (level == -1) {
8609             if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
8610                 module = PyImport_ImportModuleLevelObject(
8611                     name, global_dict, empty_dict, list, 1);
8612                 if (!module) {
8613                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
8614                         goto bad;
8615                     PyErr_Clear();
8616                 }
8617             }
8618             level = 0;
8619         }
8620         #endif
8621         if (!module) {
8622             #if PY_MAJOR_VERSION < 3
8623             PyObject *py_level = PyInt_FromLong(level);
8624             if (!py_level)
8625                 goto bad;
8626             module = PyObject_CallFunctionObjArgs(py_import,
8627                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
8628             Py_DECREF(py_level);
8629             #else
8630             module = PyImport_ImportModuleLevelObject(
8631                 name, global_dict, empty_dict, list, level);
8632             #endif
8633         }
8634     }
8635 bad:
8636     #if PY_MAJOR_VERSION < 3
8637     Py_XDECREF(py_import);
8638     #endif
8639     Py_XDECREF(empty_list);
8640     Py_XDECREF(empty_dict);
8641     return module;
8642 }
8643 
8644 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)8645 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
8646     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
8647     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
8648         PyErr_Format(PyExc_ImportError,
8649         #if PY_MAJOR_VERSION < 3
8650             "cannot import name %.230s", PyString_AS_STRING(name));
8651         #else
8652             "cannot import name %S", name);
8653         #endif
8654     }
8655     return value;
8656 }
8657 
8658 /* CLineInTraceback */
8659 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)8660 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
8661     PyObject *use_cline;
8662     PyObject *ptype, *pvalue, *ptraceback;
8663 #if CYTHON_COMPILING_IN_CPYTHON
8664     PyObject **cython_runtime_dict;
8665 #endif
8666     if (unlikely(!__pyx_cython_runtime)) {
8667         return c_line;
8668     }
8669     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
8670 #if CYTHON_COMPILING_IN_CPYTHON
8671     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
8672     if (likely(cython_runtime_dict)) {
8673         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
8674             use_cline, *cython_runtime_dict,
8675             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
8676     } else
8677 #endif
8678     {
8679       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
8680       if (use_cline_obj) {
8681         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
8682         Py_DECREF(use_cline_obj);
8683       } else {
8684         PyErr_Clear();
8685         use_cline = NULL;
8686       }
8687     }
8688     if (!use_cline) {
8689         c_line = 0;
8690         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
8691     }
8692     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
8693         c_line = 0;
8694     }
8695     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
8696     return c_line;
8697 }
8698 #endif
8699 
8700 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)8701 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
8702     int start = 0, mid = 0, end = count - 1;
8703     if (end >= 0 && code_line > entries[end].code_line) {
8704         return count;
8705     }
8706     while (start < end) {
8707         mid = start + (end - start) / 2;
8708         if (code_line < entries[mid].code_line) {
8709             end = mid;
8710         } else if (code_line > entries[mid].code_line) {
8711              start = mid + 1;
8712         } else {
8713             return mid;
8714         }
8715     }
8716     if (code_line <= entries[mid].code_line) {
8717         return mid;
8718     } else {
8719         return mid + 1;
8720     }
8721 }
__pyx_find_code_object(int code_line)8722 static PyCodeObject *__pyx_find_code_object(int code_line) {
8723     PyCodeObject* code_object;
8724     int pos;
8725     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
8726         return NULL;
8727     }
8728     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
8729     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
8730         return NULL;
8731     }
8732     code_object = __pyx_code_cache.entries[pos].code_object;
8733     Py_INCREF(code_object);
8734     return code_object;
8735 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)8736 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
8737     int pos, i;
8738     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
8739     if (unlikely(!code_line)) {
8740         return;
8741     }
8742     if (unlikely(!entries)) {
8743         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
8744         if (likely(entries)) {
8745             __pyx_code_cache.entries = entries;
8746             __pyx_code_cache.max_count = 64;
8747             __pyx_code_cache.count = 1;
8748             entries[0].code_line = code_line;
8749             entries[0].code_object = code_object;
8750             Py_INCREF(code_object);
8751         }
8752         return;
8753     }
8754     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
8755     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
8756         PyCodeObject* tmp = entries[pos].code_object;
8757         entries[pos].code_object = code_object;
8758         Py_DECREF(tmp);
8759         return;
8760     }
8761     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
8762         int new_max = __pyx_code_cache.max_count + 64;
8763         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
8764             __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
8765         if (unlikely(!entries)) {
8766             return;
8767         }
8768         __pyx_code_cache.entries = entries;
8769         __pyx_code_cache.max_count = new_max;
8770     }
8771     for (i=__pyx_code_cache.count; i>pos; i--) {
8772         entries[i] = entries[i-1];
8773     }
8774     entries[pos].code_line = code_line;
8775     entries[pos].code_object = code_object;
8776     __pyx_code_cache.count++;
8777     Py_INCREF(code_object);
8778 }
8779 
8780 /* AddTraceback */
8781 #include "compile.h"
8782 #include "frameobject.h"
8783 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)8784 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
8785             const char *funcname, int c_line,
8786             int py_line, const char *filename) {
8787     PyCodeObject *py_code = 0;
8788     PyObject *py_srcfile = 0;
8789     PyObject *py_funcname = 0;
8790     #if PY_MAJOR_VERSION < 3
8791     py_srcfile = PyString_FromString(filename);
8792     #else
8793     py_srcfile = PyUnicode_FromString(filename);
8794     #endif
8795     if (!py_srcfile) goto bad;
8796     if (c_line) {
8797         #if PY_MAJOR_VERSION < 3
8798         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
8799         #else
8800         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
8801         #endif
8802     }
8803     else {
8804         #if PY_MAJOR_VERSION < 3
8805         py_funcname = PyString_FromString(funcname);
8806         #else
8807         py_funcname = PyUnicode_FromString(funcname);
8808         #endif
8809     }
8810     if (!py_funcname) goto bad;
8811     py_code = __Pyx_PyCode_New(
8812         0,
8813         0,
8814         0,
8815         0,
8816         0,
8817         __pyx_empty_bytes, /*PyObject *code,*/
8818         __pyx_empty_tuple, /*PyObject *consts,*/
8819         __pyx_empty_tuple, /*PyObject *names,*/
8820         __pyx_empty_tuple, /*PyObject *varnames,*/
8821         __pyx_empty_tuple, /*PyObject *freevars,*/
8822         __pyx_empty_tuple, /*PyObject *cellvars,*/
8823         py_srcfile,   /*PyObject *filename,*/
8824         py_funcname,  /*PyObject *name,*/
8825         py_line,
8826         __pyx_empty_bytes  /*PyObject *lnotab*/
8827     );
8828     Py_DECREF(py_srcfile);
8829     Py_DECREF(py_funcname);
8830     return py_code;
8831 bad:
8832     Py_XDECREF(py_srcfile);
8833     Py_XDECREF(py_funcname);
8834     return NULL;
8835 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)8836 static void __Pyx_AddTraceback(const char *funcname, int c_line,
8837                                int py_line, const char *filename) {
8838     PyCodeObject *py_code = 0;
8839     PyFrameObject *py_frame = 0;
8840     PyThreadState *tstate = __Pyx_PyThreadState_Current;
8841     if (c_line) {
8842         c_line = __Pyx_CLineForTraceback(tstate, c_line);
8843     }
8844     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
8845     if (!py_code) {
8846         py_code = __Pyx_CreateCodeObjectForTraceback(
8847             funcname, c_line, py_line, filename);
8848         if (!py_code) goto bad;
8849         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
8850     }
8851     py_frame = PyFrame_New(
8852         tstate,            /*PyThreadState *tstate,*/
8853         py_code,           /*PyCodeObject *code,*/
8854         __pyx_d,    /*PyObject *globals,*/
8855         0                  /*PyObject *locals*/
8856     );
8857     if (!py_frame) goto bad;
8858     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
8859     PyTraceBack_Here(py_frame);
8860 bad:
8861     Py_XDECREF(py_code);
8862     Py_XDECREF(py_frame);
8863 }
8864 
8865 /* CIntFromPyVerify */
8866 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
8867     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
8868 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
8869     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
8870 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
8871     {\
8872         func_type value = func_value;\
8873         if (sizeof(target_type) < sizeof(func_type)) {\
8874             if (unlikely(value != (func_type) (target_type) value)) {\
8875                 func_type zero = 0;\
8876                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
8877                     return (target_type) -1;\
8878                 if (is_unsigned && unlikely(value < zero))\
8879                     goto raise_neg_overflow;\
8880                 else\
8881                     goto raise_overflow;\
8882             }\
8883         }\
8884         return (target_type) value;\
8885     }
8886 
8887 /* CIntToPy */
__Pyx_PyInt_From_uint32_t(uint32_t value)8888 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
8889 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
8890 #pragma GCC diagnostic push
8891 #pragma GCC diagnostic ignored "-Wconversion"
8892 #endif
8893     const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
8894 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
8895 #pragma GCC diagnostic pop
8896 #endif
8897     const int is_unsigned = neg_one > const_zero;
8898     if (is_unsigned) {
8899         if (sizeof(uint32_t) < sizeof(long)) {
8900             return PyInt_FromLong((long) value);
8901         } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
8902             return PyLong_FromUnsignedLong((unsigned long) value);
8903 #ifdef HAVE_LONG_LONG
8904         } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
8905             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
8906 #endif
8907         }
8908     } else {
8909         if (sizeof(uint32_t) <= sizeof(long)) {
8910             return PyInt_FromLong((long) value);
8911 #ifdef HAVE_LONG_LONG
8912         } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
8913             return PyLong_FromLongLong((PY_LONG_LONG) value);
8914 #endif
8915         }
8916     }
8917     {
8918         int one = 1; int little = (int)*(unsigned char *)&one;
8919         unsigned char *bytes = (unsigned char *)&value;
8920         return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
8921                                      little, !is_unsigned);
8922     }
8923 }
8924 
8925 /* CIntFromPy */
__Pyx_PyInt_As_uint32_t(PyObject * x)8926 static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
8927 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
8928 #pragma GCC diagnostic push
8929 #pragma GCC diagnostic ignored "-Wconversion"
8930 #endif
8931     const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
8932 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
8933 #pragma GCC diagnostic pop
8934 #endif
8935     const int is_unsigned = neg_one > const_zero;
8936 #if PY_MAJOR_VERSION < 3
8937     if (likely(PyInt_Check(x))) {
8938         if (sizeof(uint32_t) < sizeof(long)) {
8939             __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x))
8940         } else {
8941             long val = PyInt_AS_LONG(x);
8942             if (is_unsigned && unlikely(val < 0)) {
8943                 goto raise_neg_overflow;
8944             }
8945             return (uint32_t) val;
8946         }
8947     } else
8948 #endif
8949     if (likely(PyLong_Check(x))) {
8950         if (is_unsigned) {
8951 #if CYTHON_USE_PYLONG_INTERNALS
8952             const digit* digits = ((PyLongObject*)x)->ob_digit;
8953             switch (Py_SIZE(x)) {
8954                 case  0: return (uint32_t) 0;
8955                 case  1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0])
8956                 case 2:
8957                     if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) {
8958                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
8959                             __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8960                         } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) {
8961                             return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
8962                         }
8963                     }
8964                     break;
8965                 case 3:
8966                     if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) {
8967                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
8968                             __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8969                         } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) {
8970                             return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
8971                         }
8972                     }
8973                     break;
8974                 case 4:
8975                     if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) {
8976                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
8977                             __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8978                         } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) {
8979                             return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
8980                         }
8981                     }
8982                     break;
8983             }
8984 #endif
8985 #if CYTHON_COMPILING_IN_CPYTHON
8986             if (unlikely(Py_SIZE(x) < 0)) {
8987                 goto raise_neg_overflow;
8988             }
8989 #else
8990             {
8991                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
8992                 if (unlikely(result < 0))
8993                     return (uint32_t) -1;
8994                 if (unlikely(result == 1))
8995                     goto raise_neg_overflow;
8996             }
8997 #endif
8998             if (sizeof(uint32_t) <= sizeof(unsigned long)) {
8999                 __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x))
9000 #ifdef HAVE_LONG_LONG
9001             } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
9002                 __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
9003 #endif
9004             }
9005         } else {
9006 #if CYTHON_USE_PYLONG_INTERNALS
9007             const digit* digits = ((PyLongObject*)x)->ob_digit;
9008             switch (Py_SIZE(x)) {
9009                 case  0: return (uint32_t) 0;
9010                 case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0]))
9011                 case  1: __PYX_VERIFY_RETURN_INT(uint32_t,  digit, +digits[0])
9012                 case -2:
9013                     if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) {
9014                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9015                             __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9016                         } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
9017                             return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
9018                         }
9019                     }
9020                     break;
9021                 case 2:
9022                     if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) {
9023                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9024                             __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9025                         } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
9026                             return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
9027                         }
9028                     }
9029                     break;
9030                 case -3:
9031                     if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
9032                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9033                             __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9034                         } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
9035                             return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
9036                         }
9037                     }
9038                     break;
9039                 case 3:
9040                     if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) {
9041                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9042                             __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9043                         } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
9044                             return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
9045                         }
9046                     }
9047                     break;
9048                 case -4:
9049                     if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
9050                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9051                             __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9052                         } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) {
9053                             return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
9054                         }
9055                     }
9056                     break;
9057                 case 4:
9058                     if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) {
9059                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9060                             __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9061                         } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) {
9062                             return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
9063                         }
9064                     }
9065                     break;
9066             }
9067 #endif
9068             if (sizeof(uint32_t) <= sizeof(long)) {
9069                 __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x))
9070 #ifdef HAVE_LONG_LONG
9071             } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
9072                 __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
9073 #endif
9074             }
9075         }
9076         {
9077 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
9078             PyErr_SetString(PyExc_RuntimeError,
9079                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
9080 #else
9081             uint32_t val;
9082             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
9083  #if PY_MAJOR_VERSION < 3
9084             if (likely(v) && !PyLong_Check(v)) {
9085                 PyObject *tmp = v;
9086                 v = PyNumber_Long(tmp);
9087                 Py_DECREF(tmp);
9088             }
9089  #endif
9090             if (likely(v)) {
9091                 int one = 1; int is_little = (int)*(unsigned char *)&one;
9092                 unsigned char *bytes = (unsigned char *)&val;
9093                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
9094                                               bytes, sizeof(val),
9095                                               is_little, !is_unsigned);
9096                 Py_DECREF(v);
9097                 if (likely(!ret))
9098                     return val;
9099             }
9100 #endif
9101             return (uint32_t) -1;
9102         }
9103     } else {
9104         uint32_t val;
9105         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
9106         if (!tmp) return (uint32_t) -1;
9107         val = __Pyx_PyInt_As_uint32_t(tmp);
9108         Py_DECREF(tmp);
9109         return val;
9110     }
9111 raise_overflow:
9112     PyErr_SetString(PyExc_OverflowError,
9113         "value too large to convert to uint32_t");
9114     return (uint32_t) -1;
9115 raise_neg_overflow:
9116     PyErr_SetString(PyExc_OverflowError,
9117         "can't convert negative value to uint32_t");
9118     return (uint32_t) -1;
9119 }
9120 
9121 /* CIntToPy */
__Pyx_PyInt_From_long(long value)9122 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
9123 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
9124 #pragma GCC diagnostic push
9125 #pragma GCC diagnostic ignored "-Wconversion"
9126 #endif
9127     const long neg_one = (long) -1, const_zero = (long) 0;
9128 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
9129 #pragma GCC diagnostic pop
9130 #endif
9131     const int is_unsigned = neg_one > const_zero;
9132     if (is_unsigned) {
9133         if (sizeof(long) < sizeof(long)) {
9134             return PyInt_FromLong((long) value);
9135         } else if (sizeof(long) <= sizeof(unsigned long)) {
9136             return PyLong_FromUnsignedLong((unsigned long) value);
9137 #ifdef HAVE_LONG_LONG
9138         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
9139             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
9140 #endif
9141         }
9142     } else {
9143         if (sizeof(long) <= sizeof(long)) {
9144             return PyInt_FromLong((long) value);
9145 #ifdef HAVE_LONG_LONG
9146         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
9147             return PyLong_FromLongLong((PY_LONG_LONG) value);
9148 #endif
9149         }
9150     }
9151     {
9152         int one = 1; int little = (int)*(unsigned char *)&one;
9153         unsigned char *bytes = (unsigned char *)&value;
9154         return _PyLong_FromByteArray(bytes, sizeof(long),
9155                                      little, !is_unsigned);
9156     }
9157 }
9158 
9159 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)9160 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
9161 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
9162 #pragma GCC diagnostic push
9163 #pragma GCC diagnostic ignored "-Wconversion"
9164 #endif
9165     const long neg_one = (long) -1, const_zero = (long) 0;
9166 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
9167 #pragma GCC diagnostic pop
9168 #endif
9169     const int is_unsigned = neg_one > const_zero;
9170 #if PY_MAJOR_VERSION < 3
9171     if (likely(PyInt_Check(x))) {
9172         if (sizeof(long) < sizeof(long)) {
9173             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
9174         } else {
9175             long val = PyInt_AS_LONG(x);
9176             if (is_unsigned && unlikely(val < 0)) {
9177                 goto raise_neg_overflow;
9178             }
9179             return (long) val;
9180         }
9181     } else
9182 #endif
9183     if (likely(PyLong_Check(x))) {
9184         if (is_unsigned) {
9185 #if CYTHON_USE_PYLONG_INTERNALS
9186             const digit* digits = ((PyLongObject*)x)->ob_digit;
9187             switch (Py_SIZE(x)) {
9188                 case  0: return (long) 0;
9189                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
9190                 case 2:
9191                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
9192                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9193                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9194                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
9195                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
9196                         }
9197                     }
9198                     break;
9199                 case 3:
9200                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
9201                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9202                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9203                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
9204                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
9205                         }
9206                     }
9207                     break;
9208                 case 4:
9209                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
9210                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9211                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9212                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
9213                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
9214                         }
9215                     }
9216                     break;
9217             }
9218 #endif
9219 #if CYTHON_COMPILING_IN_CPYTHON
9220             if (unlikely(Py_SIZE(x) < 0)) {
9221                 goto raise_neg_overflow;
9222             }
9223 #else
9224             {
9225                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
9226                 if (unlikely(result < 0))
9227                     return (long) -1;
9228                 if (unlikely(result == 1))
9229                     goto raise_neg_overflow;
9230             }
9231 #endif
9232             if (sizeof(long) <= sizeof(unsigned long)) {
9233                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
9234 #ifdef HAVE_LONG_LONG
9235             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
9236                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
9237 #endif
9238             }
9239         } else {
9240 #if CYTHON_USE_PYLONG_INTERNALS
9241             const digit* digits = ((PyLongObject*)x)->ob_digit;
9242             switch (Py_SIZE(x)) {
9243                 case  0: return (long) 0;
9244                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
9245                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
9246                 case -2:
9247                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
9248                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9249                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9250                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
9251                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9252                         }
9253                     }
9254                     break;
9255                 case 2:
9256                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
9257                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9258                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9259                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
9260                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9261                         }
9262                     }
9263                     break;
9264                 case -3:
9265                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
9266                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9267                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9268                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
9269                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9270                         }
9271                     }
9272                     break;
9273                 case 3:
9274                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
9275                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9276                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9277                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
9278                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9279                         }
9280                     }
9281                     break;
9282                 case -4:
9283                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
9284                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9285                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9286                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
9287                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9288                         }
9289                     }
9290                     break;
9291                 case 4:
9292                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
9293                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9294                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9295                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
9296                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
9297                         }
9298                     }
9299                     break;
9300             }
9301 #endif
9302             if (sizeof(long) <= sizeof(long)) {
9303                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
9304 #ifdef HAVE_LONG_LONG
9305             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
9306                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
9307 #endif
9308             }
9309         }
9310         {
9311 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
9312             PyErr_SetString(PyExc_RuntimeError,
9313                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
9314 #else
9315             long val;
9316             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
9317  #if PY_MAJOR_VERSION < 3
9318             if (likely(v) && !PyLong_Check(v)) {
9319                 PyObject *tmp = v;
9320                 v = PyNumber_Long(tmp);
9321                 Py_DECREF(tmp);
9322             }
9323  #endif
9324             if (likely(v)) {
9325                 int one = 1; int is_little = (int)*(unsigned char *)&one;
9326                 unsigned char *bytes = (unsigned char *)&val;
9327                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
9328                                               bytes, sizeof(val),
9329                                               is_little, !is_unsigned);
9330                 Py_DECREF(v);
9331                 if (likely(!ret))
9332                     return val;
9333             }
9334 #endif
9335             return (long) -1;
9336         }
9337     } else {
9338         long val;
9339         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
9340         if (!tmp) return (long) -1;
9341         val = __Pyx_PyInt_As_long(tmp);
9342         Py_DECREF(tmp);
9343         return val;
9344     }
9345 raise_overflow:
9346     PyErr_SetString(PyExc_OverflowError,
9347         "value too large to convert to long");
9348     return (long) -1;
9349 raise_neg_overflow:
9350     PyErr_SetString(PyExc_OverflowError,
9351         "can't convert negative value to long");
9352     return (long) -1;
9353 }
9354 
9355 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)9356 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
9357 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
9358 #pragma GCC diagnostic push
9359 #pragma GCC diagnostic ignored "-Wconversion"
9360 #endif
9361     const int neg_one = (int) -1, const_zero = (int) 0;
9362 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
9363 #pragma GCC diagnostic pop
9364 #endif
9365     const int is_unsigned = neg_one > const_zero;
9366 #if PY_MAJOR_VERSION < 3
9367     if (likely(PyInt_Check(x))) {
9368         if (sizeof(int) < sizeof(long)) {
9369             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
9370         } else {
9371             long val = PyInt_AS_LONG(x);
9372             if (is_unsigned && unlikely(val < 0)) {
9373                 goto raise_neg_overflow;
9374             }
9375             return (int) val;
9376         }
9377     } else
9378 #endif
9379     if (likely(PyLong_Check(x))) {
9380         if (is_unsigned) {
9381 #if CYTHON_USE_PYLONG_INTERNALS
9382             const digit* digits = ((PyLongObject*)x)->ob_digit;
9383             switch (Py_SIZE(x)) {
9384                 case  0: return (int) 0;
9385                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
9386                 case 2:
9387                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
9388                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9389                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9390                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
9391                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
9392                         }
9393                     }
9394                     break;
9395                 case 3:
9396                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
9397                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9398                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9399                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
9400                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
9401                         }
9402                     }
9403                     break;
9404                 case 4:
9405                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
9406                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9407                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9408                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
9409                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
9410                         }
9411                     }
9412                     break;
9413             }
9414 #endif
9415 #if CYTHON_COMPILING_IN_CPYTHON
9416             if (unlikely(Py_SIZE(x) < 0)) {
9417                 goto raise_neg_overflow;
9418             }
9419 #else
9420             {
9421                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
9422                 if (unlikely(result < 0))
9423                     return (int) -1;
9424                 if (unlikely(result == 1))
9425                     goto raise_neg_overflow;
9426             }
9427 #endif
9428             if (sizeof(int) <= sizeof(unsigned long)) {
9429                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
9430 #ifdef HAVE_LONG_LONG
9431             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
9432                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
9433 #endif
9434             }
9435         } else {
9436 #if CYTHON_USE_PYLONG_INTERNALS
9437             const digit* digits = ((PyLongObject*)x)->ob_digit;
9438             switch (Py_SIZE(x)) {
9439                 case  0: return (int) 0;
9440                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
9441                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
9442                 case -2:
9443                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
9444                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9445                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9446                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
9447                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9448                         }
9449                     }
9450                     break;
9451                 case 2:
9452                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
9453                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
9454                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9455                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
9456                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9457                         }
9458                     }
9459                     break;
9460                 case -3:
9461                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
9462                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9463                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9464                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
9465                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9466                         }
9467                     }
9468                     break;
9469                 case 3:
9470                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
9471                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
9472                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9473                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
9474                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9475                         }
9476                     }
9477                     break;
9478                 case -4:
9479                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
9480                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9481                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9482                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
9483                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9484                         }
9485                     }
9486                     break;
9487                 case 4:
9488                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
9489                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
9490                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
9491                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
9492                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
9493                         }
9494                     }
9495                     break;
9496             }
9497 #endif
9498             if (sizeof(int) <= sizeof(long)) {
9499                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
9500 #ifdef HAVE_LONG_LONG
9501             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
9502                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
9503 #endif
9504             }
9505         }
9506         {
9507 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
9508             PyErr_SetString(PyExc_RuntimeError,
9509                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
9510 #else
9511             int val;
9512             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
9513  #if PY_MAJOR_VERSION < 3
9514             if (likely(v) && !PyLong_Check(v)) {
9515                 PyObject *tmp = v;
9516                 v = PyNumber_Long(tmp);
9517                 Py_DECREF(tmp);
9518             }
9519  #endif
9520             if (likely(v)) {
9521                 int one = 1; int is_little = (int)*(unsigned char *)&one;
9522                 unsigned char *bytes = (unsigned char *)&val;
9523                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
9524                                               bytes, sizeof(val),
9525                                               is_little, !is_unsigned);
9526                 Py_DECREF(v);
9527                 if (likely(!ret))
9528                     return val;
9529             }
9530 #endif
9531             return (int) -1;
9532         }
9533     } else {
9534         int val;
9535         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
9536         if (!tmp) return (int) -1;
9537         val = __Pyx_PyInt_As_int(tmp);
9538         Py_DECREF(tmp);
9539         return val;
9540     }
9541 raise_overflow:
9542     PyErr_SetString(PyExc_OverflowError,
9543         "value too large to convert to int");
9544     return (int) -1;
9545 raise_neg_overflow:
9546     PyErr_SetString(PyExc_OverflowError,
9547         "can't convert negative value to int");
9548     return (int) -1;
9549 }
9550 
9551 /* FastTypeChecks */
9552 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)9553 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
9554     while (a) {
9555         a = a->tp_base;
9556         if (a == b)
9557             return 1;
9558     }
9559     return b == &PyBaseObject_Type;
9560 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)9561 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
9562     PyObject *mro;
9563     if (a == b) return 1;
9564     mro = a->tp_mro;
9565     if (likely(mro)) {
9566         Py_ssize_t i, n;
9567         n = PyTuple_GET_SIZE(mro);
9568         for (i = 0; i < n; i++) {
9569             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
9570                 return 1;
9571         }
9572         return 0;
9573     }
9574     return __Pyx_InBases(a, b);
9575 }
9576 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)9577 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
9578     PyObject *exception, *value, *tb;
9579     int res;
9580     __Pyx_PyThreadState_declare
9581     __Pyx_PyThreadState_assign
9582     __Pyx_ErrFetch(&exception, &value, &tb);
9583     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
9584     if (unlikely(res == -1)) {
9585         PyErr_WriteUnraisable(err);
9586         res = 0;
9587     }
9588     if (!res) {
9589         res = PyObject_IsSubclass(err, exc_type2);
9590         if (unlikely(res == -1)) {
9591             PyErr_WriteUnraisable(err);
9592             res = 0;
9593         }
9594     }
9595     __Pyx_ErrRestore(exception, value, tb);
9596     return res;
9597 }
9598 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)9599 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
9600     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
9601     if (!res) {
9602         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
9603     }
9604     return res;
9605 }
9606 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)9607 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
9608     Py_ssize_t i, n;
9609     assert(PyExceptionClass_Check(exc_type));
9610     n = PyTuple_GET_SIZE(tuple);
9611 #if PY_MAJOR_VERSION >= 3
9612     for (i=0; i<n; i++) {
9613         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
9614     }
9615 #endif
9616     for (i=0; i<n; i++) {
9617         PyObject *t = PyTuple_GET_ITEM(tuple, i);
9618         #if PY_MAJOR_VERSION < 3
9619         if (likely(exc_type == t)) return 1;
9620         #endif
9621         if (likely(PyExceptionClass_Check(t))) {
9622             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
9623         } else {
9624         }
9625     }
9626     return 0;
9627 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)9628 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
9629     if (likely(err == exc_type)) return 1;
9630     if (likely(PyExceptionClass_Check(err))) {
9631         if (likely(PyExceptionClass_Check(exc_type))) {
9632             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
9633         } else if (likely(PyTuple_Check(exc_type))) {
9634             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
9635         } else {
9636         }
9637     }
9638     return PyErr_GivenExceptionMatches(err, exc_type);
9639 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)9640 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
9641     assert(PyExceptionClass_Check(exc_type1));
9642     assert(PyExceptionClass_Check(exc_type2));
9643     if (likely(err == exc_type1 || err == exc_type2)) return 1;
9644     if (likely(PyExceptionClass_Check(err))) {
9645         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
9646     }
9647     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
9648 }
9649 #endif
9650 
9651 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)9652 static int __Pyx_check_binary_version(void) {
9653     char ctversion[4], rtversion[4];
9654     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
9655     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
9656     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
9657         char message[200];
9658         PyOS_snprintf(message, sizeof(message),
9659                       "compiletime version %s of module '%.100s' "
9660                       "does not match runtime version %s",
9661                       ctversion, __Pyx_MODULE_NAME, rtversion);
9662         return PyErr_WarnEx(NULL, message, 1);
9663     }
9664     return 0;
9665 }
9666 
9667 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)9668 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
9669     while (t->p) {
9670         #if PY_MAJOR_VERSION < 3
9671         if (t->is_unicode) {
9672             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
9673         } else if (t->intern) {
9674             *t->p = PyString_InternFromString(t->s);
9675         } else {
9676             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
9677         }
9678         #else
9679         if (t->is_unicode | t->is_str) {
9680             if (t->intern) {
9681                 *t->p = PyUnicode_InternFromString(t->s);
9682             } else if (t->encoding) {
9683                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
9684             } else {
9685                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
9686             }
9687         } else {
9688             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
9689         }
9690         #endif
9691         if (!*t->p)
9692             return -1;
9693         if (PyObject_Hash(*t->p) == -1)
9694             return -1;
9695         ++t;
9696     }
9697     return 0;
9698 }
9699 
__Pyx_PyUnicode_FromString(const char * c_str)9700 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
9701     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
9702 }
__Pyx_PyObject_AsString(PyObject * o)9703 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
9704     Py_ssize_t ignore;
9705     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
9706 }
9707 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
9708 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)9709 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
9710     char* defenc_c;
9711     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
9712     if (!defenc) return NULL;
9713     defenc_c = PyBytes_AS_STRING(defenc);
9714 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9715     {
9716         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
9717         char* c;
9718         for (c = defenc_c; c < end; c++) {
9719             if ((unsigned char) (*c) >= 128) {
9720                 PyUnicode_AsASCIIString(o);
9721                 return NULL;
9722             }
9723         }
9724     }
9725 #endif
9726     *length = PyBytes_GET_SIZE(defenc);
9727     return defenc_c;
9728 }
9729 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)9730 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
9731     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
9732 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9733     if (likely(PyUnicode_IS_ASCII(o))) {
9734         *length = PyUnicode_GET_LENGTH(o);
9735         return PyUnicode_AsUTF8(o);
9736     } else {
9737         PyUnicode_AsASCIIString(o);
9738         return NULL;
9739     }
9740 #else
9741     return PyUnicode_AsUTF8AndSize(o, length);
9742 #endif
9743 }
9744 #endif
9745 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)9746 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
9747 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
9748     if (
9749 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9750             __Pyx_sys_getdefaultencoding_not_ascii &&
9751 #endif
9752             PyUnicode_Check(o)) {
9753         return __Pyx_PyUnicode_AsStringAndSize(o, length);
9754     } else
9755 #endif
9756 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
9757     if (PyByteArray_Check(o)) {
9758         *length = PyByteArray_GET_SIZE(o);
9759         return PyByteArray_AS_STRING(o);
9760     } else
9761 #endif
9762     {
9763         char* result;
9764         int r = PyBytes_AsStringAndSize(o, &result, length);
9765         if (unlikely(r < 0)) {
9766             return NULL;
9767         } else {
9768             return result;
9769         }
9770     }
9771 }
__Pyx_PyObject_IsTrue(PyObject * x)9772 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
9773    int is_true = x == Py_True;
9774    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
9775    else return PyObject_IsTrue(x);
9776 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)9777 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
9778     int retval;
9779     if (unlikely(!x)) return -1;
9780     retval = __Pyx_PyObject_IsTrue(x);
9781     Py_DECREF(x);
9782     return retval;
9783 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)9784 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
9785 #if PY_MAJOR_VERSION >= 3
9786     if (PyLong_Check(result)) {
9787         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
9788                 "__int__ returned non-int (type %.200s).  "
9789                 "The ability to return an instance of a strict subclass of int "
9790                 "is deprecated, and may be removed in a future version of Python.",
9791                 Py_TYPE(result)->tp_name)) {
9792             Py_DECREF(result);
9793             return NULL;
9794         }
9795         return result;
9796     }
9797 #endif
9798     PyErr_Format(PyExc_TypeError,
9799                  "__%.4s__ returned non-%.4s (type %.200s)",
9800                  type_name, type_name, Py_TYPE(result)->tp_name);
9801     Py_DECREF(result);
9802     return NULL;
9803 }
__Pyx_PyNumber_IntOrLong(PyObject * x)9804 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
9805 #if CYTHON_USE_TYPE_SLOTS
9806   PyNumberMethods *m;
9807 #endif
9808   const char *name = NULL;
9809   PyObject *res = NULL;
9810 #if PY_MAJOR_VERSION < 3
9811   if (likely(PyInt_Check(x) || PyLong_Check(x)))
9812 #else
9813   if (likely(PyLong_Check(x)))
9814 #endif
9815     return __Pyx_NewRef(x);
9816 #if CYTHON_USE_TYPE_SLOTS
9817   m = Py_TYPE(x)->tp_as_number;
9818   #if PY_MAJOR_VERSION < 3
9819   if (m && m->nb_int) {
9820     name = "int";
9821     res = m->nb_int(x);
9822   }
9823   else if (m && m->nb_long) {
9824     name = "long";
9825     res = m->nb_long(x);
9826   }
9827   #else
9828   if (likely(m && m->nb_int)) {
9829     name = "int";
9830     res = m->nb_int(x);
9831   }
9832   #endif
9833 #else
9834   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
9835     res = PyNumber_Int(x);
9836   }
9837 #endif
9838   if (likely(res)) {
9839 #if PY_MAJOR_VERSION < 3
9840     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
9841 #else
9842     if (unlikely(!PyLong_CheckExact(res))) {
9843 #endif
9844         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
9845     }
9846   }
9847   else if (!PyErr_Occurred()) {
9848     PyErr_SetString(PyExc_TypeError,
9849                     "an integer is required");
9850   }
9851   return res;
9852 }
9853 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
9854   Py_ssize_t ival;
9855   PyObject *x;
9856 #if PY_MAJOR_VERSION < 3
9857   if (likely(PyInt_CheckExact(b))) {
9858     if (sizeof(Py_ssize_t) >= sizeof(long))
9859         return PyInt_AS_LONG(b);
9860     else
9861         return PyInt_AsSsize_t(b);
9862   }
9863 #endif
9864   if (likely(PyLong_CheckExact(b))) {
9865     #if CYTHON_USE_PYLONG_INTERNALS
9866     const digit* digits = ((PyLongObject*)b)->ob_digit;
9867     const Py_ssize_t size = Py_SIZE(b);
9868     if (likely(__Pyx_sst_abs(size) <= 1)) {
9869         ival = likely(size) ? digits[0] : 0;
9870         if (size == -1) ival = -ival;
9871         return ival;
9872     } else {
9873       switch (size) {
9874          case 2:
9875            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
9876              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
9877            }
9878            break;
9879          case -2:
9880            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
9881              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
9882            }
9883            break;
9884          case 3:
9885            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
9886              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
9887            }
9888            break;
9889          case -3:
9890            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
9891              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
9892            }
9893            break;
9894          case 4:
9895            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
9896              return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
9897            }
9898            break;
9899          case -4:
9900            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
9901              return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
9902            }
9903            break;
9904       }
9905     }
9906     #endif
9907     return PyLong_AsSsize_t(b);
9908   }
9909   x = PyNumber_Index(b);
9910   if (!x) return -1;
9911   ival = PyInt_AsSsize_t(x);
9912   Py_DECREF(x);
9913   return ival;
9914 }
9915 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
9916   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
9917 }
9918 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
9919     return PyInt_FromSize_t(ival);
9920 }
9921 
9922 
9923 #endif /* Py_PYTHON_H */
9924