LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - py_krb5pac.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 270 2237 12.1 %
Date: 2021-09-23 10:06:22 Functions: 13 186 7.0 %

          Line data    Source code
       1             : 
       2             : /* Python wrapper functions auto-generated by pidl */
       3             : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
       4             : #include <Python.h>
       5             : #include "python/py3compat.h"
       6             : #include "includes.h"
       7             : #include "python/modules.h"
       8             : #include <pytalloc.h>
       9             : #include "librpc/rpc/pyrpc.h"
      10             : #include "librpc/rpc/pyrpc_util.h"
      11             : #include "bin/default/librpc/gen_ndr/ndr_krb5pac.h"
      12             : 
      13             : 
      14             : /*
      15             :  * Suppress compiler warnings if the generated code does not call these
      16             :  * functions
      17             :  */
      18             : #ifndef _MAYBE_UNUSED_
      19             : #ifdef __has_attribute
      20             : #if __has_attribute(unused)
      21             : #define _MAYBE_UNUSED_ __attribute__ ((unused))
      22             : #else
      23             : #define _MAYBE_UNUSED_
      24             : #endif
      25             : #endif
      26             : #endif
      27             : /*
      28             :  * These functions are here to ensure they can be optimized out by
      29             :  * the compiler based on the constant input values
      30             :  */
      31             : 
      32           0 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
      33             : {
      34           0 :         switch (var_size) {
      35           0 :         case 8:
      36           0 :                 return UINT64_MAX;
      37           0 :         case 4:
      38           0 :                 return UINT32_MAX;
      39           0 :         case 2:
      40           0 :                 return UINT16_MAX;
      41           0 :         case 1:
      42           0 :                 return UINT8_MAX;
      43             :         }
      44             : 
      45           0 :         return 0;
      46             : }
      47             : 
      48           0 : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
      49             : {
      50           0 :         switch (var_size) {
      51           0 :         case 8:
      52           0 :                 return INT64_MAX;
      53           0 :         case 4:
      54           0 :                 return INT32_MAX;
      55           0 :         case 2:
      56           0 :                 return INT16_MAX;
      57           0 :         case 1:
      58           0 :                 return INT8_MAX;
      59             :         }
      60             : 
      61           0 :         return 0;
      62             : }
      63             : 
      64             : #include "librpc/gen_ndr/security.h"
      65             : #include "librpc/gen_ndr/lsa.h"
      66             : #include "librpc/gen_ndr/netlogon.h"
      67             : #include "librpc/gen_ndr/samr.h"
      68             : static PyTypeObject PAC_LOGON_NAME_Type;
      69             : static PyTypeObject PAC_SIGNATURE_DATA_Type;
      70             : static PyTypeObject PAC_DOMAIN_GROUP_MEMBERSHIP_Type;
      71             : static PyTypeObject PAC_LOGON_INFO_Type;
      72             : static PyTypeObject PAC_CREDENTIAL_NTLM_SECPKG_Type;
      73             : static PyTypeObject PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type;
      74             : static PyTypeObject PAC_CREDENTIAL_DATA_Type;
      75             : static PyTypeObject PAC_CREDENTIAL_DATA_CTR_Type;
      76             : static PyTypeObject PAC_CREDENTIAL_DATA_NDR_Type;
      77             : static PyTypeObject PAC_CREDENTIAL_INFO_Type;
      78             : static PyTypeObject PAC_CONSTRAINED_DELEGATION_Type;
      79             : static PyTypeObject PAC_UPN_DNS_INFO_Type;
      80             : static PyTypeObject PAC_LOGON_INFO_CTR_Type;
      81             : static PyTypeObject PAC_CONSTRAINED_DELEGATION_CTR_Type;
      82             : static PyTypeObject DATA_BLOB_REM_Type;
      83             : static PyTypeObject PAC_INFO_Type;
      84             : static PyTypeObject PAC_BUFFER_Type;
      85             : static PyTypeObject PAC_DATA_Type;
      86             : static PyTypeObject PAC_BUFFER_RAW_Type;
      87             : static PyTypeObject PAC_DATA_RAW_Type;
      88             : static PyTypeObject PAC_Validate_Type;
      89             : static PyTypeObject netsamlogoncache_entry_Type;
      90             : static PyTypeObject krb5pac_InterfaceType;
      91             : 
      92             : static PyTypeObject *BaseObject_Type;
      93             : static PyTypeObject *dom_sid_Type;
      94             : static PyTypeObject *samr_RidWithAttributeArray_Type;
      95             : static PyTypeObject *netr_SamInfo3_Type;
      96             : static PyTypeObject *samr_Password_Type;
      97             : static PyTypeObject *lsa_String_Type;
      98             : static PyTypeObject *ClientConnection_Type;
      99             : static PyTypeObject *ndr_syntax_id_Type;
     100             : 
     101           0 : static PyObject *py_PAC_LOGON_NAME_get_logon_time(PyObject *obj, void *closure)
     102             : {
     103           0 :         struct PAC_LOGON_NAME *object = (struct PAC_LOGON_NAME *)pytalloc_get_ptr(obj);
     104             :         PyObject *py_logon_time;
     105           0 :         py_logon_time = PyLong_FromUnsignedLongLong(object->logon_time);
     106           0 :         return py_logon_time;
     107             : }
     108             : 
     109           0 : static int py_PAC_LOGON_NAME_set_logon_time(PyObject *py_obj, PyObject *value, void *closure)
     110             : {
     111           0 :         struct PAC_LOGON_NAME *object = (struct PAC_LOGON_NAME *)pytalloc_get_ptr(py_obj);
     112           0 :         if (value == NULL) {
     113           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->logon_time");
     114           0 :                 return -1;
     115             :         }
     116             :         {
     117           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logon_time));
     118           0 :                 if (PyLong_Check(value)) {
     119             :                         unsigned long long test_var;
     120           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     121           0 :                         if (PyErr_Occurred() != NULL) {
     122           0 :                                 return -1;
     123             :                         }
     124           0 :                         if (test_var > uint_max) {
     125           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     126             :                                   PyLong_Type.tp_name, uint_max, test_var);
     127           0 :                                 return -1;
     128             :                         }
     129           0 :                         object->logon_time = test_var;
     130             :                 } else {
     131           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     132             :                           PyLong_Type.tp_name);
     133           0 :                         return -1;
     134             :                 }
     135             :         }
     136           0 :         return 0;
     137             : }
     138             : 
     139           0 : static PyObject *py_PAC_LOGON_NAME_get_size(PyObject *obj, void *closure)
     140             : {
     141           0 :         struct PAC_LOGON_NAME *object = (struct PAC_LOGON_NAME *)pytalloc_get_ptr(obj);
     142             :         PyObject *py_size;
     143           0 :         py_size = PyLong_FromLong((uint16_t)object->size);
     144           0 :         return py_size;
     145             : }
     146             : 
     147           0 : static int py_PAC_LOGON_NAME_set_size(PyObject *py_obj, PyObject *value, void *closure)
     148             : {
     149           0 :         struct PAC_LOGON_NAME *object = (struct PAC_LOGON_NAME *)pytalloc_get_ptr(py_obj);
     150           0 :         if (value == NULL) {
     151           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->size");
     152           0 :                 return -1;
     153             :         }
     154             :         {
     155           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
     156           0 :                 if (PyLong_Check(value)) {
     157             :                         unsigned long long test_var;
     158           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     159           0 :                         if (PyErr_Occurred() != NULL) {
     160           0 :                                 return -1;
     161             :                         }
     162           0 :                         if (test_var > uint_max) {
     163           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     164             :                                   PyLong_Type.tp_name, uint_max, test_var);
     165           0 :                                 return -1;
     166             :                         }
     167           0 :                         object->size = test_var;
     168             :                 } else {
     169           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     170             :                           PyLong_Type.tp_name);
     171           0 :                         return -1;
     172             :                 }
     173             :         }
     174           0 :         return 0;
     175             : }
     176             : 
     177           4 : static PyObject *py_PAC_LOGON_NAME_get_account_name(PyObject *obj, void *closure)
     178             : {
     179           4 :         struct PAC_LOGON_NAME *object = (struct PAC_LOGON_NAME *)pytalloc_get_ptr(obj);
     180             :         PyObject *py_account_name;
     181           4 :         if (object->account_name == NULL) {
     182           0 :                 py_account_name = Py_None;
     183           0 :                 Py_INCREF(py_account_name);
     184             :         } else {
     185           4 :                 py_account_name = PyUnicode_Decode(object->account_name, strlen(object->account_name), "utf-8", "ignore");
     186             :         }
     187           4 :         return py_account_name;
     188             : }
     189             : 
     190           0 : static int py_PAC_LOGON_NAME_set_account_name(PyObject *py_obj, PyObject *value, void *closure)
     191             : {
     192           0 :         struct PAC_LOGON_NAME *object = (struct PAC_LOGON_NAME *)pytalloc_get_ptr(py_obj);
     193           0 :         if (value == NULL) {
     194           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->account_name");
     195           0 :                 return -1;
     196             :         }
     197             :         {
     198             :                 const char *test_str;
     199             :                 const char *talloc_str;
     200           0 :                 PyObject *unicode = NULL;
     201           0 :                 if (PyUnicode_Check(value)) {
     202           0 :                         unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     203           0 :                         if (unicode == NULL) {
     204           0 :                                 PyErr_NoMemory();
     205           0 :                                 return -1;
     206             :                         }
     207           0 :                         test_str = PyBytes_AS_STRING(unicode);
     208           0 :                 } else if (PyBytes_Check(value)) {
     209           0 :                         test_str = PyBytes_AS_STRING(value);
     210             :                 } else {
     211           0 :                         PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     212           0 :                         return -1;
     213             :                 }
     214           0 :                 talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     215           0 :                 if (unicode != NULL) {
     216           0 :                         Py_DECREF(unicode);
     217             :                 }
     218           0 :                 if (talloc_str == NULL) {
     219           0 :                         PyErr_NoMemory();
     220           0 :                         return -1;
     221             :                 }
     222           0 :                 object->account_name = talloc_str;
     223             :         }
     224           0 :         return 0;
     225             : }
     226             : 
     227             : static PyGetSetDef py_PAC_LOGON_NAME_getsetters[] = {
     228             :         {
     229             :                 .name = discard_const_p(char, "logon_time"),
     230             :                 .get = py_PAC_LOGON_NAME_get_logon_time,
     231             :                 .set = py_PAC_LOGON_NAME_set_logon_time,
     232             :                 .doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
     233             :         },
     234             :         {
     235             :                 .name = discard_const_p(char, "size"),
     236             :                 .get = py_PAC_LOGON_NAME_get_size,
     237             :                 .set = py_PAC_LOGON_NAME_set_size,
     238             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
     239             :         },
     240             :         {
     241             :                 .name = discard_const_p(char, "account_name"),
     242             :                 .get = py_PAC_LOGON_NAME_get_account_name,
     243             :                 .set = py_PAC_LOGON_NAME_set_account_name,
     244             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
     245             :         },
     246             :         { .name = NULL }
     247             : };
     248             : 
     249           0 : static PyObject *py_PAC_LOGON_NAME_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     250             : {
     251           0 :         return pytalloc_new(struct PAC_LOGON_NAME, type);
     252             : }
     253             : 
     254             : 
     255             : static PyTypeObject PAC_LOGON_NAME_Type = {
     256             :         PyVarObject_HEAD_INIT(NULL, 0)
     257             :         .tp_name = "krb5pac.PAC_LOGON_NAME",
     258             :         .tp_getset = py_PAC_LOGON_NAME_getsetters,
     259             :         .tp_methods = NULL,
     260             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     261             :         .tp_new = py_PAC_LOGON_NAME_new,
     262             : };
     263             : 
     264             : 
     265           0 : static PyObject *py_PAC_SIGNATURE_DATA_get_type(PyObject *obj, void *closure)
     266             : {
     267           0 :         struct PAC_SIGNATURE_DATA *object = (struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(obj);
     268             :         PyObject *py_type;
     269           0 :         py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
     270           0 :         return py_type;
     271             : }
     272             : 
     273           0 : static int py_PAC_SIGNATURE_DATA_set_type(PyObject *py_obj, PyObject *value, void *closure)
     274             : {
     275           0 :         struct PAC_SIGNATURE_DATA *object = (struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(py_obj);
     276           0 :         if (value == NULL) {
     277           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
     278           0 :                 return -1;
     279             :         }
     280             :         {
     281           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
     282           0 :                 if (PyLong_Check(value)) {
     283             :                         unsigned long long test_var;
     284           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     285           0 :                         if (PyErr_Occurred() != NULL) {
     286           0 :                                 return -1;
     287             :                         }
     288           0 :                         if (test_var > uint_max) {
     289           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     290             :                                   PyLong_Type.tp_name, uint_max, test_var);
     291           0 :                                 return -1;
     292             :                         }
     293           0 :                         object->type = test_var;
     294             :                 } else {
     295           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     296             :                           PyLong_Type.tp_name);
     297           0 :                         return -1;
     298             :                 }
     299             :         }
     300           0 :         return 0;
     301             : }
     302             : 
     303           0 : static PyObject *py_PAC_SIGNATURE_DATA_get_signature(PyObject *obj, void *closure)
     304             : {
     305           0 :         struct PAC_SIGNATURE_DATA *object = (struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(obj);
     306             :         PyObject *py_signature;
     307           0 :         py_signature = PyBytes_FromStringAndSize((char *)(object->signature).data, (object->signature).length);
     308           0 :         return py_signature;
     309             : }
     310             : 
     311           0 : static int py_PAC_SIGNATURE_DATA_set_signature(PyObject *py_obj, PyObject *value, void *closure)
     312             : {
     313           0 :         struct PAC_SIGNATURE_DATA *object = (struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(py_obj);
     314           0 :         if (value == NULL) {
     315           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->signature");
     316           0 :                 return -1;
     317             :         }
     318           0 :         object->signature = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
     319           0 :         return 0;
     320             : }
     321             : 
     322             : static PyGetSetDef py_PAC_SIGNATURE_DATA_getsetters[] = {
     323             :         {
     324             :                 .name = discard_const_p(char, "type"),
     325             :                 .get = py_PAC_SIGNATURE_DATA_get_type,
     326             :                 .set = py_PAC_SIGNATURE_DATA_set_type,
     327             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     328             :         },
     329             :         {
     330             :                 .name = discard_const_p(char, "signature"),
     331             :                 .get = py_PAC_SIGNATURE_DATA_get_signature,
     332             :                 .set = py_PAC_SIGNATURE_DATA_set_signature,
     333             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
     334             :         },
     335             :         { .name = NULL }
     336             : };
     337             : 
     338           0 : static PyObject *py_PAC_SIGNATURE_DATA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     339             : {
     340           0 :         return pytalloc_new(struct PAC_SIGNATURE_DATA, type);
     341             : }
     342             : 
     343           0 : static PyObject *py_PAC_SIGNATURE_DATA_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
     344             : {
     345           0 :         struct PAC_SIGNATURE_DATA *object = (struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(py_obj);
     346           0 :         PyObject *ret = NULL;
     347             :         DATA_BLOB blob;
     348             :         enum ndr_err_code err;
     349           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
     350           0 :         if (tmp_ctx == NULL) {
     351           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
     352           0 :                 return NULL;
     353             :         }
     354           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_SIGNATURE_DATA);
     355           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     356           0 :                 TALLOC_FREE(tmp_ctx);
     357           0 :                 PyErr_SetNdrError(err);
     358           0 :                 return NULL;
     359             :         }
     360             : 
     361           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
     362           0 :         TALLOC_FREE(tmp_ctx);
     363           0 :         return ret;
     364             : }
     365             : 
     366           0 : static PyObject *py_PAC_SIGNATURE_DATA_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
     367             : {
     368           0 :         struct PAC_SIGNATURE_DATA *object = (struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(py_obj);
     369           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
     370           0 :         Py_ssize_t blob_length = 0;
     371             :         enum ndr_err_code err;
     372           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
     373           0 :         PyObject *allow_remaining_obj = NULL;
     374           0 :         bool allow_remaining = false;
     375             : 
     376           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
     377             :                 discard_const_p(char *, kwnames),
     378             :                 &blob.data, &blob_length,
     379             :                 &allow_remaining_obj)) {
     380           0 :                 return NULL;
     381             :         }
     382           0 :         blob.length = blob_length;
     383             : 
     384           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
     385           0 :                 allow_remaining = true;
     386             :         }
     387             : 
     388           0 :         if (allow_remaining) {
     389           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_SIGNATURE_DATA);
     390             :         } else {
     391           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_SIGNATURE_DATA);
     392             :         }
     393           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     394           0 :                 PyErr_SetNdrError(err);
     395           0 :                 return NULL;
     396             :         }
     397             : 
     398           0 :         Py_RETURN_NONE;
     399             : }
     400             : 
     401           0 : static PyObject *py_PAC_SIGNATURE_DATA_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
     402             : {
     403           0 :         struct PAC_SIGNATURE_DATA *object = (struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(py_obj);
     404             :         PyObject *ret;
     405             :         char *retstr;
     406             : 
     407           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_SIGNATURE_DATA, "PAC_SIGNATURE_DATA", object);
     408           0 :         ret = PyUnicode_FromString(retstr);
     409           0 :         talloc_free(retstr);
     410             : 
     411           0 :         return ret;
     412             : }
     413             : 
     414             : static PyMethodDef py_PAC_SIGNATURE_DATA_methods[] = {
     415             :         { "__ndr_pack__", (PyCFunction)py_PAC_SIGNATURE_DATA_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
     416             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_SIGNATURE_DATA_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
     417             :         { "__ndr_print__", (PyCFunction)py_PAC_SIGNATURE_DATA_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
     418             :         { NULL, NULL, 0, NULL }
     419             : };
     420             : 
     421             : 
     422             : static PyTypeObject PAC_SIGNATURE_DATA_Type = {
     423             :         PyVarObject_HEAD_INIT(NULL, 0)
     424             :         .tp_name = "krb5pac.PAC_SIGNATURE_DATA",
     425             :         .tp_getset = py_PAC_SIGNATURE_DATA_getsetters,
     426             :         .tp_methods = py_PAC_SIGNATURE_DATA_methods,
     427             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     428             :         .tp_new = py_PAC_SIGNATURE_DATA_new,
     429             : };
     430             : 
     431             : 
     432           0 : static PyObject *py_PAC_DOMAIN_GROUP_MEMBERSHIP_get_domain_sid(PyObject *obj, void *closure)
     433             : {
     434           0 :         struct PAC_DOMAIN_GROUP_MEMBERSHIP *object = (struct PAC_DOMAIN_GROUP_MEMBERSHIP *)pytalloc_get_ptr(obj);
     435             :         PyObject *py_domain_sid;
     436           0 :         if (object->domain_sid == NULL) {
     437           0 :                 Py_RETURN_NONE;
     438             :         }
     439           0 :         if (object->domain_sid == NULL) {
     440           0 :                 py_domain_sid = Py_None;
     441           0 :                 Py_INCREF(py_domain_sid);
     442             :         } else {
     443           0 :                 py_domain_sid = pytalloc_reference_ex(dom_sid_Type, object->domain_sid, object->domain_sid);
     444             :         }
     445           0 :         return py_domain_sid;
     446             : }
     447             : 
     448           0 : static int py_PAC_DOMAIN_GROUP_MEMBERSHIP_set_domain_sid(PyObject *py_obj, PyObject *value, void *closure)
     449             : {
     450           0 :         struct PAC_DOMAIN_GROUP_MEMBERSHIP *object = (struct PAC_DOMAIN_GROUP_MEMBERSHIP *)pytalloc_get_ptr(py_obj);
     451           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->domain_sid));
     452           0 :         if (value == NULL) {
     453           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->domain_sid");
     454           0 :                 return -1;
     455             :         }
     456           0 :         if (value == Py_None) {
     457           0 :                 object->domain_sid = NULL;
     458             :         } else {
     459           0 :                 object->domain_sid = NULL;
     460           0 :                 PY_CHECK_TYPE(dom_sid_Type, value, return -1;);
     461           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     462           0 :                         PyErr_NoMemory();
     463           0 :                         return -1;
     464             :                 }
     465           0 :                 object->domain_sid = (struct dom_sid *)pytalloc_get_ptr(value);
     466             :         }
     467           0 :         return 0;
     468             : }
     469             : 
     470           0 : static PyObject *py_PAC_DOMAIN_GROUP_MEMBERSHIP_get_groups(PyObject *obj, void *closure)
     471             : {
     472           0 :         struct PAC_DOMAIN_GROUP_MEMBERSHIP *object = (struct PAC_DOMAIN_GROUP_MEMBERSHIP *)pytalloc_get_ptr(obj);
     473             :         PyObject *py_groups;
     474           0 :         py_groups = pytalloc_reference_ex(samr_RidWithAttributeArray_Type, pytalloc_get_mem_ctx(obj), &object->groups);
     475           0 :         return py_groups;
     476             : }
     477             : 
     478           0 : static int py_PAC_DOMAIN_GROUP_MEMBERSHIP_set_groups(PyObject *py_obj, PyObject *value, void *closure)
     479             : {
     480           0 :         struct PAC_DOMAIN_GROUP_MEMBERSHIP *object = (struct PAC_DOMAIN_GROUP_MEMBERSHIP *)pytalloc_get_ptr(py_obj);
     481           0 :         if (value == NULL) {
     482           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->groups");
     483           0 :                 return -1;
     484             :         }
     485           0 :         PY_CHECK_TYPE(samr_RidWithAttributeArray_Type, value, return -1;);
     486           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     487           0 :                 PyErr_NoMemory();
     488           0 :                 return -1;
     489             :         }
     490           0 :         object->groups = *(struct samr_RidWithAttributeArray *)pytalloc_get_ptr(value);
     491           0 :         return 0;
     492             : }
     493             : 
     494             : static PyGetSetDef py_PAC_DOMAIN_GROUP_MEMBERSHIP_getsetters[] = {
     495             :         {
     496             :                 .name = discard_const_p(char, "domain_sid"),
     497             :                 .get = py_PAC_DOMAIN_GROUP_MEMBERSHIP_get_domain_sid,
     498             :                 .set = py_PAC_DOMAIN_GROUP_MEMBERSHIP_set_domain_sid,
     499             :                 .doc = discard_const_p(char, "PIDL-generated element of base type dom_sid2")
     500             :         },
     501             :         {
     502             :                 .name = discard_const_p(char, "groups"),
     503             :                 .get = py_PAC_DOMAIN_GROUP_MEMBERSHIP_get_groups,
     504             :                 .set = py_PAC_DOMAIN_GROUP_MEMBERSHIP_set_groups,
     505             :                 .doc = discard_const_p(char, "PIDL-generated element of base type samr_RidWithAttributeArray")
     506             :         },
     507             :         { .name = NULL }
     508             : };
     509             : 
     510           0 : static PyObject *py_PAC_DOMAIN_GROUP_MEMBERSHIP_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     511             : {
     512           0 :         return pytalloc_new(struct PAC_DOMAIN_GROUP_MEMBERSHIP, type);
     513             : }
     514             : 
     515             : 
     516             : static PyTypeObject PAC_DOMAIN_GROUP_MEMBERSHIP_Type = {
     517             :         PyVarObject_HEAD_INIT(NULL, 0)
     518             :         .tp_name = "krb5pac.PAC_DOMAIN_GROUP_MEMBERSHIP",
     519             :         .tp_getset = py_PAC_DOMAIN_GROUP_MEMBERSHIP_getsetters,
     520             :         .tp_methods = NULL,
     521             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     522             :         .tp_new = py_PAC_DOMAIN_GROUP_MEMBERSHIP_new,
     523             : };
     524             : 
     525             : 
     526          12 : static PyObject *py_PAC_LOGON_INFO_get_info3(PyObject *obj, void *closure)
     527             : {
     528          12 :         struct PAC_LOGON_INFO *object = (struct PAC_LOGON_INFO *)pytalloc_get_ptr(obj);
     529             :         PyObject *py_info3;
     530          12 :         py_info3 = pytalloc_reference_ex(netr_SamInfo3_Type, pytalloc_get_mem_ctx(obj), &object->info3);
     531          12 :         return py_info3;
     532             : }
     533             : 
     534           0 : static int py_PAC_LOGON_INFO_set_info3(PyObject *py_obj, PyObject *value, void *closure)
     535             : {
     536           0 :         struct PAC_LOGON_INFO *object = (struct PAC_LOGON_INFO *)pytalloc_get_ptr(py_obj);
     537           0 :         if (value == NULL) {
     538           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info3");
     539           0 :                 return -1;
     540             :         }
     541           0 :         PY_CHECK_TYPE(netr_SamInfo3_Type, value, return -1;);
     542           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     543           0 :                 PyErr_NoMemory();
     544           0 :                 return -1;
     545             :         }
     546           0 :         object->info3 = *(struct netr_SamInfo3 *)pytalloc_get_ptr(value);
     547           0 :         return 0;
     548             : }
     549             : 
     550           0 : static PyObject *py_PAC_LOGON_INFO_get_resource_groups(PyObject *obj, void *closure)
     551             : {
     552           0 :         struct PAC_LOGON_INFO *object = (struct PAC_LOGON_INFO *)pytalloc_get_ptr(obj);
     553             :         PyObject *py_resource_groups;
     554           0 :         py_resource_groups = pytalloc_reference_ex(&PAC_DOMAIN_GROUP_MEMBERSHIP_Type, pytalloc_get_mem_ctx(obj), &object->resource_groups);
     555           0 :         return py_resource_groups;
     556             : }
     557             : 
     558           0 : static int py_PAC_LOGON_INFO_set_resource_groups(PyObject *py_obj, PyObject *value, void *closure)
     559             : {
     560           0 :         struct PAC_LOGON_INFO *object = (struct PAC_LOGON_INFO *)pytalloc_get_ptr(py_obj);
     561           0 :         if (value == NULL) {
     562           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->resource_groups");
     563           0 :                 return -1;
     564             :         }
     565           0 :         PY_CHECK_TYPE(&PAC_DOMAIN_GROUP_MEMBERSHIP_Type, value, return -1;);
     566           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     567           0 :                 PyErr_NoMemory();
     568           0 :                 return -1;
     569             :         }
     570           0 :         object->resource_groups = *(struct PAC_DOMAIN_GROUP_MEMBERSHIP *)pytalloc_get_ptr(value);
     571           0 :         return 0;
     572             : }
     573             : 
     574             : static PyGetSetDef py_PAC_LOGON_INFO_getsetters[] = {
     575             :         {
     576             :                 .name = discard_const_p(char, "info3"),
     577             :                 .get = py_PAC_LOGON_INFO_get_info3,
     578             :                 .set = py_PAC_LOGON_INFO_set_info3,
     579             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamInfo3")
     580             :         },
     581             :         {
     582             :                 .name = discard_const_p(char, "resource_groups"),
     583             :                 .get = py_PAC_LOGON_INFO_get_resource_groups,
     584             :                 .set = py_PAC_LOGON_INFO_set_resource_groups,
     585             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_DOMAIN_GROUP_MEMBERSHIP")
     586             :         },
     587             :         { .name = NULL }
     588             : };
     589             : 
     590           0 : static PyObject *py_PAC_LOGON_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     591             : {
     592           0 :         return pytalloc_new(struct PAC_LOGON_INFO, type);
     593             : }
     594             : 
     595             : 
     596             : static PyTypeObject PAC_LOGON_INFO_Type = {
     597             :         PyVarObject_HEAD_INIT(NULL, 0)
     598             :         .tp_name = "krb5pac.PAC_LOGON_INFO",
     599             :         .tp_getset = py_PAC_LOGON_INFO_getsetters,
     600             :         .tp_methods = NULL,
     601             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     602             :         .tp_new = py_PAC_LOGON_INFO_new,
     603             : };
     604             : 
     605             : 
     606           0 : static PyObject *py_PAC_CREDENTIAL_NTLM_SECPKG_get_version(PyObject *obj, void *closure)
     607             : {
     608           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(obj);
     609             :         PyObject *py_version;
     610           0 :         py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
     611           0 :         return py_version;
     612             : }
     613             : 
     614           0 : static int py_PAC_CREDENTIAL_NTLM_SECPKG_set_version(PyObject *py_obj, PyObject *value, void *closure)
     615             : {
     616           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(py_obj);
     617           0 :         if (value == NULL) {
     618           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
     619           0 :                 return -1;
     620             :         }
     621             :         {
     622           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
     623           0 :                 if (PyLong_Check(value)) {
     624             :                         unsigned long long test_var;
     625           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     626           0 :                         if (PyErr_Occurred() != NULL) {
     627           0 :                                 return -1;
     628             :                         }
     629           0 :                         if (test_var > uint_max) {
     630           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     631             :                                   PyLong_Type.tp_name, uint_max, test_var);
     632           0 :                                 return -1;
     633             :                         }
     634           0 :                         object->version = test_var;
     635             :                 } else {
     636           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     637             :                           PyLong_Type.tp_name);
     638           0 :                         return -1;
     639             :                 }
     640             :         }
     641           0 :         return 0;
     642             : }
     643             : 
     644           0 : static PyObject *py_PAC_CREDENTIAL_NTLM_SECPKG_get_flags(PyObject *obj, void *closure)
     645             : {
     646           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(obj);
     647             :         PyObject *py_flags;
     648           0 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
     649           0 :         return py_flags;
     650             : }
     651             : 
     652           0 : static int py_PAC_CREDENTIAL_NTLM_SECPKG_set_flags(PyObject *py_obj, PyObject *value, void *closure)
     653             : {
     654           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(py_obj);
     655           0 :         if (value == NULL) {
     656           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
     657           0 :                 return -1;
     658             :         }
     659             :         {
     660           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
     661           0 :                 if (PyLong_Check(value)) {
     662             :                         unsigned long long test_var;
     663           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     664           0 :                         if (PyErr_Occurred() != NULL) {
     665           0 :                                 return -1;
     666             :                         }
     667           0 :                         if (test_var > uint_max) {
     668           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     669             :                                   PyLong_Type.tp_name, uint_max, test_var);
     670           0 :                                 return -1;
     671             :                         }
     672           0 :                         object->flags = test_var;
     673             :                 } else {
     674           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     675             :                           PyLong_Type.tp_name);
     676           0 :                         return -1;
     677             :                 }
     678             :         }
     679           0 :         return 0;
     680             : }
     681             : 
     682           0 : static PyObject *py_PAC_CREDENTIAL_NTLM_SECPKG_get_lm_password(PyObject *obj, void *closure)
     683             : {
     684           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(obj);
     685             :         PyObject *py_lm_password;
     686           0 :         py_lm_password = pytalloc_reference_ex(samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->lm_password);
     687           0 :         return py_lm_password;
     688             : }
     689             : 
     690           0 : static int py_PAC_CREDENTIAL_NTLM_SECPKG_set_lm_password(PyObject *py_obj, PyObject *value, void *closure)
     691             : {
     692           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(py_obj);
     693           0 :         if (value == NULL) {
     694           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->lm_password");
     695           0 :                 return -1;
     696             :         }
     697           0 :         PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
     698           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     699           0 :                 PyErr_NoMemory();
     700           0 :                 return -1;
     701             :         }
     702           0 :         object->lm_password = *(struct samr_Password *)pytalloc_get_ptr(value);
     703           0 :         return 0;
     704             : }
     705             : 
     706           0 : static PyObject *py_PAC_CREDENTIAL_NTLM_SECPKG_get_nt_password(PyObject *obj, void *closure)
     707             : {
     708           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(obj);
     709             :         PyObject *py_nt_password;
     710           0 :         py_nt_password = pytalloc_reference_ex(samr_Password_Type, pytalloc_get_mem_ctx(obj), &object->nt_password);
     711           0 :         return py_nt_password;
     712             : }
     713             : 
     714           0 : static int py_PAC_CREDENTIAL_NTLM_SECPKG_set_nt_password(PyObject *py_obj, PyObject *value, void *closure)
     715             : {
     716           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(py_obj);
     717           0 :         if (value == NULL) {
     718           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->nt_password");
     719           0 :                 return -1;
     720             :         }
     721           0 :         PY_CHECK_TYPE(samr_Password_Type, value, return -1;);
     722           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     723           0 :                 PyErr_NoMemory();
     724           0 :                 return -1;
     725             :         }
     726           0 :         object->nt_password = *(struct samr_Password *)pytalloc_get_ptr(value);
     727           0 :         return 0;
     728             : }
     729             : 
     730             : static PyGetSetDef py_PAC_CREDENTIAL_NTLM_SECPKG_getsetters[] = {
     731             :         {
     732             :                 .name = discard_const_p(char, "version"),
     733             :                 .get = py_PAC_CREDENTIAL_NTLM_SECPKG_get_version,
     734             :                 .set = py_PAC_CREDENTIAL_NTLM_SECPKG_set_version,
     735             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     736             :         },
     737             :         {
     738             :                 .name = discard_const_p(char, "flags"),
     739             :                 .get = py_PAC_CREDENTIAL_NTLM_SECPKG_get_flags,
     740             :                 .set = py_PAC_CREDENTIAL_NTLM_SECPKG_set_flags,
     741             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_CREDENTIAL_NTLM_FLAGS")
     742             :         },
     743             :         {
     744             :                 .name = discard_const_p(char, "lm_password"),
     745             :                 .get = py_PAC_CREDENTIAL_NTLM_SECPKG_get_lm_password,
     746             :                 .set = py_PAC_CREDENTIAL_NTLM_SECPKG_set_lm_password,
     747             :                 .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
     748             :         },
     749             :         {
     750             :                 .name = discard_const_p(char, "nt_password"),
     751             :                 .get = py_PAC_CREDENTIAL_NTLM_SECPKG_get_nt_password,
     752             :                 .set = py_PAC_CREDENTIAL_NTLM_SECPKG_set_nt_password,
     753             :                 .doc = discard_const_p(char, "PIDL-generated element of base type samr_Password")
     754             :         },
     755             :         { .name = NULL }
     756             : };
     757             : 
     758           0 : static PyObject *py_PAC_CREDENTIAL_NTLM_SECPKG_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     759             : {
     760           0 :         return pytalloc_new(struct PAC_CREDENTIAL_NTLM_SECPKG, type);
     761             : }
     762             : 
     763           0 : static PyObject *py_PAC_CREDENTIAL_NTLM_SECPKG_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
     764             : {
     765           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(py_obj);
     766           0 :         PyObject *ret = NULL;
     767             :         DATA_BLOB blob;
     768             :         enum ndr_err_code err;
     769           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
     770           0 :         if (tmp_ctx == NULL) {
     771           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
     772           0 :                 return NULL;
     773             :         }
     774           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_CREDENTIAL_NTLM_SECPKG);
     775           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     776           0 :                 TALLOC_FREE(tmp_ctx);
     777           0 :                 PyErr_SetNdrError(err);
     778           0 :                 return NULL;
     779             :         }
     780             : 
     781           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
     782           0 :         TALLOC_FREE(tmp_ctx);
     783           0 :         return ret;
     784             : }
     785             : 
     786           0 : static PyObject *py_PAC_CREDENTIAL_NTLM_SECPKG_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
     787             : {
     788           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(py_obj);
     789           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
     790           0 :         Py_ssize_t blob_length = 0;
     791             :         enum ndr_err_code err;
     792           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
     793           0 :         PyObject *allow_remaining_obj = NULL;
     794           0 :         bool allow_remaining = false;
     795             : 
     796           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
     797             :                 discard_const_p(char *, kwnames),
     798             :                 &blob.data, &blob_length,
     799             :                 &allow_remaining_obj)) {
     800           0 :                 return NULL;
     801             :         }
     802           0 :         blob.length = blob_length;
     803             : 
     804           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
     805           0 :                 allow_remaining = true;
     806             :         }
     807             : 
     808           0 :         if (allow_remaining) {
     809           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_NTLM_SECPKG);
     810             :         } else {
     811           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_NTLM_SECPKG);
     812             :         }
     813           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
     814           0 :                 PyErr_SetNdrError(err);
     815           0 :                 return NULL;
     816             :         }
     817             : 
     818           0 :         Py_RETURN_NONE;
     819             : }
     820             : 
     821           0 : static PyObject *py_PAC_CREDENTIAL_NTLM_SECPKG_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
     822             : {
     823           0 :         struct PAC_CREDENTIAL_NTLM_SECPKG *object = (struct PAC_CREDENTIAL_NTLM_SECPKG *)pytalloc_get_ptr(py_obj);
     824             :         PyObject *ret;
     825             :         char *retstr;
     826             : 
     827           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_CREDENTIAL_NTLM_SECPKG, "PAC_CREDENTIAL_NTLM_SECPKG", object);
     828           0 :         ret = PyUnicode_FromString(retstr);
     829           0 :         talloc_free(retstr);
     830             : 
     831           0 :         return ret;
     832             : }
     833             : 
     834             : static PyMethodDef py_PAC_CREDENTIAL_NTLM_SECPKG_methods[] = {
     835             :         { "__ndr_pack__", (PyCFunction)py_PAC_CREDENTIAL_NTLM_SECPKG_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
     836             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_CREDENTIAL_NTLM_SECPKG_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
     837             :         { "__ndr_print__", (PyCFunction)py_PAC_CREDENTIAL_NTLM_SECPKG_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
     838             :         { NULL, NULL, 0, NULL }
     839             : };
     840             : 
     841             : 
     842             : static PyTypeObject PAC_CREDENTIAL_NTLM_SECPKG_Type = {
     843             :         PyVarObject_HEAD_INIT(NULL, 0)
     844             :         .tp_name = "krb5pac.PAC_CREDENTIAL_NTLM_SECPKG",
     845             :         .tp_getset = py_PAC_CREDENTIAL_NTLM_SECPKG_getsetters,
     846             :         .tp_methods = py_PAC_CREDENTIAL_NTLM_SECPKG_methods,
     847             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     848             :         .tp_new = py_PAC_CREDENTIAL_NTLM_SECPKG_new,
     849             : };
     850             : 
     851             : 
     852           0 : static PyObject *py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_get_package_name(PyObject *obj, void *closure)
     853             : {
     854           0 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(obj);
     855             :         PyObject *py_package_name;
     856           0 :         py_package_name = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->package_name);
     857           0 :         return py_package_name;
     858             : }
     859             : 
     860           0 : static int py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_set_package_name(PyObject *py_obj, PyObject *value, void *closure)
     861             : {
     862           0 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(py_obj);
     863           0 :         if (value == NULL) {
     864           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->package_name");
     865           0 :                 return -1;
     866             :         }
     867           0 :         PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
     868           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
     869           0 :                 PyErr_NoMemory();
     870           0 :                 return -1;
     871             :         }
     872           0 :         object->package_name = *(struct lsa_String *)pytalloc_get_ptr(value);
     873           0 :         return 0;
     874             : }
     875             : 
     876           0 : static PyObject *py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_get_credential_size(PyObject *obj, void *closure)
     877             : {
     878           0 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(obj);
     879             :         PyObject *py_credential_size;
     880           0 :         py_credential_size = PyLong_FromUnsignedLongLong((uint32_t)object->credential_size);
     881           0 :         return py_credential_size;
     882             : }
     883             : 
     884           0 : static int py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_set_credential_size(PyObject *py_obj, PyObject *value, void *closure)
     885             : {
     886           0 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(py_obj);
     887           0 :         if (value == NULL) {
     888           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->credential_size");
     889           0 :                 return -1;
     890             :         }
     891             :         {
     892           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->credential_size));
     893           0 :                 if (PyLong_Check(value)) {
     894             :                         unsigned long long test_var;
     895           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     896           0 :                         if (PyErr_Occurred() != NULL) {
     897           0 :                                 return -1;
     898             :                         }
     899           0 :                         if (test_var > uint_max) {
     900           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     901             :                                   PyLong_Type.tp_name, uint_max, test_var);
     902           0 :                                 return -1;
     903             :                         }
     904           0 :                         object->credential_size = test_var;
     905             :                 } else {
     906           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     907             :                           PyLong_Type.tp_name);
     908           0 :                         return -1;
     909             :                 }
     910             :         }
     911           0 :         return 0;
     912             : }
     913             : 
     914           0 : static PyObject *py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_get_credential(PyObject *obj, void *closure)
     915             : {
     916           0 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(obj);
     917             :         PyObject *py_credential;
     918           0 :         if (object->credential == NULL) {
     919           0 :                 Py_RETURN_NONE;
     920             :         }
     921           0 :         if (object->credential == NULL) {
     922           0 :                 py_credential = Py_None;
     923           0 :                 Py_INCREF(py_credential);
     924             :         } else {
     925           0 :                 py_credential = PyList_New(object->credential_size);
     926           0 :                 if (py_credential == NULL) {
     927           0 :                         return NULL;
     928             :                 }
     929             :                 {
     930             :                         int credential_cntr_1;
     931           0 :                         for (credential_cntr_1 = 0; credential_cntr_1 < (object->credential_size); credential_cntr_1++) {
     932             :                                 PyObject *py_credential_1;
     933           0 :                                 py_credential_1 = PyLong_FromLong((uint16_t)object->credential[credential_cntr_1]);
     934           0 :                                 PyList_SetItem(py_credential, credential_cntr_1, py_credential_1);
     935             :                         }
     936             :                 }
     937             :         }
     938           0 :         return py_credential;
     939             : }
     940             : 
     941           0 : static int py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_set_credential(PyObject *py_obj, PyObject *value, void *closure)
     942             : {
     943           0 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(py_obj);
     944           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->credential));
     945           0 :         if (value == NULL) {
     946           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->credential");
     947           0 :                 return -1;
     948             :         }
     949           0 :         if (value == Py_None) {
     950           0 :                 object->credential = NULL;
     951             :         } else {
     952           0 :                 object->credential = NULL;
     953           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
     954             :                 {
     955             :                         int credential_cntr_1;
     956           0 :                         object->credential = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->credential, PyList_GET_SIZE(value));
     957           0 :                         if (!object->credential) { return -1;; }
     958           0 :                         talloc_set_name_const(object->credential, "ARRAY: object->credential");
     959           0 :                         for (credential_cntr_1 = 0; credential_cntr_1 < PyList_GET_SIZE(value); credential_cntr_1++) {
     960           0 :                                 if (PyList_GET_ITEM(value, credential_cntr_1) == NULL) {
     961           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->credential[credential_cntr_1]");
     962           0 :                                         return -1;
     963             :                                 }
     964             :                                 {
     965           0 :                                         const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->credential[credential_cntr_1]));
     966           0 :                                         if (PyLong_Check(PyList_GET_ITEM(value, credential_cntr_1))) {
     967             :                                                 unsigned long long test_var;
     968           0 :                                                 test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, credential_cntr_1));
     969           0 :                                                 if (PyErr_Occurred() != NULL) {
     970           0 :                                                         return -1;
     971             :                                                 }
     972           0 :                                                 if (test_var > uint_max) {
     973           0 :                                                         PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     974             :                                                           PyLong_Type.tp_name, uint_max, test_var);
     975           0 :                                                         return -1;
     976             :                                                 }
     977           0 :                                                 object->credential[credential_cntr_1] = test_var;
     978             :                                         } else {
     979           0 :                                                 PyErr_Format(PyExc_TypeError, "Expected type %s",\
     980             :                                                   PyLong_Type.tp_name);
     981           0 :                                                 return -1;
     982             :                                         }
     983             :                                 }
     984             :                         }
     985             :                 }
     986             :         }
     987           0 :         return 0;
     988             : }
     989             : 
     990             : static PyGetSetDef py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_getsetters[] = {
     991             :         {
     992             :                 .name = discard_const_p(char, "package_name"),
     993             :                 .get = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_get_package_name,
     994             :                 .set = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_set_package_name,
     995             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
     996             :         },
     997             :         {
     998             :                 .name = discard_const_p(char, "credential_size"),
     999             :                 .get = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_get_credential_size,
    1000             :                 .set = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_set_credential_size,
    1001             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1002             :         },
    1003             :         {
    1004             :                 .name = discard_const_p(char, "credential"),
    1005             :                 .get = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_get_credential,
    1006             :                 .set = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_set_credential,
    1007             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint8")
    1008             :         },
    1009             :         { .name = NULL }
    1010             : };
    1011             : 
    1012           0 : static PyObject *py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1013             : {
    1014           0 :         return pytalloc_new(struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG, type);
    1015             : }
    1016             : 
    1017           0 : static PyObject *py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1018             : {
    1019           0 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(py_obj);
    1020           0 :         PyObject *ret = NULL;
    1021             :         DATA_BLOB blob;
    1022             :         enum ndr_err_code err;
    1023           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1024           0 :         if (tmp_ctx == NULL) {
    1025           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1026           0 :                 return NULL;
    1027             :         }
    1028           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG);
    1029           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1030           0 :                 TALLOC_FREE(tmp_ctx);
    1031           0 :                 PyErr_SetNdrError(err);
    1032           0 :                 return NULL;
    1033             :         }
    1034             : 
    1035           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1036           0 :         TALLOC_FREE(tmp_ctx);
    1037           0 :         return ret;
    1038             : }
    1039             : 
    1040           0 : static PyObject *py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1041             : {
    1042           0 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(py_obj);
    1043           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1044           0 :         Py_ssize_t blob_length = 0;
    1045             :         enum ndr_err_code err;
    1046           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1047           0 :         PyObject *allow_remaining_obj = NULL;
    1048           0 :         bool allow_remaining = false;
    1049             : 
    1050           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1051             :                 discard_const_p(char *, kwnames),
    1052             :                 &blob.data, &blob_length,
    1053             :                 &allow_remaining_obj)) {
    1054           0 :                 return NULL;
    1055             :         }
    1056           0 :         blob.length = blob_length;
    1057             : 
    1058           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1059           0 :                 allow_remaining = true;
    1060             :         }
    1061             : 
    1062           0 :         if (allow_remaining) {
    1063           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG);
    1064             :         } else {
    1065           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG);
    1066             :         }
    1067           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1068           0 :                 PyErr_SetNdrError(err);
    1069           0 :                 return NULL;
    1070             :         }
    1071             : 
    1072           0 :         Py_RETURN_NONE;
    1073             : }
    1074             : 
    1075           0 : static PyObject *py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1076             : {
    1077           0 :         struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *object = (struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(py_obj);
    1078             :         PyObject *ret;
    1079             :         char *retstr;
    1080             : 
    1081           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG, "PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG", object);
    1082           0 :         ret = PyUnicode_FromString(retstr);
    1083           0 :         talloc_free(retstr);
    1084             : 
    1085           0 :         return ret;
    1086             : }
    1087             : 
    1088             : static PyMethodDef py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_methods[] = {
    1089             :         { "__ndr_pack__", (PyCFunction)py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1090             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1091             :         { "__ndr_print__", (PyCFunction)py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1092             :         { NULL, NULL, 0, NULL }
    1093             : };
    1094             : 
    1095             : 
    1096             : static PyTypeObject PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type = {
    1097             :         PyVarObject_HEAD_INIT(NULL, 0)
    1098             :         .tp_name = "krb5pac.PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG",
    1099             :         .tp_getset = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_getsetters,
    1100             :         .tp_methods = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_methods,
    1101             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1102             :         .tp_new = py_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_new,
    1103             : };
    1104             : 
    1105             : 
    1106           0 : static PyObject *py_PAC_CREDENTIAL_DATA_get_credential_count(PyObject *obj, void *closure)
    1107             : {
    1108           0 :         struct PAC_CREDENTIAL_DATA *object = (struct PAC_CREDENTIAL_DATA *)pytalloc_get_ptr(obj);
    1109             :         PyObject *py_credential_count;
    1110           0 :         py_credential_count = PyLong_FromUnsignedLongLong((uint32_t)object->credential_count);
    1111           0 :         return py_credential_count;
    1112             : }
    1113             : 
    1114           0 : static int py_PAC_CREDENTIAL_DATA_set_credential_count(PyObject *py_obj, PyObject *value, void *closure)
    1115             : {
    1116           0 :         struct PAC_CREDENTIAL_DATA *object = (struct PAC_CREDENTIAL_DATA *)pytalloc_get_ptr(py_obj);
    1117           0 :         if (value == NULL) {
    1118           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->credential_count");
    1119           0 :                 return -1;
    1120             :         }
    1121             :         {
    1122           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->credential_count));
    1123           0 :                 if (PyLong_Check(value)) {
    1124             :                         unsigned long long test_var;
    1125           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1126           0 :                         if (PyErr_Occurred() != NULL) {
    1127           0 :                                 return -1;
    1128             :                         }
    1129           0 :                         if (test_var > uint_max) {
    1130           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1131             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1132           0 :                                 return -1;
    1133             :                         }
    1134           0 :                         object->credential_count = test_var;
    1135             :                 } else {
    1136           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1137             :                           PyLong_Type.tp_name);
    1138           0 :                         return -1;
    1139             :                 }
    1140             :         }
    1141           0 :         return 0;
    1142             : }
    1143             : 
    1144           0 : static PyObject *py_PAC_CREDENTIAL_DATA_get_credentials(PyObject *obj, void *closure)
    1145             : {
    1146           0 :         struct PAC_CREDENTIAL_DATA *object = (struct PAC_CREDENTIAL_DATA *)pytalloc_get_ptr(obj);
    1147             :         PyObject *py_credentials;
    1148           0 :         py_credentials = PyList_New(object->credential_count);
    1149           0 :         if (py_credentials == NULL) {
    1150           0 :                 return NULL;
    1151             :         }
    1152             :         {
    1153             :                 int credentials_cntr_0;
    1154           0 :                 for (credentials_cntr_0 = 0; credentials_cntr_0 < (object->credential_count); credentials_cntr_0++) {
    1155             :                         PyObject *py_credentials_0;
    1156           0 :                         py_credentials_0 = pytalloc_reference_ex(&PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type, object->credentials, &object->credentials[credentials_cntr_0]);
    1157           0 :                         PyList_SetItem(py_credentials, credentials_cntr_0, py_credentials_0);
    1158             :                 }
    1159             :         }
    1160           0 :         return py_credentials;
    1161             : }
    1162             : 
    1163           0 : static int py_PAC_CREDENTIAL_DATA_set_credentials(PyObject *py_obj, PyObject *value, void *closure)
    1164             : {
    1165           0 :         struct PAC_CREDENTIAL_DATA *object = (struct PAC_CREDENTIAL_DATA *)pytalloc_get_ptr(py_obj);
    1166           0 :         if (value == NULL) {
    1167           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->credentials");
    1168           0 :                 return -1;
    1169             :         }
    1170           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    1171             :         {
    1172             :                 int credentials_cntr_0;
    1173           0 :                 object->credentials = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->credentials, PyList_GET_SIZE(value));
    1174           0 :                 if (!object->credentials) { return -1;; }
    1175           0 :                 talloc_set_name_const(object->credentials, "ARRAY: object->credentials");
    1176           0 :                 for (credentials_cntr_0 = 0; credentials_cntr_0 < PyList_GET_SIZE(value); credentials_cntr_0++) {
    1177           0 :                         if (PyList_GET_ITEM(value, credentials_cntr_0) == NULL) {
    1178           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->credentials[credentials_cntr_0]");
    1179           0 :                                 return -1;
    1180             :                         }
    1181           0 :                         PY_CHECK_TYPE(&PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type, PyList_GET_ITEM(value, credentials_cntr_0), return -1;);
    1182           0 :                         if (talloc_reference(object->credentials, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, credentials_cntr_0))) == NULL) {
    1183           0 :                                 PyErr_NoMemory();
    1184           0 :                                 return -1;
    1185             :                         }
    1186           0 :                         object->credentials[credentials_cntr_0] = *(struct PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG *)pytalloc_get_ptr(PyList_GET_ITEM(value, credentials_cntr_0));
    1187             :                 }
    1188             :         }
    1189           0 :         return 0;
    1190             : }
    1191             : 
    1192             : static PyGetSetDef py_PAC_CREDENTIAL_DATA_getsetters[] = {
    1193             :         {
    1194             :                 .name = discard_const_p(char, "credential_count"),
    1195             :                 .get = py_PAC_CREDENTIAL_DATA_get_credential_count,
    1196             :                 .set = py_PAC_CREDENTIAL_DATA_set_credential_count,
    1197             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1198             :         },
    1199             :         {
    1200             :                 .name = discard_const_p(char, "credentials"),
    1201             :                 .get = py_PAC_CREDENTIAL_DATA_get_credentials,
    1202             :                 .set = py_PAC_CREDENTIAL_DATA_set_credentials,
    1203             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG")
    1204             :         },
    1205             :         { .name = NULL }
    1206             : };
    1207             : 
    1208           0 : static PyObject *py_PAC_CREDENTIAL_DATA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1209             : {
    1210           0 :         return pytalloc_new(struct PAC_CREDENTIAL_DATA, type);
    1211             : }
    1212             : 
    1213           0 : static PyObject *py_PAC_CREDENTIAL_DATA_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1214             : {
    1215           0 :         struct PAC_CREDENTIAL_DATA *object = (struct PAC_CREDENTIAL_DATA *)pytalloc_get_ptr(py_obj);
    1216           0 :         PyObject *ret = NULL;
    1217             :         DATA_BLOB blob;
    1218             :         enum ndr_err_code err;
    1219           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1220           0 :         if (tmp_ctx == NULL) {
    1221           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1222           0 :                 return NULL;
    1223             :         }
    1224           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_CREDENTIAL_DATA);
    1225           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1226           0 :                 TALLOC_FREE(tmp_ctx);
    1227           0 :                 PyErr_SetNdrError(err);
    1228           0 :                 return NULL;
    1229             :         }
    1230             : 
    1231           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1232           0 :         TALLOC_FREE(tmp_ctx);
    1233           0 :         return ret;
    1234             : }
    1235             : 
    1236           0 : static PyObject *py_PAC_CREDENTIAL_DATA_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1237             : {
    1238           0 :         struct PAC_CREDENTIAL_DATA *object = (struct PAC_CREDENTIAL_DATA *)pytalloc_get_ptr(py_obj);
    1239           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1240           0 :         Py_ssize_t blob_length = 0;
    1241             :         enum ndr_err_code err;
    1242           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1243           0 :         PyObject *allow_remaining_obj = NULL;
    1244           0 :         bool allow_remaining = false;
    1245             : 
    1246           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1247             :                 discard_const_p(char *, kwnames),
    1248             :                 &blob.data, &blob_length,
    1249             :                 &allow_remaining_obj)) {
    1250           0 :                 return NULL;
    1251             :         }
    1252           0 :         blob.length = blob_length;
    1253             : 
    1254           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1255           0 :                 allow_remaining = true;
    1256             :         }
    1257             : 
    1258           0 :         if (allow_remaining) {
    1259           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_DATA);
    1260             :         } else {
    1261           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_DATA);
    1262             :         }
    1263           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1264           0 :                 PyErr_SetNdrError(err);
    1265           0 :                 return NULL;
    1266             :         }
    1267             : 
    1268           0 :         Py_RETURN_NONE;
    1269             : }
    1270             : 
    1271           0 : static PyObject *py_PAC_CREDENTIAL_DATA_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1272             : {
    1273           0 :         struct PAC_CREDENTIAL_DATA *object = (struct PAC_CREDENTIAL_DATA *)pytalloc_get_ptr(py_obj);
    1274             :         PyObject *ret;
    1275             :         char *retstr;
    1276             : 
    1277           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_CREDENTIAL_DATA, "PAC_CREDENTIAL_DATA", object);
    1278           0 :         ret = PyUnicode_FromString(retstr);
    1279           0 :         talloc_free(retstr);
    1280             : 
    1281           0 :         return ret;
    1282             : }
    1283             : 
    1284             : static PyMethodDef py_PAC_CREDENTIAL_DATA_methods[] = {
    1285             :         { "__ndr_pack__", (PyCFunction)py_PAC_CREDENTIAL_DATA_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1286             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_CREDENTIAL_DATA_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1287             :         { "__ndr_print__", (PyCFunction)py_PAC_CREDENTIAL_DATA_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1288             :         { NULL, NULL, 0, NULL }
    1289             : };
    1290             : 
    1291             : 
    1292             : static PyTypeObject PAC_CREDENTIAL_DATA_Type = {
    1293             :         PyVarObject_HEAD_INIT(NULL, 0)
    1294             :         .tp_name = "krb5pac.PAC_CREDENTIAL_DATA",
    1295             :         .tp_getset = py_PAC_CREDENTIAL_DATA_getsetters,
    1296             :         .tp_methods = py_PAC_CREDENTIAL_DATA_methods,
    1297             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1298             :         .tp_new = py_PAC_CREDENTIAL_DATA_new,
    1299             : };
    1300             : 
    1301             : 
    1302           0 : static PyObject *py_PAC_CREDENTIAL_DATA_CTR_get_data(PyObject *obj, void *closure)
    1303             : {
    1304           0 :         struct PAC_CREDENTIAL_DATA_CTR *object = (struct PAC_CREDENTIAL_DATA_CTR *)pytalloc_get_ptr(obj);
    1305             :         PyObject *py_data;
    1306           0 :         if (object->data == NULL) {
    1307           0 :                 Py_RETURN_NONE;
    1308             :         }
    1309           0 :         if (object->data == NULL) {
    1310           0 :                 py_data = Py_None;
    1311           0 :                 Py_INCREF(py_data);
    1312             :         } else {
    1313           0 :                 py_data = pytalloc_reference_ex(&PAC_CREDENTIAL_DATA_Type, object->data, object->data);
    1314             :         }
    1315           0 :         return py_data;
    1316             : }
    1317             : 
    1318           0 : static int py_PAC_CREDENTIAL_DATA_CTR_set_data(PyObject *py_obj, PyObject *value, void *closure)
    1319             : {
    1320           0 :         struct PAC_CREDENTIAL_DATA_CTR *object = (struct PAC_CREDENTIAL_DATA_CTR *)pytalloc_get_ptr(py_obj);
    1321           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
    1322           0 :         if (value == NULL) {
    1323           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->data");
    1324           0 :                 return -1;
    1325             :         }
    1326           0 :         if (value == Py_None) {
    1327           0 :                 object->data = NULL;
    1328             :         } else {
    1329           0 :                 object->data = NULL;
    1330           0 :                 PY_CHECK_TYPE(&PAC_CREDENTIAL_DATA_Type, value, return -1;);
    1331           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1332           0 :                         PyErr_NoMemory();
    1333           0 :                         return -1;
    1334             :                 }
    1335           0 :                 object->data = (struct PAC_CREDENTIAL_DATA *)pytalloc_get_ptr(value);
    1336             :         }
    1337           0 :         return 0;
    1338             : }
    1339             : 
    1340             : static PyGetSetDef py_PAC_CREDENTIAL_DATA_CTR_getsetters[] = {
    1341             :         {
    1342             :                 .name = discard_const_p(char, "data"),
    1343             :                 .get = py_PAC_CREDENTIAL_DATA_CTR_get_data,
    1344             :                 .set = py_PAC_CREDENTIAL_DATA_CTR_set_data,
    1345             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_CREDENTIAL_DATA")
    1346             :         },
    1347             :         { .name = NULL }
    1348             : };
    1349             : 
    1350           0 : static PyObject *py_PAC_CREDENTIAL_DATA_CTR_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1351             : {
    1352           0 :         return pytalloc_new(struct PAC_CREDENTIAL_DATA_CTR, type);
    1353             : }
    1354             : 
    1355           0 : static PyObject *py_PAC_CREDENTIAL_DATA_CTR_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1356             : {
    1357           0 :         struct PAC_CREDENTIAL_DATA_CTR *object = (struct PAC_CREDENTIAL_DATA_CTR *)pytalloc_get_ptr(py_obj);
    1358           0 :         PyObject *ret = NULL;
    1359             :         DATA_BLOB blob;
    1360             :         enum ndr_err_code err;
    1361           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1362           0 :         if (tmp_ctx == NULL) {
    1363           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1364           0 :                 return NULL;
    1365             :         }
    1366           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_CREDENTIAL_DATA_CTR);
    1367           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1368           0 :                 TALLOC_FREE(tmp_ctx);
    1369           0 :                 PyErr_SetNdrError(err);
    1370           0 :                 return NULL;
    1371             :         }
    1372             : 
    1373           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1374           0 :         TALLOC_FREE(tmp_ctx);
    1375           0 :         return ret;
    1376             : }
    1377             : 
    1378           0 : static PyObject *py_PAC_CREDENTIAL_DATA_CTR_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1379             : {
    1380           0 :         struct PAC_CREDENTIAL_DATA_CTR *object = (struct PAC_CREDENTIAL_DATA_CTR *)pytalloc_get_ptr(py_obj);
    1381           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1382           0 :         Py_ssize_t blob_length = 0;
    1383             :         enum ndr_err_code err;
    1384           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1385           0 :         PyObject *allow_remaining_obj = NULL;
    1386           0 :         bool allow_remaining = false;
    1387             : 
    1388           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1389             :                 discard_const_p(char *, kwnames),
    1390             :                 &blob.data, &blob_length,
    1391             :                 &allow_remaining_obj)) {
    1392           0 :                 return NULL;
    1393             :         }
    1394           0 :         blob.length = blob_length;
    1395             : 
    1396           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1397           0 :                 allow_remaining = true;
    1398             :         }
    1399             : 
    1400           0 :         if (allow_remaining) {
    1401           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_DATA_CTR);
    1402             :         } else {
    1403           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_DATA_CTR);
    1404             :         }
    1405           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1406           0 :                 PyErr_SetNdrError(err);
    1407           0 :                 return NULL;
    1408             :         }
    1409             : 
    1410           0 :         Py_RETURN_NONE;
    1411             : }
    1412             : 
    1413           0 : static PyObject *py_PAC_CREDENTIAL_DATA_CTR_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1414             : {
    1415           0 :         struct PAC_CREDENTIAL_DATA_CTR *object = (struct PAC_CREDENTIAL_DATA_CTR *)pytalloc_get_ptr(py_obj);
    1416             :         PyObject *ret;
    1417             :         char *retstr;
    1418             : 
    1419           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_CREDENTIAL_DATA_CTR, "PAC_CREDENTIAL_DATA_CTR", object);
    1420           0 :         ret = PyUnicode_FromString(retstr);
    1421           0 :         talloc_free(retstr);
    1422             : 
    1423           0 :         return ret;
    1424             : }
    1425             : 
    1426             : static PyMethodDef py_PAC_CREDENTIAL_DATA_CTR_methods[] = {
    1427             :         { "__ndr_pack__", (PyCFunction)py_PAC_CREDENTIAL_DATA_CTR_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1428             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_CREDENTIAL_DATA_CTR_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1429             :         { "__ndr_print__", (PyCFunction)py_PAC_CREDENTIAL_DATA_CTR_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1430             :         { NULL, NULL, 0, NULL }
    1431             : };
    1432             : 
    1433             : 
    1434             : static PyTypeObject PAC_CREDENTIAL_DATA_CTR_Type = {
    1435             :         PyVarObject_HEAD_INIT(NULL, 0)
    1436             :         .tp_name = "krb5pac.PAC_CREDENTIAL_DATA_CTR",
    1437             :         .tp_getset = py_PAC_CREDENTIAL_DATA_CTR_getsetters,
    1438             :         .tp_methods = py_PAC_CREDENTIAL_DATA_CTR_methods,
    1439             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1440             :         .tp_new = py_PAC_CREDENTIAL_DATA_CTR_new,
    1441             : };
    1442             : 
    1443             : 
    1444           0 : static PyObject *py_PAC_CREDENTIAL_DATA_NDR_get_ctr(PyObject *obj, void *closure)
    1445             : {
    1446           0 :         struct PAC_CREDENTIAL_DATA_NDR *object = (struct PAC_CREDENTIAL_DATA_NDR *)pytalloc_get_ptr(obj);
    1447             :         PyObject *py_ctr;
    1448           0 :         py_ctr = pytalloc_reference_ex(&PAC_CREDENTIAL_DATA_CTR_Type, pytalloc_get_mem_ctx(obj), &object->ctr);
    1449           0 :         return py_ctr;
    1450             : }
    1451             : 
    1452           0 : static int py_PAC_CREDENTIAL_DATA_NDR_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
    1453             : {
    1454           0 :         struct PAC_CREDENTIAL_DATA_NDR *object = (struct PAC_CREDENTIAL_DATA_NDR *)pytalloc_get_ptr(py_obj);
    1455           0 :         if (value == NULL) {
    1456           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ctr");
    1457           0 :                 return -1;
    1458             :         }
    1459           0 :         PY_CHECK_TYPE(&PAC_CREDENTIAL_DATA_CTR_Type, value, return -1;);
    1460           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1461           0 :                 PyErr_NoMemory();
    1462           0 :                 return -1;
    1463             :         }
    1464           0 :         object->ctr = *(struct PAC_CREDENTIAL_DATA_CTR *)pytalloc_get_ptr(value);
    1465           0 :         return 0;
    1466             : }
    1467             : 
    1468             : static PyGetSetDef py_PAC_CREDENTIAL_DATA_NDR_getsetters[] = {
    1469             :         {
    1470             :                 .name = discard_const_p(char, "ctr"),
    1471             :                 .get = py_PAC_CREDENTIAL_DATA_NDR_get_ctr,
    1472             :                 .set = py_PAC_CREDENTIAL_DATA_NDR_set_ctr,
    1473             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_CREDENTIAL_DATA_CTR")
    1474             :         },
    1475             :         { .name = NULL }
    1476             : };
    1477             : 
    1478           0 : static PyObject *py_PAC_CREDENTIAL_DATA_NDR_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1479             : {
    1480           0 :         return pytalloc_new(struct PAC_CREDENTIAL_DATA_NDR, type);
    1481             : }
    1482             : 
    1483           0 : static PyObject *py_PAC_CREDENTIAL_DATA_NDR_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1484             : {
    1485           0 :         struct PAC_CREDENTIAL_DATA_NDR *object = (struct PAC_CREDENTIAL_DATA_NDR *)pytalloc_get_ptr(py_obj);
    1486           0 :         PyObject *ret = NULL;
    1487             :         DATA_BLOB blob;
    1488             :         enum ndr_err_code err;
    1489           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1490           0 :         if (tmp_ctx == NULL) {
    1491           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1492           0 :                 return NULL;
    1493             :         }
    1494           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_CREDENTIAL_DATA_NDR);
    1495           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1496           0 :                 TALLOC_FREE(tmp_ctx);
    1497           0 :                 PyErr_SetNdrError(err);
    1498           0 :                 return NULL;
    1499             :         }
    1500             : 
    1501           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1502           0 :         TALLOC_FREE(tmp_ctx);
    1503           0 :         return ret;
    1504             : }
    1505             : 
    1506           0 : static PyObject *py_PAC_CREDENTIAL_DATA_NDR_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1507             : {
    1508           0 :         struct PAC_CREDENTIAL_DATA_NDR *object = (struct PAC_CREDENTIAL_DATA_NDR *)pytalloc_get_ptr(py_obj);
    1509           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1510           0 :         Py_ssize_t blob_length = 0;
    1511             :         enum ndr_err_code err;
    1512           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1513           0 :         PyObject *allow_remaining_obj = NULL;
    1514           0 :         bool allow_remaining = false;
    1515             : 
    1516           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1517             :                 discard_const_p(char *, kwnames),
    1518             :                 &blob.data, &blob_length,
    1519             :                 &allow_remaining_obj)) {
    1520           0 :                 return NULL;
    1521             :         }
    1522           0 :         blob.length = blob_length;
    1523             : 
    1524           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1525           0 :                 allow_remaining = true;
    1526             :         }
    1527             : 
    1528           0 :         if (allow_remaining) {
    1529           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_DATA_NDR);
    1530             :         } else {
    1531           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_DATA_NDR);
    1532             :         }
    1533           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1534           0 :                 PyErr_SetNdrError(err);
    1535           0 :                 return NULL;
    1536             :         }
    1537             : 
    1538           0 :         Py_RETURN_NONE;
    1539             : }
    1540             : 
    1541           0 : static PyObject *py_PAC_CREDENTIAL_DATA_NDR_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1542             : {
    1543           0 :         struct PAC_CREDENTIAL_DATA_NDR *object = (struct PAC_CREDENTIAL_DATA_NDR *)pytalloc_get_ptr(py_obj);
    1544             :         PyObject *ret;
    1545             :         char *retstr;
    1546             : 
    1547           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_CREDENTIAL_DATA_NDR, "PAC_CREDENTIAL_DATA_NDR", object);
    1548           0 :         ret = PyUnicode_FromString(retstr);
    1549           0 :         talloc_free(retstr);
    1550             : 
    1551           0 :         return ret;
    1552             : }
    1553             : 
    1554             : static PyMethodDef py_PAC_CREDENTIAL_DATA_NDR_methods[] = {
    1555             :         { "__ndr_pack__", (PyCFunction)py_PAC_CREDENTIAL_DATA_NDR_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1556             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_CREDENTIAL_DATA_NDR_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1557             :         { "__ndr_print__", (PyCFunction)py_PAC_CREDENTIAL_DATA_NDR_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1558             :         { NULL, NULL, 0, NULL }
    1559             : };
    1560             : 
    1561             : 
    1562             : static PyTypeObject PAC_CREDENTIAL_DATA_NDR_Type = {
    1563             :         PyVarObject_HEAD_INIT(NULL, 0)
    1564             :         .tp_name = "krb5pac.PAC_CREDENTIAL_DATA_NDR",
    1565             :         .tp_getset = py_PAC_CREDENTIAL_DATA_NDR_getsetters,
    1566             :         .tp_methods = py_PAC_CREDENTIAL_DATA_NDR_methods,
    1567             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1568             :         .tp_new = py_PAC_CREDENTIAL_DATA_NDR_new,
    1569             : };
    1570             : 
    1571             : 
    1572           0 : static PyObject *py_PAC_CREDENTIAL_INFO_get_version(PyObject *obj, void *closure)
    1573             : {
    1574           0 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(obj);
    1575             :         PyObject *py_version;
    1576           0 :         py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
    1577           0 :         return py_version;
    1578             : }
    1579             : 
    1580           0 : static int py_PAC_CREDENTIAL_INFO_set_version(PyObject *py_obj, PyObject *value, void *closure)
    1581             : {
    1582           0 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(py_obj);
    1583           0 :         if (value == NULL) {
    1584           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
    1585           0 :                 return -1;
    1586             :         }
    1587             :         {
    1588           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
    1589           0 :                 if (PyLong_Check(value)) {
    1590             :                         unsigned long long test_var;
    1591           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1592           0 :                         if (PyErr_Occurred() != NULL) {
    1593           0 :                                 return -1;
    1594             :                         }
    1595           0 :                         if (test_var > uint_max) {
    1596           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1597             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1598           0 :                                 return -1;
    1599             :                         }
    1600           0 :                         object->version = test_var;
    1601             :                 } else {
    1602           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1603             :                           PyLong_Type.tp_name);
    1604           0 :                         return -1;
    1605             :                 }
    1606             :         }
    1607           0 :         return 0;
    1608             : }
    1609             : 
    1610           0 : static PyObject *py_PAC_CREDENTIAL_INFO_get_encryption_type(PyObject *obj, void *closure)
    1611             : {
    1612           0 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(obj);
    1613             :         PyObject *py_encryption_type;
    1614           0 :         py_encryption_type = PyLong_FromUnsignedLongLong((uint32_t)object->encryption_type);
    1615           0 :         return py_encryption_type;
    1616             : }
    1617             : 
    1618           0 : static int py_PAC_CREDENTIAL_INFO_set_encryption_type(PyObject *py_obj, PyObject *value, void *closure)
    1619             : {
    1620           0 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(py_obj);
    1621           0 :         if (value == NULL) {
    1622           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->encryption_type");
    1623           0 :                 return -1;
    1624             :         }
    1625             :         {
    1626           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->encryption_type));
    1627           0 :                 if (PyLong_Check(value)) {
    1628             :                         unsigned long long test_var;
    1629           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1630           0 :                         if (PyErr_Occurred() != NULL) {
    1631           0 :                                 return -1;
    1632             :                         }
    1633           0 :                         if (test_var > uint_max) {
    1634           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1635             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1636           0 :                                 return -1;
    1637             :                         }
    1638           0 :                         object->encryption_type = test_var;
    1639             :                 } else {
    1640           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1641             :                           PyLong_Type.tp_name);
    1642           0 :                         return -1;
    1643             :                 }
    1644             :         }
    1645           0 :         return 0;
    1646             : }
    1647             : 
    1648           0 : static PyObject *py_PAC_CREDENTIAL_INFO_get_encrypted_data(PyObject *obj, void *closure)
    1649             : {
    1650           0 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(obj);
    1651             :         PyObject *py_encrypted_data;
    1652           0 :         py_encrypted_data = PyBytes_FromStringAndSize((char *)(object->encrypted_data).data, (object->encrypted_data).length);
    1653           0 :         return py_encrypted_data;
    1654             : }
    1655             : 
    1656           0 : static int py_PAC_CREDENTIAL_INFO_set_encrypted_data(PyObject *py_obj, PyObject *value, void *closure)
    1657             : {
    1658           0 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(py_obj);
    1659           0 :         if (value == NULL) {
    1660           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->encrypted_data");
    1661           0 :                 return -1;
    1662             :         }
    1663           0 :         object->encrypted_data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
    1664           0 :         return 0;
    1665             : }
    1666             : 
    1667             : static PyGetSetDef py_PAC_CREDENTIAL_INFO_getsetters[] = {
    1668             :         {
    1669             :                 .name = discard_const_p(char, "version"),
    1670             :                 .get = py_PAC_CREDENTIAL_INFO_get_version,
    1671             :                 .set = py_PAC_CREDENTIAL_INFO_set_version,
    1672             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1673             :         },
    1674             :         {
    1675             :                 .name = discard_const_p(char, "encryption_type"),
    1676             :                 .get = py_PAC_CREDENTIAL_INFO_get_encryption_type,
    1677             :                 .set = py_PAC_CREDENTIAL_INFO_set_encryption_type,
    1678             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1679             :         },
    1680             :         {
    1681             :                 .name = discard_const_p(char, "encrypted_data"),
    1682             :                 .get = py_PAC_CREDENTIAL_INFO_get_encrypted_data,
    1683             :                 .set = py_PAC_CREDENTIAL_INFO_set_encrypted_data,
    1684             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
    1685             :         },
    1686             :         { .name = NULL }
    1687             : };
    1688             : 
    1689           0 : static PyObject *py_PAC_CREDENTIAL_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1690             : {
    1691           0 :         return pytalloc_new(struct PAC_CREDENTIAL_INFO, type);
    1692             : }
    1693             : 
    1694           0 : static PyObject *py_PAC_CREDENTIAL_INFO_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    1695             : {
    1696           0 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(py_obj);
    1697           0 :         PyObject *ret = NULL;
    1698             :         DATA_BLOB blob;
    1699             :         enum ndr_err_code err;
    1700           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    1701           0 :         if (tmp_ctx == NULL) {
    1702           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    1703           0 :                 return NULL;
    1704             :         }
    1705           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_CREDENTIAL_INFO);
    1706           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1707           0 :                 TALLOC_FREE(tmp_ctx);
    1708           0 :                 PyErr_SetNdrError(err);
    1709           0 :                 return NULL;
    1710             :         }
    1711             : 
    1712           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    1713           0 :         TALLOC_FREE(tmp_ctx);
    1714           0 :         return ret;
    1715             : }
    1716             : 
    1717           0 : static PyObject *py_PAC_CREDENTIAL_INFO_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    1718             : {
    1719           0 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(py_obj);
    1720           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    1721           0 :         Py_ssize_t blob_length = 0;
    1722             :         enum ndr_err_code err;
    1723           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    1724           0 :         PyObject *allow_remaining_obj = NULL;
    1725           0 :         bool allow_remaining = false;
    1726             : 
    1727           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    1728             :                 discard_const_p(char *, kwnames),
    1729             :                 &blob.data, &blob_length,
    1730             :                 &allow_remaining_obj)) {
    1731           0 :                 return NULL;
    1732             :         }
    1733           0 :         blob.length = blob_length;
    1734             : 
    1735           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    1736           0 :                 allow_remaining = true;
    1737             :         }
    1738             : 
    1739           0 :         if (allow_remaining) {
    1740           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_INFO);
    1741             :         } else {
    1742           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CREDENTIAL_INFO);
    1743             :         }
    1744           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    1745           0 :                 PyErr_SetNdrError(err);
    1746           0 :                 return NULL;
    1747             :         }
    1748             : 
    1749           0 :         Py_RETURN_NONE;
    1750             : }
    1751             : 
    1752           0 : static PyObject *py_PAC_CREDENTIAL_INFO_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    1753             : {
    1754           0 :         struct PAC_CREDENTIAL_INFO *object = (struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(py_obj);
    1755             :         PyObject *ret;
    1756             :         char *retstr;
    1757             : 
    1758           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_CREDENTIAL_INFO, "PAC_CREDENTIAL_INFO", object);
    1759           0 :         ret = PyUnicode_FromString(retstr);
    1760           0 :         talloc_free(retstr);
    1761             : 
    1762           0 :         return ret;
    1763             : }
    1764             : 
    1765             : static PyMethodDef py_PAC_CREDENTIAL_INFO_methods[] = {
    1766             :         { "__ndr_pack__", (PyCFunction)py_PAC_CREDENTIAL_INFO_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    1767             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_CREDENTIAL_INFO_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    1768             :         { "__ndr_print__", (PyCFunction)py_PAC_CREDENTIAL_INFO_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    1769             :         { NULL, NULL, 0, NULL }
    1770             : };
    1771             : 
    1772             : 
    1773             : static PyTypeObject PAC_CREDENTIAL_INFO_Type = {
    1774             :         PyVarObject_HEAD_INIT(NULL, 0)
    1775             :         .tp_name = "krb5pac.PAC_CREDENTIAL_INFO",
    1776             :         .tp_getset = py_PAC_CREDENTIAL_INFO_getsetters,
    1777             :         .tp_methods = py_PAC_CREDENTIAL_INFO_methods,
    1778             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1779             :         .tp_new = py_PAC_CREDENTIAL_INFO_new,
    1780             : };
    1781             : 
    1782             : 
    1783           0 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_get_proxy_target(PyObject *obj, void *closure)
    1784             : {
    1785           0 :         struct PAC_CONSTRAINED_DELEGATION *object = (struct PAC_CONSTRAINED_DELEGATION *)pytalloc_get_ptr(obj);
    1786             :         PyObject *py_proxy_target;
    1787           0 :         py_proxy_target = pytalloc_reference_ex(lsa_String_Type, pytalloc_get_mem_ctx(obj), &object->proxy_target);
    1788           0 :         return py_proxy_target;
    1789             : }
    1790             : 
    1791           0 : static int py_PAC_CONSTRAINED_DELEGATION_set_proxy_target(PyObject *py_obj, PyObject *value, void *closure)
    1792             : {
    1793           0 :         struct PAC_CONSTRAINED_DELEGATION *object = (struct PAC_CONSTRAINED_DELEGATION *)pytalloc_get_ptr(py_obj);
    1794           0 :         if (value == NULL) {
    1795           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->proxy_target");
    1796           0 :                 return -1;
    1797             :         }
    1798           0 :         PY_CHECK_TYPE(lsa_String_Type, value, return -1;);
    1799           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    1800           0 :                 PyErr_NoMemory();
    1801           0 :                 return -1;
    1802             :         }
    1803           0 :         object->proxy_target = *(struct lsa_String *)pytalloc_get_ptr(value);
    1804           0 :         return 0;
    1805             : }
    1806             : 
    1807           0 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_get_num_transited_services(PyObject *obj, void *closure)
    1808             : {
    1809           0 :         struct PAC_CONSTRAINED_DELEGATION *object = (struct PAC_CONSTRAINED_DELEGATION *)pytalloc_get_ptr(obj);
    1810             :         PyObject *py_num_transited_services;
    1811           0 :         py_num_transited_services = PyLong_FromUnsignedLongLong((uint32_t)object->num_transited_services);
    1812           0 :         return py_num_transited_services;
    1813             : }
    1814             : 
    1815           0 : static int py_PAC_CONSTRAINED_DELEGATION_set_num_transited_services(PyObject *py_obj, PyObject *value, void *closure)
    1816             : {
    1817           0 :         struct PAC_CONSTRAINED_DELEGATION *object = (struct PAC_CONSTRAINED_DELEGATION *)pytalloc_get_ptr(py_obj);
    1818           0 :         if (value == NULL) {
    1819           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_transited_services");
    1820           0 :                 return -1;
    1821             :         }
    1822             :         {
    1823           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_transited_services));
    1824           0 :                 if (PyLong_Check(value)) {
    1825             :                         unsigned long long test_var;
    1826           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1827           0 :                         if (PyErr_Occurred() != NULL) {
    1828           0 :                                 return -1;
    1829             :                         }
    1830           0 :                         if (test_var > uint_max) {
    1831           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1832             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1833           0 :                                 return -1;
    1834             :                         }
    1835           0 :                         object->num_transited_services = test_var;
    1836             :                 } else {
    1837           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1838             :                           PyLong_Type.tp_name);
    1839           0 :                         return -1;
    1840             :                 }
    1841             :         }
    1842           0 :         return 0;
    1843             : }
    1844             : 
    1845           0 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_get_transited_services(PyObject *obj, void *closure)
    1846             : {
    1847           0 :         struct PAC_CONSTRAINED_DELEGATION *object = (struct PAC_CONSTRAINED_DELEGATION *)pytalloc_get_ptr(obj);
    1848             :         PyObject *py_transited_services;
    1849           0 :         if (object->transited_services == NULL) {
    1850           0 :                 Py_RETURN_NONE;
    1851             :         }
    1852           0 :         if (object->transited_services == NULL) {
    1853           0 :                 py_transited_services = Py_None;
    1854           0 :                 Py_INCREF(py_transited_services);
    1855             :         } else {
    1856           0 :                 py_transited_services = PyList_New(object->num_transited_services);
    1857           0 :                 if (py_transited_services == NULL) {
    1858           0 :                         return NULL;
    1859             :                 }
    1860             :                 {
    1861             :                         int transited_services_cntr_1;
    1862           0 :                         for (transited_services_cntr_1 = 0; transited_services_cntr_1 < (object->num_transited_services); transited_services_cntr_1++) {
    1863             :                                 PyObject *py_transited_services_1;
    1864           0 :                                 py_transited_services_1 = pytalloc_reference_ex(lsa_String_Type, object->transited_services, &object->transited_services[transited_services_cntr_1]);
    1865           0 :                                 PyList_SetItem(py_transited_services, transited_services_cntr_1, py_transited_services_1);
    1866             :                         }
    1867             :                 }
    1868             :         }
    1869           0 :         return py_transited_services;
    1870             : }
    1871             : 
    1872           0 : static int py_PAC_CONSTRAINED_DELEGATION_set_transited_services(PyObject *py_obj, PyObject *value, void *closure)
    1873             : {
    1874           0 :         struct PAC_CONSTRAINED_DELEGATION *object = (struct PAC_CONSTRAINED_DELEGATION *)pytalloc_get_ptr(py_obj);
    1875           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->transited_services));
    1876           0 :         if (value == NULL) {
    1877           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->transited_services");
    1878           0 :                 return -1;
    1879             :         }
    1880           0 :         if (value == Py_None) {
    1881           0 :                 object->transited_services = NULL;
    1882             :         } else {
    1883           0 :                 object->transited_services = NULL;
    1884           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    1885             :                 {
    1886             :                         int transited_services_cntr_1;
    1887           0 :                         object->transited_services = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->transited_services, PyList_GET_SIZE(value));
    1888           0 :                         if (!object->transited_services) { return -1;; }
    1889           0 :                         talloc_set_name_const(object->transited_services, "ARRAY: object->transited_services");
    1890           0 :                         for (transited_services_cntr_1 = 0; transited_services_cntr_1 < PyList_GET_SIZE(value); transited_services_cntr_1++) {
    1891           0 :                                 if (PyList_GET_ITEM(value, transited_services_cntr_1) == NULL) {
    1892           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->transited_services[transited_services_cntr_1]");
    1893           0 :                                         return -1;
    1894             :                                 }
    1895           0 :                                 PY_CHECK_TYPE(lsa_String_Type, PyList_GET_ITEM(value, transited_services_cntr_1), return -1;);
    1896           0 :                                 if (talloc_reference(object->transited_services, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, transited_services_cntr_1))) == NULL) {
    1897           0 :                                         PyErr_NoMemory();
    1898           0 :                                         return -1;
    1899             :                                 }
    1900           0 :                                 object->transited_services[transited_services_cntr_1] = *(struct lsa_String *)pytalloc_get_ptr(PyList_GET_ITEM(value, transited_services_cntr_1));
    1901             :                         }
    1902             :                 }
    1903             :         }
    1904           0 :         return 0;
    1905             : }
    1906             : 
    1907             : static PyGetSetDef py_PAC_CONSTRAINED_DELEGATION_getsetters[] = {
    1908             :         {
    1909             :                 .name = discard_const_p(char, "proxy_target"),
    1910             :                 .get = py_PAC_CONSTRAINED_DELEGATION_get_proxy_target,
    1911             :                 .set = py_PAC_CONSTRAINED_DELEGATION_set_proxy_target,
    1912             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
    1913             :         },
    1914             :         {
    1915             :                 .name = discard_const_p(char, "num_transited_services"),
    1916             :                 .get = py_PAC_CONSTRAINED_DELEGATION_get_num_transited_services,
    1917             :                 .set = py_PAC_CONSTRAINED_DELEGATION_set_num_transited_services,
    1918             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1919             :         },
    1920             :         {
    1921             :                 .name = discard_const_p(char, "transited_services"),
    1922             :                 .get = py_PAC_CONSTRAINED_DELEGATION_get_transited_services,
    1923             :                 .set = py_PAC_CONSTRAINED_DELEGATION_set_transited_services,
    1924             :                 .doc = discard_const_p(char, "PIDL-generated element of base type lsa_String")
    1925             :         },
    1926             :         { .name = NULL }
    1927             : };
    1928             : 
    1929           0 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1930             : {
    1931           0 :         return pytalloc_new(struct PAC_CONSTRAINED_DELEGATION, type);
    1932             : }
    1933             : 
    1934             : 
    1935             : static PyTypeObject PAC_CONSTRAINED_DELEGATION_Type = {
    1936             :         PyVarObject_HEAD_INIT(NULL, 0)
    1937             :         .tp_name = "krb5pac.PAC_CONSTRAINED_DELEGATION",
    1938             :         .tp_getset = py_PAC_CONSTRAINED_DELEGATION_getsetters,
    1939             :         .tp_methods = NULL,
    1940             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1941             :         .tp_new = py_PAC_CONSTRAINED_DELEGATION_new,
    1942             : };
    1943             : 
    1944             : 
    1945           0 : static PyObject *py_PAC_UPN_DNS_INFO_get_upn_name_size(PyObject *obj, void *closure)
    1946             : {
    1947           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(obj);
    1948             :         PyObject *py_upn_name_size;
    1949           0 :         py_upn_name_size = PyLong_FromLong((uint16_t)object->upn_name_size);
    1950           0 :         return py_upn_name_size;
    1951             : }
    1952             : 
    1953           0 : static int py_PAC_UPN_DNS_INFO_set_upn_name_size(PyObject *py_obj, PyObject *value, void *closure)
    1954             : {
    1955           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(py_obj);
    1956           0 :         if (value == NULL) {
    1957           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->upn_name_size");
    1958           0 :                 return -1;
    1959             :         }
    1960             :         {
    1961           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->upn_name_size));
    1962           0 :                 if (PyLong_Check(value)) {
    1963             :                         unsigned long long test_var;
    1964           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1965           0 :                         if (PyErr_Occurred() != NULL) {
    1966           0 :                                 return -1;
    1967             :                         }
    1968           0 :                         if (test_var > uint_max) {
    1969           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1970             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1971           0 :                                 return -1;
    1972             :                         }
    1973           0 :                         object->upn_name_size = test_var;
    1974             :                 } else {
    1975           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1976             :                           PyLong_Type.tp_name);
    1977           0 :                         return -1;
    1978             :                 }
    1979             :         }
    1980           0 :         return 0;
    1981             : }
    1982             : 
    1983           4 : static PyObject *py_PAC_UPN_DNS_INFO_get_upn_name(PyObject *obj, void *closure)
    1984             : {
    1985           4 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(obj);
    1986             :         PyObject *py_upn_name;
    1987           4 :         if (object->upn_name == NULL) {
    1988           0 :                 Py_RETURN_NONE;
    1989             :         }
    1990           4 :         if (object->upn_name == NULL) {
    1991           0 :                 py_upn_name = Py_None;
    1992           0 :                 Py_INCREF(py_upn_name);
    1993             :         } else {
    1994           4 :                 py_upn_name = PyString_FromStringOrNULL(object->upn_name);
    1995             :         }
    1996           4 :         return py_upn_name;
    1997             : }
    1998             : 
    1999           0 : static int py_PAC_UPN_DNS_INFO_set_upn_name(PyObject *py_obj, PyObject *value, void *closure)
    2000             : {
    2001           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(py_obj);
    2002           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->upn_name));
    2003           0 :         if (value == NULL) {
    2004           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->upn_name");
    2005           0 :                 return -1;
    2006             :         }
    2007           0 :         if (value == Py_None) {
    2008           0 :                 object->upn_name = NULL;
    2009             :         } else {
    2010           0 :                 object->upn_name = NULL;
    2011             :                 {
    2012             :                         const char *test_str;
    2013             :                         const char *talloc_str;
    2014           0 :                         PyObject *unicode = NULL;
    2015           0 :                         if (PyUnicode_Check(value)) {
    2016           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2017           0 :                                 if (unicode == NULL) {
    2018           0 :                                         PyErr_NoMemory();
    2019           0 :                                         return -1;
    2020             :                                 }
    2021           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    2022           0 :                         } else if (PyBytes_Check(value)) {
    2023           0 :                                 test_str = PyBytes_AS_STRING(value);
    2024             :                         } else {
    2025           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2026           0 :                                 return -1;
    2027             :                         }
    2028           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2029           0 :                         if (unicode != NULL) {
    2030           0 :                                 Py_DECREF(unicode);
    2031             :                         }
    2032           0 :                         if (talloc_str == NULL) {
    2033           0 :                                 PyErr_NoMemory();
    2034           0 :                                 return -1;
    2035             :                         }
    2036           0 :                         object->upn_name = talloc_str;
    2037             :                 }
    2038             :         }
    2039           0 :         return 0;
    2040             : }
    2041             : 
    2042           0 : static PyObject *py_PAC_UPN_DNS_INFO_get_dns_domain_name_size(PyObject *obj, void *closure)
    2043             : {
    2044           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(obj);
    2045             :         PyObject *py_dns_domain_name_size;
    2046           0 :         py_dns_domain_name_size = PyLong_FromLong((uint16_t)object->dns_domain_name_size);
    2047           0 :         return py_dns_domain_name_size;
    2048             : }
    2049             : 
    2050           0 : static int py_PAC_UPN_DNS_INFO_set_dns_domain_name_size(PyObject *py_obj, PyObject *value, void *closure)
    2051             : {
    2052           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(py_obj);
    2053           0 :         if (value == NULL) {
    2054           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain_name_size");
    2055           0 :                 return -1;
    2056             :         }
    2057             :         {
    2058           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dns_domain_name_size));
    2059           0 :                 if (PyLong_Check(value)) {
    2060             :                         unsigned long long test_var;
    2061           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2062           0 :                         if (PyErr_Occurred() != NULL) {
    2063           0 :                                 return -1;
    2064             :                         }
    2065           0 :                         if (test_var > uint_max) {
    2066           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2067             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2068           0 :                                 return -1;
    2069             :                         }
    2070           0 :                         object->dns_domain_name_size = test_var;
    2071             :                 } else {
    2072           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2073             :                           PyLong_Type.tp_name);
    2074           0 :                         return -1;
    2075             :                 }
    2076             :         }
    2077           0 :         return 0;
    2078             : }
    2079             : 
    2080           4 : static PyObject *py_PAC_UPN_DNS_INFO_get_dns_domain_name(PyObject *obj, void *closure)
    2081             : {
    2082           4 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(obj);
    2083             :         PyObject *py_dns_domain_name;
    2084           4 :         if (object->dns_domain_name == NULL) {
    2085           0 :                 Py_RETURN_NONE;
    2086             :         }
    2087           4 :         if (object->dns_domain_name == NULL) {
    2088           0 :                 py_dns_domain_name = Py_None;
    2089           0 :                 Py_INCREF(py_dns_domain_name);
    2090             :         } else {
    2091           4 :                 py_dns_domain_name = PyString_FromStringOrNULL(object->dns_domain_name);
    2092             :         }
    2093           4 :         return py_dns_domain_name;
    2094             : }
    2095             : 
    2096           0 : static int py_PAC_UPN_DNS_INFO_set_dns_domain_name(PyObject *py_obj, PyObject *value, void *closure)
    2097             : {
    2098           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(py_obj);
    2099           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->dns_domain_name));
    2100           0 :         if (value == NULL) {
    2101           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dns_domain_name");
    2102           0 :                 return -1;
    2103             :         }
    2104           0 :         if (value == Py_None) {
    2105           0 :                 object->dns_domain_name = NULL;
    2106             :         } else {
    2107           0 :                 object->dns_domain_name = NULL;
    2108             :                 {
    2109             :                         const char *test_str;
    2110             :                         const char *talloc_str;
    2111           0 :                         PyObject *unicode = NULL;
    2112           0 :                         if (PyUnicode_Check(value)) {
    2113           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2114           0 :                                 if (unicode == NULL) {
    2115           0 :                                         PyErr_NoMemory();
    2116           0 :                                         return -1;
    2117             :                                 }
    2118           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    2119           0 :                         } else if (PyBytes_Check(value)) {
    2120           0 :                                 test_str = PyBytes_AS_STRING(value);
    2121             :                         } else {
    2122           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2123           0 :                                 return -1;
    2124             :                         }
    2125           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2126           0 :                         if (unicode != NULL) {
    2127           0 :                                 Py_DECREF(unicode);
    2128             :                         }
    2129           0 :                         if (talloc_str == NULL) {
    2130           0 :                                 PyErr_NoMemory();
    2131           0 :                                 return -1;
    2132             :                         }
    2133           0 :                         object->dns_domain_name = talloc_str;
    2134             :                 }
    2135             :         }
    2136           0 :         return 0;
    2137             : }
    2138             : 
    2139           0 : static PyObject *py_PAC_UPN_DNS_INFO_get_flags(PyObject *obj, void *closure)
    2140             : {
    2141           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(obj);
    2142             :         PyObject *py_flags;
    2143           0 :         py_flags = PyLong_FromUnsignedLongLong((uint32_t)object->flags);
    2144           0 :         return py_flags;
    2145             : }
    2146             : 
    2147           0 : static int py_PAC_UPN_DNS_INFO_set_flags(PyObject *py_obj, PyObject *value, void *closure)
    2148             : {
    2149           0 :         struct PAC_UPN_DNS_INFO *object = (struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(py_obj);
    2150           0 :         if (value == NULL) {
    2151           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->flags");
    2152           0 :                 return -1;
    2153             :         }
    2154             :         {
    2155           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
    2156           0 :                 if (PyLong_Check(value)) {
    2157             :                         unsigned long long test_var;
    2158           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2159           0 :                         if (PyErr_Occurred() != NULL) {
    2160           0 :                                 return -1;
    2161             :                         }
    2162           0 :                         if (test_var > uint_max) {
    2163           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2164             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2165           0 :                                 return -1;
    2166             :                         }
    2167           0 :                         object->flags = test_var;
    2168             :                 } else {
    2169           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2170             :                           PyLong_Type.tp_name);
    2171           0 :                         return -1;
    2172             :                 }
    2173             :         }
    2174           0 :         return 0;
    2175             : }
    2176             : 
    2177             : static PyGetSetDef py_PAC_UPN_DNS_INFO_getsetters[] = {
    2178             :         {
    2179             :                 .name = discard_const_p(char, "upn_name_size"),
    2180             :                 .get = py_PAC_UPN_DNS_INFO_get_upn_name_size,
    2181             :                 .set = py_PAC_UPN_DNS_INFO_set_upn_name_size,
    2182             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2183             :         },
    2184             :         {
    2185             :                 .name = discard_const_p(char, "upn_name"),
    2186             :                 .get = py_PAC_UPN_DNS_INFO_get_upn_name,
    2187             :                 .set = py_PAC_UPN_DNS_INFO_set_upn_name,
    2188             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    2189             :         },
    2190             :         {
    2191             :                 .name = discard_const_p(char, "dns_domain_name_size"),
    2192             :                 .get = py_PAC_UPN_DNS_INFO_get_dns_domain_name_size,
    2193             :                 .set = py_PAC_UPN_DNS_INFO_set_dns_domain_name_size,
    2194             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2195             :         },
    2196             :         {
    2197             :                 .name = discard_const_p(char, "dns_domain_name"),
    2198             :                 .get = py_PAC_UPN_DNS_INFO_get_dns_domain_name,
    2199             :                 .set = py_PAC_UPN_DNS_INFO_set_dns_domain_name,
    2200             :                 .doc = discard_const_p(char, "PIDL-generated element of base type string")
    2201             :         },
    2202             :         {
    2203             :                 .name = discard_const_p(char, "flags"),
    2204             :                 .get = py_PAC_UPN_DNS_INFO_get_flags,
    2205             :                 .set = py_PAC_UPN_DNS_INFO_set_flags,
    2206             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_UPN_DNS_FLAGS")
    2207             :         },
    2208             :         { .name = NULL }
    2209             : };
    2210             : 
    2211           0 : static PyObject *py_PAC_UPN_DNS_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2212             : {
    2213           0 :         return pytalloc_new(struct PAC_UPN_DNS_INFO, type);
    2214             : }
    2215             : 
    2216             : 
    2217             : static PyTypeObject PAC_UPN_DNS_INFO_Type = {
    2218             :         PyVarObject_HEAD_INIT(NULL, 0)
    2219             :         .tp_name = "krb5pac.PAC_UPN_DNS_INFO",
    2220             :         .tp_getset = py_PAC_UPN_DNS_INFO_getsetters,
    2221             :         .tp_methods = NULL,
    2222             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2223             :         .tp_new = py_PAC_UPN_DNS_INFO_new,
    2224             : };
    2225             : 
    2226             : 
    2227          12 : static PyObject *py_PAC_LOGON_INFO_CTR_get_info(PyObject *obj, void *closure)
    2228             : {
    2229          12 :         struct PAC_LOGON_INFO_CTR *object = (struct PAC_LOGON_INFO_CTR *)pytalloc_get_ptr(obj);
    2230             :         PyObject *py_info;
    2231          12 :         if (object->info == NULL) {
    2232           0 :                 Py_RETURN_NONE;
    2233             :         }
    2234          12 :         if (object->info == NULL) {
    2235           0 :                 py_info = Py_None;
    2236           0 :                 Py_INCREF(py_info);
    2237             :         } else {
    2238          12 :                 py_info = pytalloc_reference_ex(&PAC_LOGON_INFO_Type, object->info, object->info);
    2239             :         }
    2240          12 :         return py_info;
    2241             : }
    2242             : 
    2243           0 : static int py_PAC_LOGON_INFO_CTR_set_info(PyObject *py_obj, PyObject *value, void *closure)
    2244             : {
    2245           0 :         struct PAC_LOGON_INFO_CTR *object = (struct PAC_LOGON_INFO_CTR *)pytalloc_get_ptr(py_obj);
    2246           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->info));
    2247           0 :         if (value == NULL) {
    2248           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
    2249           0 :                 return -1;
    2250             :         }
    2251           0 :         if (value == Py_None) {
    2252           0 :                 object->info = NULL;
    2253             :         } else {
    2254           0 :                 object->info = NULL;
    2255           0 :                 PY_CHECK_TYPE(&PAC_LOGON_INFO_Type, value, return -1;);
    2256           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2257           0 :                         PyErr_NoMemory();
    2258           0 :                         return -1;
    2259             :                 }
    2260           0 :                 object->info = (struct PAC_LOGON_INFO *)pytalloc_get_ptr(value);
    2261             :         }
    2262           0 :         return 0;
    2263             : }
    2264             : 
    2265             : static PyGetSetDef py_PAC_LOGON_INFO_CTR_getsetters[] = {
    2266             :         {
    2267             :                 .name = discard_const_p(char, "info"),
    2268             :                 .get = py_PAC_LOGON_INFO_CTR_get_info,
    2269             :                 .set = py_PAC_LOGON_INFO_CTR_set_info,
    2270             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_LOGON_INFO")
    2271             :         },
    2272             :         { .name = NULL }
    2273             : };
    2274             : 
    2275           0 : static PyObject *py_PAC_LOGON_INFO_CTR_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2276             : {
    2277           0 :         return pytalloc_new(struct PAC_LOGON_INFO_CTR, type);
    2278             : }
    2279             : 
    2280           0 : static PyObject *py_PAC_LOGON_INFO_CTR_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    2281             : {
    2282           0 :         struct PAC_LOGON_INFO_CTR *object = (struct PAC_LOGON_INFO_CTR *)pytalloc_get_ptr(py_obj);
    2283           0 :         PyObject *ret = NULL;
    2284             :         DATA_BLOB blob;
    2285             :         enum ndr_err_code err;
    2286           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    2287           0 :         if (tmp_ctx == NULL) {
    2288           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2289           0 :                 return NULL;
    2290             :         }
    2291           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_LOGON_INFO_CTR);
    2292           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2293           0 :                 TALLOC_FREE(tmp_ctx);
    2294           0 :                 PyErr_SetNdrError(err);
    2295           0 :                 return NULL;
    2296             :         }
    2297             : 
    2298           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2299           0 :         TALLOC_FREE(tmp_ctx);
    2300           0 :         return ret;
    2301             : }
    2302             : 
    2303           0 : static PyObject *py_PAC_LOGON_INFO_CTR_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2304             : {
    2305           0 :         struct PAC_LOGON_INFO_CTR *object = (struct PAC_LOGON_INFO_CTR *)pytalloc_get_ptr(py_obj);
    2306           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    2307           0 :         Py_ssize_t blob_length = 0;
    2308             :         enum ndr_err_code err;
    2309           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    2310           0 :         PyObject *allow_remaining_obj = NULL;
    2311           0 :         bool allow_remaining = false;
    2312             : 
    2313           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    2314             :                 discard_const_p(char *, kwnames),
    2315             :                 &blob.data, &blob_length,
    2316             :                 &allow_remaining_obj)) {
    2317           0 :                 return NULL;
    2318             :         }
    2319           0 :         blob.length = blob_length;
    2320             : 
    2321           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2322           0 :                 allow_remaining = true;
    2323             :         }
    2324             : 
    2325           0 :         if (allow_remaining) {
    2326           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_LOGON_INFO_CTR);
    2327             :         } else {
    2328           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_LOGON_INFO_CTR);
    2329             :         }
    2330           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2331           0 :                 PyErr_SetNdrError(err);
    2332           0 :                 return NULL;
    2333             :         }
    2334             : 
    2335           0 :         Py_RETURN_NONE;
    2336             : }
    2337             : 
    2338           0 : static PyObject *py_PAC_LOGON_INFO_CTR_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2339             : {
    2340           0 :         struct PAC_LOGON_INFO_CTR *object = (struct PAC_LOGON_INFO_CTR *)pytalloc_get_ptr(py_obj);
    2341             :         PyObject *ret;
    2342             :         char *retstr;
    2343             : 
    2344           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_LOGON_INFO_CTR, "PAC_LOGON_INFO_CTR", object);
    2345           0 :         ret = PyUnicode_FromString(retstr);
    2346           0 :         talloc_free(retstr);
    2347             : 
    2348           0 :         return ret;
    2349             : }
    2350             : 
    2351             : static PyMethodDef py_PAC_LOGON_INFO_CTR_methods[] = {
    2352             :         { "__ndr_pack__", (PyCFunction)py_PAC_LOGON_INFO_CTR_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    2353             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_LOGON_INFO_CTR_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    2354             :         { "__ndr_print__", (PyCFunction)py_PAC_LOGON_INFO_CTR_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    2355             :         { NULL, NULL, 0, NULL }
    2356             : };
    2357             : 
    2358             : 
    2359             : static PyTypeObject PAC_LOGON_INFO_CTR_Type = {
    2360             :         PyVarObject_HEAD_INIT(NULL, 0)
    2361             :         .tp_name = "krb5pac.PAC_LOGON_INFO_CTR",
    2362             :         .tp_getset = py_PAC_LOGON_INFO_CTR_getsetters,
    2363             :         .tp_methods = py_PAC_LOGON_INFO_CTR_methods,
    2364             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2365             :         .tp_new = py_PAC_LOGON_INFO_CTR_new,
    2366             : };
    2367             : 
    2368             : 
    2369           0 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_CTR_get_info(PyObject *obj, void *closure)
    2370             : {
    2371           0 :         struct PAC_CONSTRAINED_DELEGATION_CTR *object = (struct PAC_CONSTRAINED_DELEGATION_CTR *)pytalloc_get_ptr(obj);
    2372             :         PyObject *py_info;
    2373           0 :         if (object->info == NULL) {
    2374           0 :                 Py_RETURN_NONE;
    2375             :         }
    2376           0 :         if (object->info == NULL) {
    2377           0 :                 py_info = Py_None;
    2378           0 :                 Py_INCREF(py_info);
    2379             :         } else {
    2380           0 :                 py_info = pytalloc_reference_ex(&PAC_CONSTRAINED_DELEGATION_Type, object->info, object->info);
    2381             :         }
    2382           0 :         return py_info;
    2383             : }
    2384             : 
    2385           0 : static int py_PAC_CONSTRAINED_DELEGATION_CTR_set_info(PyObject *py_obj, PyObject *value, void *closure)
    2386             : {
    2387           0 :         struct PAC_CONSTRAINED_DELEGATION_CTR *object = (struct PAC_CONSTRAINED_DELEGATION_CTR *)pytalloc_get_ptr(py_obj);
    2388           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->info));
    2389           0 :         if (value == NULL) {
    2390           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
    2391           0 :                 return -1;
    2392             :         }
    2393           0 :         if (value == Py_None) {
    2394           0 :                 object->info = NULL;
    2395             :         } else {
    2396           0 :                 object->info = NULL;
    2397           0 :                 PY_CHECK_TYPE(&PAC_CONSTRAINED_DELEGATION_Type, value, return -1;);
    2398           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    2399           0 :                         PyErr_NoMemory();
    2400           0 :                         return -1;
    2401             :                 }
    2402           0 :                 object->info = (struct PAC_CONSTRAINED_DELEGATION *)pytalloc_get_ptr(value);
    2403             :         }
    2404           0 :         return 0;
    2405             : }
    2406             : 
    2407             : static PyGetSetDef py_PAC_CONSTRAINED_DELEGATION_CTR_getsetters[] = {
    2408             :         {
    2409             :                 .name = discard_const_p(char, "info"),
    2410             :                 .get = py_PAC_CONSTRAINED_DELEGATION_CTR_get_info,
    2411             :                 .set = py_PAC_CONSTRAINED_DELEGATION_CTR_set_info,
    2412             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_CONSTRAINED_DELEGATION")
    2413             :         },
    2414             :         { .name = NULL }
    2415             : };
    2416             : 
    2417           0 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_CTR_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2418             : {
    2419           0 :         return pytalloc_new(struct PAC_CONSTRAINED_DELEGATION_CTR, type);
    2420             : }
    2421             : 
    2422           0 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_CTR_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    2423             : {
    2424           0 :         struct PAC_CONSTRAINED_DELEGATION_CTR *object = (struct PAC_CONSTRAINED_DELEGATION_CTR *)pytalloc_get_ptr(py_obj);
    2425           0 :         PyObject *ret = NULL;
    2426             :         DATA_BLOB blob;
    2427             :         enum ndr_err_code err;
    2428           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    2429           0 :         if (tmp_ctx == NULL) {
    2430           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    2431           0 :                 return NULL;
    2432             :         }
    2433           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_CONSTRAINED_DELEGATION_CTR);
    2434           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2435           0 :                 TALLOC_FREE(tmp_ctx);
    2436           0 :                 PyErr_SetNdrError(err);
    2437           0 :                 return NULL;
    2438             :         }
    2439             : 
    2440           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    2441           0 :         TALLOC_FREE(tmp_ctx);
    2442           0 :         return ret;
    2443             : }
    2444             : 
    2445           0 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_CTR_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    2446             : {
    2447           0 :         struct PAC_CONSTRAINED_DELEGATION_CTR *object = (struct PAC_CONSTRAINED_DELEGATION_CTR *)pytalloc_get_ptr(py_obj);
    2448           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    2449           0 :         Py_ssize_t blob_length = 0;
    2450             :         enum ndr_err_code err;
    2451           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    2452           0 :         PyObject *allow_remaining_obj = NULL;
    2453           0 :         bool allow_remaining = false;
    2454             : 
    2455           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    2456             :                 discard_const_p(char *, kwnames),
    2457             :                 &blob.data, &blob_length,
    2458             :                 &allow_remaining_obj)) {
    2459           0 :                 return NULL;
    2460             :         }
    2461           0 :         blob.length = blob_length;
    2462             : 
    2463           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    2464           0 :                 allow_remaining = true;
    2465             :         }
    2466             : 
    2467           0 :         if (allow_remaining) {
    2468           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CONSTRAINED_DELEGATION_CTR);
    2469             :         } else {
    2470           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_CONSTRAINED_DELEGATION_CTR);
    2471             :         }
    2472           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    2473           0 :                 PyErr_SetNdrError(err);
    2474           0 :                 return NULL;
    2475             :         }
    2476             : 
    2477           0 :         Py_RETURN_NONE;
    2478             : }
    2479             : 
    2480           0 : static PyObject *py_PAC_CONSTRAINED_DELEGATION_CTR_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    2481             : {
    2482           0 :         struct PAC_CONSTRAINED_DELEGATION_CTR *object = (struct PAC_CONSTRAINED_DELEGATION_CTR *)pytalloc_get_ptr(py_obj);
    2483             :         PyObject *ret;
    2484             :         char *retstr;
    2485             : 
    2486           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_CONSTRAINED_DELEGATION_CTR, "PAC_CONSTRAINED_DELEGATION_CTR", object);
    2487           0 :         ret = PyUnicode_FromString(retstr);
    2488           0 :         talloc_free(retstr);
    2489             : 
    2490           0 :         return ret;
    2491             : }
    2492             : 
    2493             : static PyMethodDef py_PAC_CONSTRAINED_DELEGATION_CTR_methods[] = {
    2494             :         { "__ndr_pack__", (PyCFunction)py_PAC_CONSTRAINED_DELEGATION_CTR_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    2495             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_CONSTRAINED_DELEGATION_CTR_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    2496             :         { "__ndr_print__", (PyCFunction)py_PAC_CONSTRAINED_DELEGATION_CTR_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    2497             :         { NULL, NULL, 0, NULL }
    2498             : };
    2499             : 
    2500             : 
    2501             : static PyTypeObject PAC_CONSTRAINED_DELEGATION_CTR_Type = {
    2502             :         PyVarObject_HEAD_INIT(NULL, 0)
    2503             :         .tp_name = "krb5pac.PAC_CONSTRAINED_DELEGATION_CTR",
    2504             :         .tp_getset = py_PAC_CONSTRAINED_DELEGATION_CTR_getsetters,
    2505             :         .tp_methods = py_PAC_CONSTRAINED_DELEGATION_CTR_methods,
    2506             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2507             :         .tp_new = py_PAC_CONSTRAINED_DELEGATION_CTR_new,
    2508             : };
    2509             : 
    2510             : 
    2511           0 : static PyObject *py_DATA_BLOB_REM_get_remaining(PyObject *obj, void *closure)
    2512             : {
    2513           0 :         struct DATA_BLOB_REM *object = (struct DATA_BLOB_REM *)pytalloc_get_ptr(obj);
    2514             :         PyObject *py_remaining;
    2515           0 :         py_remaining = PyBytes_FromStringAndSize((char *)(object->remaining).data, (object->remaining).length);
    2516           0 :         return py_remaining;
    2517             : }
    2518             : 
    2519           0 : static int py_DATA_BLOB_REM_set_remaining(PyObject *py_obj, PyObject *value, void *closure)
    2520             : {
    2521           0 :         struct DATA_BLOB_REM *object = (struct DATA_BLOB_REM *)pytalloc_get_ptr(py_obj);
    2522           0 :         if (value == NULL) {
    2523           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->remaining");
    2524           0 :                 return -1;
    2525             :         }
    2526           0 :         object->remaining = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
    2527           0 :         return 0;
    2528             : }
    2529             : 
    2530             : static PyGetSetDef py_DATA_BLOB_REM_getsetters[] = {
    2531             :         {
    2532             :                 .name = discard_const_p(char, "remaining"),
    2533             :                 .get = py_DATA_BLOB_REM_get_remaining,
    2534             :                 .set = py_DATA_BLOB_REM_set_remaining,
    2535             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
    2536             :         },
    2537             :         { .name = NULL }
    2538             : };
    2539             : 
    2540           0 : static PyObject *py_DATA_BLOB_REM_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2541             : {
    2542           0 :         return pytalloc_new(struct DATA_BLOB_REM, type);
    2543             : }
    2544             : 
    2545             : 
    2546             : static PyTypeObject DATA_BLOB_REM_Type = {
    2547             :         PyVarObject_HEAD_INIT(NULL, 0)
    2548             :         .tp_name = "krb5pac.DATA_BLOB_REM",
    2549             :         .tp_getset = py_DATA_BLOB_REM_getsetters,
    2550             :         .tp_methods = NULL,
    2551             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2552             :         .tp_new = py_DATA_BLOB_REM_new,
    2553             : };
    2554             : 
    2555          24 : static PyObject *py_import_PAC_INFO(TALLOC_CTX *mem_ctx, int level, union PAC_INFO *in)
    2556             : {
    2557             :         PyObject *ret;
    2558             : 
    2559          24 :         switch (level) {
    2560          12 :                 case PAC_TYPE_LOGON_INFO:
    2561          12 :                         ret = pytalloc_reference_ex(&PAC_LOGON_INFO_CTR_Type, mem_ctx, &in->logon_info);
    2562          12 :                         return ret;
    2563             : 
    2564           0 :                 case PAC_TYPE_CREDENTIAL_INFO:
    2565           0 :                         ret = pytalloc_reference_ex(&PAC_CREDENTIAL_INFO_Type, mem_ctx, &in->credential_info);
    2566           0 :                         return ret;
    2567             : 
    2568           0 :                 case PAC_TYPE_SRV_CHECKSUM:
    2569           0 :                         ret = pytalloc_reference_ex(&PAC_SIGNATURE_DATA_Type, mem_ctx, &in->srv_cksum);
    2570           0 :                         return ret;
    2571             : 
    2572           0 :                 case PAC_TYPE_KDC_CHECKSUM:
    2573           0 :                         ret = pytalloc_reference_ex(&PAC_SIGNATURE_DATA_Type, mem_ctx, &in->kdc_cksum);
    2574           0 :                         return ret;
    2575             : 
    2576           4 :                 case PAC_TYPE_LOGON_NAME:
    2577           4 :                         ret = pytalloc_reference_ex(&PAC_LOGON_NAME_Type, mem_ctx, &in->logon_name);
    2578           4 :                         return ret;
    2579             : 
    2580           0 :                 case PAC_TYPE_CONSTRAINED_DELEGATION:
    2581           0 :                         ret = pytalloc_reference_ex(&PAC_CONSTRAINED_DELEGATION_CTR_Type, mem_ctx, &in->constrained_delegation);
    2582           0 :                         return ret;
    2583             : 
    2584           8 :                 case PAC_TYPE_UPN_DNS_INFO:
    2585           8 :                         ret = pytalloc_reference_ex(&PAC_UPN_DNS_INFO_Type, mem_ctx, &in->upn_dns_info);
    2586           8 :                         return ret;
    2587             : 
    2588           0 :                 case PAC_TYPE_TICKET_CHECKSUM:
    2589           0 :                         ret = pytalloc_reference_ex(&PAC_SIGNATURE_DATA_Type, mem_ctx, &in->ticket_checksum);
    2590           0 :                         return ret;
    2591             : 
    2592           0 :                 default:
    2593           0 :                         ret = pytalloc_reference_ex(&DATA_BLOB_REM_Type, mem_ctx, &in->unknown);
    2594           0 :                         return ret;
    2595             : 
    2596             :         }
    2597             :         PyErr_SetString(PyExc_TypeError, "unknown union level");
    2598             :         return NULL;
    2599             : }
    2600             : 
    2601           0 : static union PAC_INFO *py_export_PAC_INFO(TALLOC_CTX *mem_ctx, int level, PyObject *in)
    2602             : {
    2603           0 :         union PAC_INFO *ret = talloc_zero(mem_ctx, union PAC_INFO);
    2604           0 :         switch (level) {
    2605           0 :                 case PAC_TYPE_LOGON_INFO:
    2606           0 :                         if (in == NULL) {
    2607           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->logon_info");
    2608           0 :                                 talloc_free(ret); return NULL;
    2609             :                         }
    2610           0 :                         PY_CHECK_TYPE(&PAC_LOGON_INFO_CTR_Type, in, talloc_free(ret); return NULL;);
    2611           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    2612           0 :                                 PyErr_NoMemory();
    2613           0 :                                 talloc_free(ret); return NULL;
    2614             :                         }
    2615           0 :                         ret->logon_info = *(struct PAC_LOGON_INFO_CTR *)pytalloc_get_ptr(in);
    2616           0 :                         break;
    2617             : 
    2618           0 :                 case PAC_TYPE_CREDENTIAL_INFO:
    2619           0 :                         if (in == NULL) {
    2620           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->credential_info");
    2621           0 :                                 talloc_free(ret); return NULL;
    2622             :                         }
    2623           0 :                         PY_CHECK_TYPE(&PAC_CREDENTIAL_INFO_Type, in, talloc_free(ret); return NULL;);
    2624           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    2625           0 :                                 PyErr_NoMemory();
    2626           0 :                                 talloc_free(ret); return NULL;
    2627             :                         }
    2628           0 :                         ret->credential_info = *(struct PAC_CREDENTIAL_INFO *)pytalloc_get_ptr(in);
    2629           0 :                         break;
    2630             : 
    2631           0 :                 case PAC_TYPE_SRV_CHECKSUM:
    2632           0 :                         if (in == NULL) {
    2633           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->srv_cksum");
    2634           0 :                                 talloc_free(ret); return NULL;
    2635             :                         }
    2636           0 :                         PY_CHECK_TYPE(&PAC_SIGNATURE_DATA_Type, in, talloc_free(ret); return NULL;);
    2637           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    2638           0 :                                 PyErr_NoMemory();
    2639           0 :                                 talloc_free(ret); return NULL;
    2640             :                         }
    2641           0 :                         ret->srv_cksum = *(struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(in);
    2642           0 :                         break;
    2643             : 
    2644           0 :                 case PAC_TYPE_KDC_CHECKSUM:
    2645           0 :                         if (in == NULL) {
    2646           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->kdc_cksum");
    2647           0 :                                 talloc_free(ret); return NULL;
    2648             :                         }
    2649           0 :                         PY_CHECK_TYPE(&PAC_SIGNATURE_DATA_Type, in, talloc_free(ret); return NULL;);
    2650           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    2651           0 :                                 PyErr_NoMemory();
    2652           0 :                                 talloc_free(ret); return NULL;
    2653             :                         }
    2654           0 :                         ret->kdc_cksum = *(struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(in);
    2655           0 :                         break;
    2656             : 
    2657           0 :                 case PAC_TYPE_LOGON_NAME:
    2658           0 :                         if (in == NULL) {
    2659           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->logon_name");
    2660           0 :                                 talloc_free(ret); return NULL;
    2661             :                         }
    2662           0 :                         PY_CHECK_TYPE(&PAC_LOGON_NAME_Type, in, talloc_free(ret); return NULL;);
    2663           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    2664           0 :                                 PyErr_NoMemory();
    2665           0 :                                 talloc_free(ret); return NULL;
    2666             :                         }
    2667           0 :                         ret->logon_name = *(struct PAC_LOGON_NAME *)pytalloc_get_ptr(in);
    2668           0 :                         break;
    2669             : 
    2670           0 :                 case PAC_TYPE_CONSTRAINED_DELEGATION:
    2671           0 :                         if (in == NULL) {
    2672           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->constrained_delegation");
    2673           0 :                                 talloc_free(ret); return NULL;
    2674             :                         }
    2675           0 :                         PY_CHECK_TYPE(&PAC_CONSTRAINED_DELEGATION_CTR_Type, in, talloc_free(ret); return NULL;);
    2676           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    2677           0 :                                 PyErr_NoMemory();
    2678           0 :                                 talloc_free(ret); return NULL;
    2679             :                         }
    2680           0 :                         ret->constrained_delegation = *(struct PAC_CONSTRAINED_DELEGATION_CTR *)pytalloc_get_ptr(in);
    2681           0 :                         break;
    2682             : 
    2683           0 :                 case PAC_TYPE_UPN_DNS_INFO:
    2684           0 :                         if (in == NULL) {
    2685           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->upn_dns_info");
    2686           0 :                                 talloc_free(ret); return NULL;
    2687             :                         }
    2688           0 :                         PY_CHECK_TYPE(&PAC_UPN_DNS_INFO_Type, in, talloc_free(ret); return NULL;);
    2689           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    2690           0 :                                 PyErr_NoMemory();
    2691           0 :                                 talloc_free(ret); return NULL;
    2692             :                         }
    2693           0 :                         ret->upn_dns_info = *(struct PAC_UPN_DNS_INFO *)pytalloc_get_ptr(in);
    2694           0 :                         break;
    2695             : 
    2696           0 :                 case PAC_TYPE_TICKET_CHECKSUM:
    2697           0 :                         if (in == NULL) {
    2698           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ticket_checksum");
    2699           0 :                                 talloc_free(ret); return NULL;
    2700             :                         }
    2701           0 :                         PY_CHECK_TYPE(&PAC_SIGNATURE_DATA_Type, in, talloc_free(ret); return NULL;);
    2702           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    2703           0 :                                 PyErr_NoMemory();
    2704           0 :                                 talloc_free(ret); return NULL;
    2705             :                         }
    2706           0 :                         ret->ticket_checksum = *(struct PAC_SIGNATURE_DATA *)pytalloc_get_ptr(in);
    2707           0 :                         break;
    2708             : 
    2709           0 :                 default:
    2710           0 :                         if (in == NULL) {
    2711           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->unknown");
    2712           0 :                                 talloc_free(ret); return NULL;
    2713             :                         }
    2714           0 :                         PY_CHECK_TYPE(&DATA_BLOB_REM_Type, in, talloc_free(ret); return NULL;);
    2715           0 :                         if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    2716           0 :                                 PyErr_NoMemory();
    2717           0 :                                 talloc_free(ret); return NULL;
    2718             :                         }
    2719           0 :                         ret->unknown = *(struct DATA_BLOB_REM *)pytalloc_get_ptr(in);
    2720           0 :                         break;
    2721             : 
    2722             :         }
    2723             : 
    2724           0 :         return ret;
    2725             : }
    2726             : 
    2727          24 : static PyObject *py_PAC_INFO_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2728             : {
    2729          24 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    2730          24 :         PyObject *mem_ctx_obj = NULL;
    2731          24 :         TALLOC_CTX *mem_ctx = NULL;
    2732          24 :         int level = 0;
    2733          24 :         PyObject *in_obj = NULL;
    2734          24 :         union PAC_INFO *in = NULL;
    2735             : 
    2736          24 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
    2737             :                 discard_const_p(char *, kwnames),
    2738             :                 &mem_ctx_obj,
    2739             :                 &level,
    2740             :                 &in_obj)) {
    2741           0 :                 return NULL;
    2742             :         }
    2743          24 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    2744          24 :         if (mem_ctx == NULL) {
    2745           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    2746           0 :                 return NULL;
    2747             :         }
    2748          24 :         in = (union PAC_INFO *)pytalloc_get_ptr(in_obj);
    2749          24 :         if (in == NULL) {
    2750           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union PAC_INFO!");
    2751           0 :                 return NULL;
    2752             :         }
    2753             : 
    2754          24 :         return py_import_PAC_INFO(mem_ctx, level, in);
    2755             : }
    2756             : 
    2757           0 : static PyObject *py_PAC_INFO_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2758             : {
    2759           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    2760           0 :         PyObject *mem_ctx_obj = NULL;
    2761           0 :         TALLOC_CTX *mem_ctx = NULL;
    2762           0 :         int level = 0;
    2763           0 :         PyObject *in = NULL;
    2764           0 :         union PAC_INFO *out = NULL;
    2765             : 
    2766           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
    2767             :                 discard_const_p(char *, kwnames),
    2768             :                 &mem_ctx_obj,
    2769             :                 &level,
    2770             :                 &in)) {
    2771           0 :                 return NULL;
    2772             :         }
    2773           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    2774           0 :         if (mem_ctx == NULL) {
    2775           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    2776           0 :                 return NULL;
    2777             :         }
    2778             : 
    2779           0 :         out = py_export_PAC_INFO(mem_ctx, level, in);
    2780           0 :         if (out == NULL) {
    2781           0 :                 return NULL;
    2782             :         }
    2783             : 
    2784           0 :         return pytalloc_GenericObject_reference(out);
    2785             : }
    2786             : 
    2787             : static PyMethodDef py_PAC_INFO_methods[] = {
    2788             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_INFO_import),
    2789             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    2790             :                 "T.__import__(mem_ctx, level, in) => ret." },
    2791             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_INFO_export),
    2792             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    2793             :                 "T.__export__(mem_ctx, level, in) => ret." },
    2794             :         { NULL, NULL, 0, NULL }
    2795             : };
    2796             : 
    2797           0 : static PyObject *py_PAC_INFO_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2798             : {
    2799           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    2800           0 :         return NULL;
    2801             : }
    2802             : 
    2803             : 
    2804             : static PyTypeObject PAC_INFO_Type = {
    2805             :         PyVarObject_HEAD_INIT(NULL, 0)
    2806             :         .tp_name = "krb5pac.PAC_INFO",
    2807             :         .tp_getset = NULL,
    2808             :         .tp_methods = py_PAC_INFO_methods,
    2809             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2810             :         .tp_new = py_PAC_INFO_new,
    2811             : };
    2812             : 
    2813             : 
    2814          48 : static PyObject *py_PAC_BUFFER_get_type(PyObject *obj, void *closure)
    2815             : {
    2816          48 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(obj);
    2817             :         PyObject *py_type;
    2818          48 :         py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
    2819          48 :         return py_type;
    2820             : }
    2821             : 
    2822           0 : static int py_PAC_BUFFER_set_type(PyObject *py_obj, PyObject *value, void *closure)
    2823             : {
    2824           0 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(py_obj);
    2825           0 :         if (value == NULL) {
    2826           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
    2827           0 :                 return -1;
    2828             :         }
    2829             :         {
    2830           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
    2831           0 :                 if (PyLong_Check(value)) {
    2832             :                         unsigned long long test_var;
    2833           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2834           0 :                         if (PyErr_Occurred() != NULL) {
    2835           0 :                                 return -1;
    2836             :                         }
    2837           0 :                         if (test_var > uint_max) {
    2838           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2839             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2840           0 :                                 return -1;
    2841             :                         }
    2842           0 :                         object->type = test_var;
    2843             :                 } else {
    2844           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2845             :                           PyLong_Type.tp_name);
    2846           0 :                         return -1;
    2847             :                 }
    2848             :         }
    2849           0 :         return 0;
    2850             : }
    2851             : 
    2852           0 : static PyObject *py_PAC_BUFFER_get__ndr_size(PyObject *obj, void *closure)
    2853             : {
    2854           0 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(obj);
    2855             :         PyObject *py__ndr_size;
    2856           0 :         py__ndr_size = PyLong_FromUnsignedLongLong((uint32_t)object->_ndr_size);
    2857           0 :         return py__ndr_size;
    2858             : }
    2859             : 
    2860           0 : static int py_PAC_BUFFER_set__ndr_size(PyObject *py_obj, PyObject *value, void *closure)
    2861             : {
    2862           0 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(py_obj);
    2863           0 :         if (value == NULL) {
    2864           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_ndr_size");
    2865           0 :                 return -1;
    2866             :         }
    2867             :         {
    2868           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_ndr_size));
    2869           0 :                 if (PyLong_Check(value)) {
    2870             :                         unsigned long long test_var;
    2871           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2872           0 :                         if (PyErr_Occurred() != NULL) {
    2873           0 :                                 return -1;
    2874             :                         }
    2875           0 :                         if (test_var > uint_max) {
    2876           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2877             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2878           0 :                                 return -1;
    2879             :                         }
    2880           0 :                         object->_ndr_size = test_var;
    2881             :                 } else {
    2882           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2883             :                           PyLong_Type.tp_name);
    2884           0 :                         return -1;
    2885             :                 }
    2886             :         }
    2887           0 :         return 0;
    2888             : }
    2889             : 
    2890          24 : static PyObject *py_PAC_BUFFER_get_info(PyObject *obj, void *closure)
    2891             : {
    2892          24 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(obj);
    2893             :         PyObject *py_info;
    2894          24 :         if (object->info == NULL) {
    2895           0 :                 Py_RETURN_NONE;
    2896             :         }
    2897          24 :         if (object->info == NULL) {
    2898           0 :                 py_info = Py_None;
    2899           0 :                 Py_INCREF(py_info);
    2900             :         } else {
    2901          24 :                 py_info = pyrpc_import_union(&PAC_INFO_Type, object->info, object->type, object->info, "union PAC_INFO");
    2902          24 :                 if (py_info == NULL) {
    2903           0 :                         return NULL;
    2904             :                 }
    2905             :         }
    2906          24 :         return py_info;
    2907             : }
    2908             : 
    2909           0 : static int py_PAC_BUFFER_set_info(PyObject *py_obj, PyObject *value, void *closure)
    2910             : {
    2911           0 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(py_obj);
    2912           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->info));
    2913           0 :         if (value == NULL) {
    2914           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
    2915           0 :                 return -1;
    2916             :         }
    2917           0 :         if (value == Py_None) {
    2918           0 :                 object->info = NULL;
    2919             :         } else {
    2920           0 :                 object->info = NULL;
    2921             :                 {
    2922             :                         union PAC_INFO *info_switch_2;
    2923           0 :                         info_switch_2 = (union PAC_INFO *)pyrpc_export_union(&PAC_INFO_Type, pytalloc_get_mem_ctx(py_obj), object->type, value, "union PAC_INFO");
    2924           0 :                         if (info_switch_2 == NULL) {
    2925           0 :                                 return -1;
    2926             :                         }
    2927           0 :                         object->info = info_switch_2;
    2928             :                 }
    2929             :         }
    2930           0 :         return 0;
    2931             : }
    2932             : 
    2933           0 : static PyObject *py_PAC_BUFFER_get__pad(PyObject *obj, void *closure)
    2934             : {
    2935           0 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(obj);
    2936             :         PyObject *py__pad;
    2937           0 :         py__pad = PyLong_FromUnsignedLongLong((uint32_t)object->_pad);
    2938           0 :         return py__pad;
    2939             : }
    2940             : 
    2941           0 : static int py_PAC_BUFFER_set__pad(PyObject *py_obj, PyObject *value, void *closure)
    2942             : {
    2943           0 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(py_obj);
    2944           0 :         if (value == NULL) {
    2945           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_pad");
    2946           0 :                 return -1;
    2947             :         }
    2948             :         {
    2949           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_pad));
    2950           0 :                 if (PyLong_Check(value)) {
    2951             :                         unsigned long long test_var;
    2952           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2953           0 :                         if (PyErr_Occurred() != NULL) {
    2954           0 :                                 return -1;
    2955             :                         }
    2956           0 :                         if (test_var > uint_max) {
    2957           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2958             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2959           0 :                                 return -1;
    2960             :                         }
    2961           0 :                         object->_pad = test_var;
    2962             :                 } else {
    2963           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2964             :                           PyLong_Type.tp_name);
    2965           0 :                         return -1;
    2966             :                 }
    2967             :         }
    2968           0 :         return 0;
    2969             : }
    2970             : 
    2971             : static PyGetSetDef py_PAC_BUFFER_getsetters[] = {
    2972             :         {
    2973             :                 .name = discard_const_p(char, "type"),
    2974             :                 .get = py_PAC_BUFFER_get_type,
    2975             :                 .set = py_PAC_BUFFER_set_type,
    2976             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_TYPE")
    2977             :         },
    2978             :         {
    2979             :                 .name = discard_const_p(char, "_ndr_size"),
    2980             :                 .get = py_PAC_BUFFER_get__ndr_size,
    2981             :                 .set = py_PAC_BUFFER_set__ndr_size,
    2982             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2983             :         },
    2984             :         {
    2985             :                 .name = discard_const_p(char, "info"),
    2986             :                 .get = py_PAC_BUFFER_get_info,
    2987             :                 .set = py_PAC_BUFFER_set_info,
    2988             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_INFO")
    2989             :         },
    2990             :         {
    2991             :                 .name = discard_const_p(char, "_pad"),
    2992             :                 .get = py_PAC_BUFFER_get__pad,
    2993             :                 .set = py_PAC_BUFFER_set__pad,
    2994             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2995             :         },
    2996             :         { .name = NULL }
    2997             : };
    2998             : 
    2999           0 : static PyObject *py_PAC_BUFFER_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3000             : {
    3001           0 :         return pytalloc_new(struct PAC_BUFFER, type);
    3002             : }
    3003             : 
    3004           0 : static PyObject *py_PAC_BUFFER_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    3005             : {
    3006           0 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(py_obj);
    3007           0 :         PyObject *ret = NULL;
    3008             :         DATA_BLOB blob;
    3009             :         enum ndr_err_code err;
    3010           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    3011           0 :         if (tmp_ctx == NULL) {
    3012           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3013           0 :                 return NULL;
    3014             :         }
    3015           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_BUFFER);
    3016           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3017           0 :                 TALLOC_FREE(tmp_ctx);
    3018           0 :                 PyErr_SetNdrError(err);
    3019           0 :                 return NULL;
    3020             :         }
    3021             : 
    3022           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    3023           0 :         TALLOC_FREE(tmp_ctx);
    3024           0 :         return ret;
    3025             : }
    3026             : 
    3027           0 : static PyObject *py_PAC_BUFFER_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3028             : {
    3029           0 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(py_obj);
    3030           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    3031           0 :         Py_ssize_t blob_length = 0;
    3032             :         enum ndr_err_code err;
    3033           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    3034           0 :         PyObject *allow_remaining_obj = NULL;
    3035           0 :         bool allow_remaining = false;
    3036             : 
    3037           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    3038             :                 discard_const_p(char *, kwnames),
    3039             :                 &blob.data, &blob_length,
    3040             :                 &allow_remaining_obj)) {
    3041           0 :                 return NULL;
    3042             :         }
    3043           0 :         blob.length = blob_length;
    3044             : 
    3045           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3046           0 :                 allow_remaining = true;
    3047             :         }
    3048             : 
    3049           0 :         if (allow_remaining) {
    3050           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_BUFFER);
    3051             :         } else {
    3052           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_BUFFER);
    3053             :         }
    3054           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3055           0 :                 PyErr_SetNdrError(err);
    3056           0 :                 return NULL;
    3057             :         }
    3058             : 
    3059           0 :         Py_RETURN_NONE;
    3060             : }
    3061             : 
    3062           0 : static PyObject *py_PAC_BUFFER_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3063             : {
    3064           0 :         struct PAC_BUFFER *object = (struct PAC_BUFFER *)pytalloc_get_ptr(py_obj);
    3065             :         PyObject *ret;
    3066             :         char *retstr;
    3067             : 
    3068           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_BUFFER, "PAC_BUFFER", object);
    3069           0 :         ret = PyUnicode_FromString(retstr);
    3070           0 :         talloc_free(retstr);
    3071             : 
    3072           0 :         return ret;
    3073             : }
    3074             : 
    3075             : static PyMethodDef py_PAC_BUFFER_methods[] = {
    3076             :         { "__ndr_pack__", (PyCFunction)py_PAC_BUFFER_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    3077             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_BUFFER_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    3078             :         { "__ndr_print__", (PyCFunction)py_PAC_BUFFER_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    3079             :         { NULL, NULL, 0, NULL }
    3080             : };
    3081             : 
    3082             : 
    3083             : static PyTypeObject PAC_BUFFER_Type = {
    3084             :         PyVarObject_HEAD_INIT(NULL, 0)
    3085             :         .tp_name = "krb5pac.PAC_BUFFER",
    3086             :         .tp_getset = py_PAC_BUFFER_getsetters,
    3087             :         .tp_methods = py_PAC_BUFFER_methods,
    3088             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3089             :         .tp_new = py_PAC_BUFFER_new,
    3090             : };
    3091             : 
    3092             : 
    3093           0 : static PyObject *py_PAC_DATA_get_num_buffers(PyObject *obj, void *closure)
    3094             : {
    3095           0 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(obj);
    3096             :         PyObject *py_num_buffers;
    3097           0 :         py_num_buffers = PyLong_FromUnsignedLongLong((uint32_t)object->num_buffers);
    3098           0 :         return py_num_buffers;
    3099             : }
    3100             : 
    3101           0 : static int py_PAC_DATA_set_num_buffers(PyObject *py_obj, PyObject *value, void *closure)
    3102             : {
    3103           0 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(py_obj);
    3104           0 :         if (value == NULL) {
    3105           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_buffers");
    3106           0 :                 return -1;
    3107             :         }
    3108             :         {
    3109           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_buffers));
    3110           0 :                 if (PyLong_Check(value)) {
    3111             :                         unsigned long long test_var;
    3112           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3113           0 :                         if (PyErr_Occurred() != NULL) {
    3114           0 :                                 return -1;
    3115             :                         }
    3116           0 :                         if (test_var > uint_max) {
    3117           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3118             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3119           0 :                                 return -1;
    3120             :                         }
    3121           0 :                         object->num_buffers = test_var;
    3122             :                 } else {
    3123           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3124             :                           PyLong_Type.tp_name);
    3125           0 :                         return -1;
    3126             :                 }
    3127             :         }
    3128           0 :         return 0;
    3129             : }
    3130             : 
    3131           0 : static PyObject *py_PAC_DATA_get_version(PyObject *obj, void *closure)
    3132             : {
    3133           0 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(obj);
    3134             :         PyObject *py_version;
    3135           0 :         py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
    3136           0 :         return py_version;
    3137             : }
    3138             : 
    3139           0 : static int py_PAC_DATA_set_version(PyObject *py_obj, PyObject *value, void *closure)
    3140             : {
    3141           0 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(py_obj);
    3142           0 :         if (value == NULL) {
    3143           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
    3144           0 :                 return -1;
    3145             :         }
    3146             :         {
    3147           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
    3148           0 :                 if (PyLong_Check(value)) {
    3149             :                         unsigned long long test_var;
    3150           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3151           0 :                         if (PyErr_Occurred() != NULL) {
    3152           0 :                                 return -1;
    3153             :                         }
    3154           0 :                         if (test_var > uint_max) {
    3155           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3156             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3157           0 :                                 return -1;
    3158             :                         }
    3159           0 :                         object->version = test_var;
    3160             :                 } else {
    3161           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3162             :                           PyLong_Type.tp_name);
    3163           0 :                         return -1;
    3164             :                 }
    3165             :         }
    3166           0 :         return 0;
    3167             : }
    3168             : 
    3169           4 : static PyObject *py_PAC_DATA_get_buffers(PyObject *obj, void *closure)
    3170             : {
    3171           4 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(obj);
    3172             :         PyObject *py_buffers;
    3173           4 :         py_buffers = PyList_New(object->num_buffers);
    3174           4 :         if (py_buffers == NULL) {
    3175           0 :                 return NULL;
    3176             :         }
    3177             :         {
    3178             :                 int buffers_cntr_0;
    3179          24 :                 for (buffers_cntr_0 = 0; buffers_cntr_0 < (object->num_buffers); buffers_cntr_0++) {
    3180             :                         PyObject *py_buffers_0;
    3181          20 :                         py_buffers_0 = pytalloc_reference_ex(&PAC_BUFFER_Type, object->buffers, &object->buffers[buffers_cntr_0]);
    3182          20 :                         PyList_SetItem(py_buffers, buffers_cntr_0, py_buffers_0);
    3183             :                 }
    3184             :         }
    3185           4 :         return py_buffers;
    3186             : }
    3187             : 
    3188           0 : static int py_PAC_DATA_set_buffers(PyObject *py_obj, PyObject *value, void *closure)
    3189             : {
    3190           0 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(py_obj);
    3191           0 :         if (value == NULL) {
    3192           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buffers");
    3193           0 :                 return -1;
    3194             :         }
    3195           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    3196             :         {
    3197             :                 int buffers_cntr_0;
    3198           0 :                 object->buffers = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->buffers, PyList_GET_SIZE(value));
    3199           0 :                 if (!object->buffers) { return -1;; }
    3200           0 :                 talloc_set_name_const(object->buffers, "ARRAY: object->buffers");
    3201           0 :                 for (buffers_cntr_0 = 0; buffers_cntr_0 < PyList_GET_SIZE(value); buffers_cntr_0++) {
    3202           0 :                         if (PyList_GET_ITEM(value, buffers_cntr_0) == NULL) {
    3203           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buffers[buffers_cntr_0]");
    3204           0 :                                 return -1;
    3205             :                         }
    3206           0 :                         PY_CHECK_TYPE(&PAC_BUFFER_Type, PyList_GET_ITEM(value, buffers_cntr_0), return -1;);
    3207           0 :                         if (talloc_reference(object->buffers, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, buffers_cntr_0))) == NULL) {
    3208           0 :                                 PyErr_NoMemory();
    3209           0 :                                 return -1;
    3210             :                         }
    3211           0 :                         object->buffers[buffers_cntr_0] = *(struct PAC_BUFFER *)pytalloc_get_ptr(PyList_GET_ITEM(value, buffers_cntr_0));
    3212             :                 }
    3213             :         }
    3214           0 :         return 0;
    3215             : }
    3216             : 
    3217             : static PyGetSetDef py_PAC_DATA_getsetters[] = {
    3218             :         {
    3219             :                 .name = discard_const_p(char, "num_buffers"),
    3220             :                 .get = py_PAC_DATA_get_num_buffers,
    3221             :                 .set = py_PAC_DATA_set_num_buffers,
    3222             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3223             :         },
    3224             :         {
    3225             :                 .name = discard_const_p(char, "version"),
    3226             :                 .get = py_PAC_DATA_get_version,
    3227             :                 .set = py_PAC_DATA_set_version,
    3228             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3229             :         },
    3230             :         {
    3231             :                 .name = discard_const_p(char, "buffers"),
    3232             :                 .get = py_PAC_DATA_get_buffers,
    3233             :                 .set = py_PAC_DATA_set_buffers,
    3234             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_BUFFER")
    3235             :         },
    3236             :         { .name = NULL }
    3237             : };
    3238             : 
    3239           4 : static PyObject *py_PAC_DATA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3240             : {
    3241           4 :         return pytalloc_new(struct PAC_DATA, type);
    3242             : }
    3243             : 
    3244           0 : static PyObject *py_PAC_DATA_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    3245             : {
    3246           0 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(py_obj);
    3247           0 :         PyObject *ret = NULL;
    3248             :         DATA_BLOB blob;
    3249             :         enum ndr_err_code err;
    3250           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    3251           0 :         if (tmp_ctx == NULL) {
    3252           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3253           0 :                 return NULL;
    3254             :         }
    3255           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_DATA);
    3256           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3257           0 :                 TALLOC_FREE(tmp_ctx);
    3258           0 :                 PyErr_SetNdrError(err);
    3259           0 :                 return NULL;
    3260             :         }
    3261             : 
    3262           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    3263           0 :         TALLOC_FREE(tmp_ctx);
    3264           0 :         return ret;
    3265             : }
    3266             : 
    3267           4 : static PyObject *py_PAC_DATA_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3268             : {
    3269           4 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(py_obj);
    3270           4 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    3271           4 :         Py_ssize_t blob_length = 0;
    3272             :         enum ndr_err_code err;
    3273           4 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    3274           4 :         PyObject *allow_remaining_obj = NULL;
    3275           4 :         bool allow_remaining = false;
    3276             : 
    3277           4 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    3278             :                 discard_const_p(char *, kwnames),
    3279             :                 &blob.data, &blob_length,
    3280             :                 &allow_remaining_obj)) {
    3281           0 :                 return NULL;
    3282             :         }
    3283           4 :         blob.length = blob_length;
    3284             : 
    3285           4 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3286           0 :                 allow_remaining = true;
    3287             :         }
    3288             : 
    3289           4 :         if (allow_remaining) {
    3290           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_DATA);
    3291             :         } else {
    3292           4 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_DATA);
    3293             :         }
    3294           4 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3295           0 :                 PyErr_SetNdrError(err);
    3296           0 :                 return NULL;
    3297             :         }
    3298             : 
    3299           4 :         Py_RETURN_NONE;
    3300             : }
    3301             : 
    3302           0 : static PyObject *py_PAC_DATA_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3303             : {
    3304           0 :         struct PAC_DATA *object = (struct PAC_DATA *)pytalloc_get_ptr(py_obj);
    3305             :         PyObject *ret;
    3306             :         char *retstr;
    3307             : 
    3308           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_DATA, "PAC_DATA", object);
    3309           0 :         ret = PyUnicode_FromString(retstr);
    3310           0 :         talloc_free(retstr);
    3311             : 
    3312           0 :         return ret;
    3313             : }
    3314             : 
    3315             : static PyMethodDef py_PAC_DATA_methods[] = {
    3316             :         { "__ndr_pack__", (PyCFunction)py_PAC_DATA_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    3317             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_DATA_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    3318             :         { "__ndr_print__", (PyCFunction)py_PAC_DATA_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    3319             :         { NULL, NULL, 0, NULL }
    3320             : };
    3321             : 
    3322             : 
    3323             : static PyTypeObject PAC_DATA_Type = {
    3324             :         PyVarObject_HEAD_INIT(NULL, 0)
    3325             :         .tp_name = "krb5pac.PAC_DATA",
    3326             :         .tp_getset = py_PAC_DATA_getsetters,
    3327             :         .tp_methods = py_PAC_DATA_methods,
    3328             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3329             :         .tp_new = py_PAC_DATA_new,
    3330             : };
    3331             : 
    3332             : 
    3333           0 : static PyObject *py_PAC_BUFFER_RAW_get_type(PyObject *obj, void *closure)
    3334             : {
    3335           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(obj);
    3336             :         PyObject *py_type;
    3337           0 :         py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
    3338           0 :         return py_type;
    3339             : }
    3340             : 
    3341           0 : static int py_PAC_BUFFER_RAW_set_type(PyObject *py_obj, PyObject *value, void *closure)
    3342             : {
    3343           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(py_obj);
    3344           0 :         if (value == NULL) {
    3345           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
    3346           0 :                 return -1;
    3347             :         }
    3348             :         {
    3349           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
    3350           0 :                 if (PyLong_Check(value)) {
    3351             :                         unsigned long long test_var;
    3352           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3353           0 :                         if (PyErr_Occurred() != NULL) {
    3354           0 :                                 return -1;
    3355             :                         }
    3356           0 :                         if (test_var > uint_max) {
    3357           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3358             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3359           0 :                                 return -1;
    3360             :                         }
    3361           0 :                         object->type = test_var;
    3362             :                 } else {
    3363           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3364             :                           PyLong_Type.tp_name);
    3365           0 :                         return -1;
    3366             :                 }
    3367             :         }
    3368           0 :         return 0;
    3369             : }
    3370             : 
    3371           0 : static PyObject *py_PAC_BUFFER_RAW_get_ndr_size(PyObject *obj, void *closure)
    3372             : {
    3373           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(obj);
    3374             :         PyObject *py_ndr_size;
    3375           0 :         py_ndr_size = PyLong_FromUnsignedLongLong((uint32_t)object->ndr_size);
    3376           0 :         return py_ndr_size;
    3377             : }
    3378             : 
    3379           0 : static int py_PAC_BUFFER_RAW_set_ndr_size(PyObject *py_obj, PyObject *value, void *closure)
    3380             : {
    3381           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(py_obj);
    3382           0 :         if (value == NULL) {
    3383           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ndr_size");
    3384           0 :                 return -1;
    3385             :         }
    3386             :         {
    3387           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ndr_size));
    3388           0 :                 if (PyLong_Check(value)) {
    3389             :                         unsigned long long test_var;
    3390           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3391           0 :                         if (PyErr_Occurred() != NULL) {
    3392           0 :                                 return -1;
    3393             :                         }
    3394           0 :                         if (test_var > uint_max) {
    3395           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3396             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3397           0 :                                 return -1;
    3398             :                         }
    3399           0 :                         object->ndr_size = test_var;
    3400             :                 } else {
    3401           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3402             :                           PyLong_Type.tp_name);
    3403           0 :                         return -1;
    3404             :                 }
    3405             :         }
    3406           0 :         return 0;
    3407             : }
    3408             : 
    3409           0 : static PyObject *py_PAC_BUFFER_RAW_get_info(PyObject *obj, void *closure)
    3410             : {
    3411           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(obj);
    3412             :         PyObject *py_info;
    3413           0 :         if (object->info == NULL) {
    3414           0 :                 Py_RETURN_NONE;
    3415             :         }
    3416           0 :         if (object->info == NULL) {
    3417           0 :                 py_info = Py_None;
    3418           0 :                 Py_INCREF(py_info);
    3419             :         } else {
    3420           0 :                 py_info = pytalloc_reference_ex(&DATA_BLOB_REM_Type, object->info, object->info);
    3421             :         }
    3422           0 :         return py_info;
    3423             : }
    3424             : 
    3425           0 : static int py_PAC_BUFFER_RAW_set_info(PyObject *py_obj, PyObject *value, void *closure)
    3426             : {
    3427           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(py_obj);
    3428           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->info));
    3429           0 :         if (value == NULL) {
    3430           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info");
    3431           0 :                 return -1;
    3432             :         }
    3433           0 :         if (value == Py_None) {
    3434           0 :                 object->info = NULL;
    3435             :         } else {
    3436           0 :                 object->info = NULL;
    3437           0 :                 PY_CHECK_TYPE(&DATA_BLOB_REM_Type, value, return -1;);
    3438           0 :                 if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    3439           0 :                         PyErr_NoMemory();
    3440           0 :                         return -1;
    3441             :                 }
    3442           0 :                 object->info = (struct DATA_BLOB_REM *)pytalloc_get_ptr(value);
    3443             :         }
    3444           0 :         return 0;
    3445             : }
    3446             : 
    3447           0 : static PyObject *py_PAC_BUFFER_RAW_get__pad(PyObject *obj, void *closure)
    3448             : {
    3449           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(obj);
    3450             :         PyObject *py__pad;
    3451           0 :         py__pad = PyLong_FromUnsignedLongLong((uint32_t)object->_pad);
    3452           0 :         return py__pad;
    3453             : }
    3454             : 
    3455           0 : static int py_PAC_BUFFER_RAW_set__pad(PyObject *py_obj, PyObject *value, void *closure)
    3456             : {
    3457           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(py_obj);
    3458           0 :         if (value == NULL) {
    3459           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->_pad");
    3460           0 :                 return -1;
    3461             :         }
    3462             :         {
    3463           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_pad));
    3464           0 :                 if (PyLong_Check(value)) {
    3465             :                         unsigned long long test_var;
    3466           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3467           0 :                         if (PyErr_Occurred() != NULL) {
    3468           0 :                                 return -1;
    3469             :                         }
    3470           0 :                         if (test_var > uint_max) {
    3471           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3472             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3473           0 :                                 return -1;
    3474             :                         }
    3475           0 :                         object->_pad = test_var;
    3476             :                 } else {
    3477           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3478             :                           PyLong_Type.tp_name);
    3479           0 :                         return -1;
    3480             :                 }
    3481             :         }
    3482           0 :         return 0;
    3483             : }
    3484             : 
    3485             : static PyGetSetDef py_PAC_BUFFER_RAW_getsetters[] = {
    3486             :         {
    3487             :                 .name = discard_const_p(char, "type"),
    3488             :                 .get = py_PAC_BUFFER_RAW_get_type,
    3489             :                 .set = py_PAC_BUFFER_RAW_set_type,
    3490             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_TYPE")
    3491             :         },
    3492             :         {
    3493             :                 .name = discard_const_p(char, "ndr_size"),
    3494             :                 .get = py_PAC_BUFFER_RAW_get_ndr_size,
    3495             :                 .set = py_PAC_BUFFER_RAW_set_ndr_size,
    3496             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3497             :         },
    3498             :         {
    3499             :                 .name = discard_const_p(char, "info"),
    3500             :                 .get = py_PAC_BUFFER_RAW_get_info,
    3501             :                 .set = py_PAC_BUFFER_RAW_set_info,
    3502             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB_REM")
    3503             :         },
    3504             :         {
    3505             :                 .name = discard_const_p(char, "_pad"),
    3506             :                 .get = py_PAC_BUFFER_RAW_get__pad,
    3507             :                 .set = py_PAC_BUFFER_RAW_set__pad,
    3508             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3509             :         },
    3510             :         { .name = NULL }
    3511             : };
    3512             : 
    3513           0 : static PyObject *py_PAC_BUFFER_RAW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3514             : {
    3515           0 :         return pytalloc_new(struct PAC_BUFFER_RAW, type);
    3516             : }
    3517             : 
    3518           0 : static PyObject *py_PAC_BUFFER_RAW_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    3519             : {
    3520           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(py_obj);
    3521           0 :         PyObject *ret = NULL;
    3522             :         DATA_BLOB blob;
    3523             :         enum ndr_err_code err;
    3524           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    3525           0 :         if (tmp_ctx == NULL) {
    3526           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3527           0 :                 return NULL;
    3528             :         }
    3529           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_BUFFER_RAW);
    3530           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3531           0 :                 TALLOC_FREE(tmp_ctx);
    3532           0 :                 PyErr_SetNdrError(err);
    3533           0 :                 return NULL;
    3534             :         }
    3535             : 
    3536           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    3537           0 :         TALLOC_FREE(tmp_ctx);
    3538           0 :         return ret;
    3539             : }
    3540             : 
    3541           0 : static PyObject *py_PAC_BUFFER_RAW_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3542             : {
    3543           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(py_obj);
    3544           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    3545           0 :         Py_ssize_t blob_length = 0;
    3546             :         enum ndr_err_code err;
    3547           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    3548           0 :         PyObject *allow_remaining_obj = NULL;
    3549           0 :         bool allow_remaining = false;
    3550             : 
    3551           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    3552             :                 discard_const_p(char *, kwnames),
    3553             :                 &blob.data, &blob_length,
    3554             :                 &allow_remaining_obj)) {
    3555           0 :                 return NULL;
    3556             :         }
    3557           0 :         blob.length = blob_length;
    3558             : 
    3559           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3560           0 :                 allow_remaining = true;
    3561             :         }
    3562             : 
    3563           0 :         if (allow_remaining) {
    3564           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_BUFFER_RAW);
    3565             :         } else {
    3566           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_BUFFER_RAW);
    3567             :         }
    3568           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3569           0 :                 PyErr_SetNdrError(err);
    3570           0 :                 return NULL;
    3571             :         }
    3572             : 
    3573           0 :         Py_RETURN_NONE;
    3574             : }
    3575             : 
    3576           0 : static PyObject *py_PAC_BUFFER_RAW_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3577             : {
    3578           0 :         struct PAC_BUFFER_RAW *object = (struct PAC_BUFFER_RAW *)pytalloc_get_ptr(py_obj);
    3579             :         PyObject *ret;
    3580             :         char *retstr;
    3581             : 
    3582           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_BUFFER_RAW, "PAC_BUFFER_RAW", object);
    3583           0 :         ret = PyUnicode_FromString(retstr);
    3584           0 :         talloc_free(retstr);
    3585             : 
    3586           0 :         return ret;
    3587             : }
    3588             : 
    3589             : static PyMethodDef py_PAC_BUFFER_RAW_methods[] = {
    3590             :         { "__ndr_pack__", (PyCFunction)py_PAC_BUFFER_RAW_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    3591             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_BUFFER_RAW_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    3592             :         { "__ndr_print__", (PyCFunction)py_PAC_BUFFER_RAW_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    3593             :         { NULL, NULL, 0, NULL }
    3594             : };
    3595             : 
    3596             : 
    3597             : static PyTypeObject PAC_BUFFER_RAW_Type = {
    3598             :         PyVarObject_HEAD_INIT(NULL, 0)
    3599             :         .tp_name = "krb5pac.PAC_BUFFER_RAW",
    3600             :         .tp_getset = py_PAC_BUFFER_RAW_getsetters,
    3601             :         .tp_methods = py_PAC_BUFFER_RAW_methods,
    3602             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3603             :         .tp_new = py_PAC_BUFFER_RAW_new,
    3604             : };
    3605             : 
    3606             : 
    3607           0 : static PyObject *py_PAC_DATA_RAW_get_num_buffers(PyObject *obj, void *closure)
    3608             : {
    3609           0 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(obj);
    3610             :         PyObject *py_num_buffers;
    3611           0 :         py_num_buffers = PyLong_FromUnsignedLongLong((uint32_t)object->num_buffers);
    3612           0 :         return py_num_buffers;
    3613             : }
    3614             : 
    3615           0 : static int py_PAC_DATA_RAW_set_num_buffers(PyObject *py_obj, PyObject *value, void *closure)
    3616             : {
    3617           0 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(py_obj);
    3618           0 :         if (value == NULL) {
    3619           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_buffers");
    3620           0 :                 return -1;
    3621             :         }
    3622             :         {
    3623           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_buffers));
    3624           0 :                 if (PyLong_Check(value)) {
    3625             :                         unsigned long long test_var;
    3626           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3627           0 :                         if (PyErr_Occurred() != NULL) {
    3628           0 :                                 return -1;
    3629             :                         }
    3630           0 :                         if (test_var > uint_max) {
    3631           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3632             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3633           0 :                                 return -1;
    3634             :                         }
    3635           0 :                         object->num_buffers = test_var;
    3636             :                 } else {
    3637           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3638             :                           PyLong_Type.tp_name);
    3639           0 :                         return -1;
    3640             :                 }
    3641             :         }
    3642           0 :         return 0;
    3643             : }
    3644             : 
    3645           0 : static PyObject *py_PAC_DATA_RAW_get_version(PyObject *obj, void *closure)
    3646             : {
    3647           0 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(obj);
    3648             :         PyObject *py_version;
    3649           0 :         py_version = PyLong_FromUnsignedLongLong((uint32_t)object->version);
    3650           0 :         return py_version;
    3651             : }
    3652             : 
    3653           0 : static int py_PAC_DATA_RAW_set_version(PyObject *py_obj, PyObject *value, void *closure)
    3654             : {
    3655           0 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(py_obj);
    3656           0 :         if (value == NULL) {
    3657           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->version");
    3658           0 :                 return -1;
    3659             :         }
    3660             :         {
    3661           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
    3662           0 :                 if (PyLong_Check(value)) {
    3663             :                         unsigned long long test_var;
    3664           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3665           0 :                         if (PyErr_Occurred() != NULL) {
    3666           0 :                                 return -1;
    3667             :                         }
    3668           0 :                         if (test_var > uint_max) {
    3669           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3670             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3671           0 :                                 return -1;
    3672             :                         }
    3673           0 :                         object->version = test_var;
    3674             :                 } else {
    3675           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3676             :                           PyLong_Type.tp_name);
    3677           0 :                         return -1;
    3678             :                 }
    3679             :         }
    3680           0 :         return 0;
    3681             : }
    3682             : 
    3683           0 : static PyObject *py_PAC_DATA_RAW_get_buffers(PyObject *obj, void *closure)
    3684             : {
    3685           0 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(obj);
    3686             :         PyObject *py_buffers;
    3687           0 :         py_buffers = PyList_New(object->num_buffers);
    3688           0 :         if (py_buffers == NULL) {
    3689           0 :                 return NULL;
    3690             :         }
    3691             :         {
    3692             :                 int buffers_cntr_0;
    3693           0 :                 for (buffers_cntr_0 = 0; buffers_cntr_0 < (object->num_buffers); buffers_cntr_0++) {
    3694             :                         PyObject *py_buffers_0;
    3695           0 :                         py_buffers_0 = pytalloc_reference_ex(&PAC_BUFFER_RAW_Type, object->buffers, &object->buffers[buffers_cntr_0]);
    3696           0 :                         PyList_SetItem(py_buffers, buffers_cntr_0, py_buffers_0);
    3697             :                 }
    3698             :         }
    3699           0 :         return py_buffers;
    3700             : }
    3701             : 
    3702           0 : static int py_PAC_DATA_RAW_set_buffers(PyObject *py_obj, PyObject *value, void *closure)
    3703             : {
    3704           0 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(py_obj);
    3705           0 :         if (value == NULL) {
    3706           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buffers");
    3707           0 :                 return -1;
    3708             :         }
    3709           0 :         PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    3710             :         {
    3711             :                 int buffers_cntr_0;
    3712           0 :                 object->buffers = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->buffers, PyList_GET_SIZE(value));
    3713           0 :                 if (!object->buffers) { return -1;; }
    3714           0 :                 talloc_set_name_const(object->buffers, "ARRAY: object->buffers");
    3715           0 :                 for (buffers_cntr_0 = 0; buffers_cntr_0 < PyList_GET_SIZE(value); buffers_cntr_0++) {
    3716           0 :                         if (PyList_GET_ITEM(value, buffers_cntr_0) == NULL) {
    3717           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->buffers[buffers_cntr_0]");
    3718           0 :                                 return -1;
    3719             :                         }
    3720           0 :                         PY_CHECK_TYPE(&PAC_BUFFER_RAW_Type, PyList_GET_ITEM(value, buffers_cntr_0), return -1;);
    3721           0 :                         if (talloc_reference(object->buffers, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, buffers_cntr_0))) == NULL) {
    3722           0 :                                 PyErr_NoMemory();
    3723           0 :                                 return -1;
    3724             :                         }
    3725           0 :                         object->buffers[buffers_cntr_0] = *(struct PAC_BUFFER_RAW *)pytalloc_get_ptr(PyList_GET_ITEM(value, buffers_cntr_0));
    3726             :                 }
    3727             :         }
    3728           0 :         return 0;
    3729             : }
    3730             : 
    3731             : static PyGetSetDef py_PAC_DATA_RAW_getsetters[] = {
    3732             :         {
    3733             :                 .name = discard_const_p(char, "num_buffers"),
    3734             :                 .get = py_PAC_DATA_RAW_get_num_buffers,
    3735             :                 .set = py_PAC_DATA_RAW_set_num_buffers,
    3736             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3737             :         },
    3738             :         {
    3739             :                 .name = discard_const_p(char, "version"),
    3740             :                 .get = py_PAC_DATA_RAW_get_version,
    3741             :                 .set = py_PAC_DATA_RAW_set_version,
    3742             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3743             :         },
    3744             :         {
    3745             :                 .name = discard_const_p(char, "buffers"),
    3746             :                 .get = py_PAC_DATA_RAW_get_buffers,
    3747             :                 .set = py_PAC_DATA_RAW_set_buffers,
    3748             :                 .doc = discard_const_p(char, "PIDL-generated element of base type PAC_BUFFER_RAW")
    3749             :         },
    3750             :         { .name = NULL }
    3751             : };
    3752             : 
    3753           0 : static PyObject *py_PAC_DATA_RAW_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3754             : {
    3755           0 :         return pytalloc_new(struct PAC_DATA_RAW, type);
    3756             : }
    3757             : 
    3758           0 : static PyObject *py_PAC_DATA_RAW_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    3759             : {
    3760           0 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(py_obj);
    3761           0 :         PyObject *ret = NULL;
    3762             :         DATA_BLOB blob;
    3763             :         enum ndr_err_code err;
    3764           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    3765           0 :         if (tmp_ctx == NULL) {
    3766           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    3767           0 :                 return NULL;
    3768             :         }
    3769           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_DATA_RAW);
    3770           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3771           0 :                 TALLOC_FREE(tmp_ctx);
    3772           0 :                 PyErr_SetNdrError(err);
    3773           0 :                 return NULL;
    3774             :         }
    3775             : 
    3776           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    3777           0 :         TALLOC_FREE(tmp_ctx);
    3778           0 :         return ret;
    3779             : }
    3780             : 
    3781           0 : static PyObject *py_PAC_DATA_RAW_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    3782             : {
    3783           0 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(py_obj);
    3784           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    3785           0 :         Py_ssize_t blob_length = 0;
    3786             :         enum ndr_err_code err;
    3787           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    3788           0 :         PyObject *allow_remaining_obj = NULL;
    3789           0 :         bool allow_remaining = false;
    3790             : 
    3791           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    3792             :                 discard_const_p(char *, kwnames),
    3793             :                 &blob.data, &blob_length,
    3794             :                 &allow_remaining_obj)) {
    3795           0 :                 return NULL;
    3796             :         }
    3797           0 :         blob.length = blob_length;
    3798             : 
    3799           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    3800           0 :                 allow_remaining = true;
    3801             :         }
    3802             : 
    3803           0 :         if (allow_remaining) {
    3804           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_DATA_RAW);
    3805             :         } else {
    3806           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_DATA_RAW);
    3807             :         }
    3808           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    3809           0 :                 PyErr_SetNdrError(err);
    3810           0 :                 return NULL;
    3811             :         }
    3812             : 
    3813           0 :         Py_RETURN_NONE;
    3814             : }
    3815             : 
    3816           0 : static PyObject *py_PAC_DATA_RAW_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    3817             : {
    3818           0 :         struct PAC_DATA_RAW *object = (struct PAC_DATA_RAW *)pytalloc_get_ptr(py_obj);
    3819             :         PyObject *ret;
    3820             :         char *retstr;
    3821             : 
    3822           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_DATA_RAW, "PAC_DATA_RAW", object);
    3823           0 :         ret = PyUnicode_FromString(retstr);
    3824           0 :         talloc_free(retstr);
    3825             : 
    3826           0 :         return ret;
    3827             : }
    3828             : 
    3829             : static PyMethodDef py_PAC_DATA_RAW_methods[] = {
    3830             :         { "__ndr_pack__", (PyCFunction)py_PAC_DATA_RAW_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    3831             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_DATA_RAW_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    3832             :         { "__ndr_print__", (PyCFunction)py_PAC_DATA_RAW_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    3833             :         { NULL, NULL, 0, NULL }
    3834             : };
    3835             : 
    3836             : 
    3837             : static PyTypeObject PAC_DATA_RAW_Type = {
    3838             :         PyVarObject_HEAD_INIT(NULL, 0)
    3839             :         .tp_name = "krb5pac.PAC_DATA_RAW",
    3840             :         .tp_getset = py_PAC_DATA_RAW_getsetters,
    3841             :         .tp_methods = py_PAC_DATA_RAW_methods,
    3842             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3843             :         .tp_new = py_PAC_DATA_RAW_new,
    3844             : };
    3845             : 
    3846             : 
    3847           0 : static PyObject *py_PAC_Validate_get_MessageType(PyObject *obj, void *closure)
    3848             : {
    3849           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(obj);
    3850             :         PyObject *py_MessageType;
    3851           0 :         py_MessageType = PyLong_FromUnsignedLongLong((uint32_t)object->MessageType);
    3852           0 :         return py_MessageType;
    3853             : }
    3854             : 
    3855           0 : static int py_PAC_Validate_set_MessageType(PyObject *py_obj, PyObject *value, void *closure)
    3856             : {
    3857           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(py_obj);
    3858           0 :         if (value == NULL) {
    3859           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->MessageType");
    3860           0 :                 return -1;
    3861             :         }
    3862             :         {
    3863           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->MessageType));
    3864           0 :                 if (PyLong_Check(value)) {
    3865             :                         unsigned long long test_var;
    3866           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3867           0 :                         if (PyErr_Occurred() != NULL) {
    3868           0 :                                 return -1;
    3869             :                         }
    3870           0 :                         if (test_var > uint_max) {
    3871           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3872             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3873           0 :                                 return -1;
    3874             :                         }
    3875           0 :                         object->MessageType = test_var;
    3876             :                 } else {
    3877           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3878             :                           PyLong_Type.tp_name);
    3879           0 :                         return -1;
    3880             :                 }
    3881             :         }
    3882           0 :         return 0;
    3883             : }
    3884             : 
    3885           0 : static PyObject *py_PAC_Validate_get_ChecksumLength(PyObject *obj, void *closure)
    3886             : {
    3887           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(obj);
    3888             :         PyObject *py_ChecksumLength;
    3889           0 :         py_ChecksumLength = PyLong_FromUnsignedLongLong((uint32_t)object->ChecksumLength);
    3890           0 :         return py_ChecksumLength;
    3891             : }
    3892             : 
    3893           0 : static int py_PAC_Validate_set_ChecksumLength(PyObject *py_obj, PyObject *value, void *closure)
    3894             : {
    3895           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(py_obj);
    3896           0 :         if (value == NULL) {
    3897           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ChecksumLength");
    3898           0 :                 return -1;
    3899             :         }
    3900             :         {
    3901           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ChecksumLength));
    3902           0 :                 if (PyLong_Check(value)) {
    3903             :                         unsigned long long test_var;
    3904           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3905           0 :                         if (PyErr_Occurred() != NULL) {
    3906           0 :                                 return -1;
    3907             :                         }
    3908           0 :                         if (test_var > uint_max) {
    3909           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3910             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3911           0 :                                 return -1;
    3912             :                         }
    3913           0 :                         object->ChecksumLength = test_var;
    3914             :                 } else {
    3915           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3916             :                           PyLong_Type.tp_name);
    3917           0 :                         return -1;
    3918             :                 }
    3919             :         }
    3920           0 :         return 0;
    3921             : }
    3922             : 
    3923           0 : static PyObject *py_PAC_Validate_get_SignatureType(PyObject *obj, void *closure)
    3924             : {
    3925           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(obj);
    3926             :         PyObject *py_SignatureType;
    3927           0 :         py_SignatureType = PyLong_FromLong(object->SignatureType);
    3928           0 :         return py_SignatureType;
    3929             : }
    3930             : 
    3931           0 : static int py_PAC_Validate_set_SignatureType(PyObject *py_obj, PyObject *value, void *closure)
    3932             : {
    3933           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(py_obj);
    3934           0 :         if (value == NULL) {
    3935           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SignatureType");
    3936           0 :                 return -1;
    3937             :         }
    3938             :         {
    3939           0 :                 const long long int_max = ndr_sizeof2intmax(sizeof(object->SignatureType));
    3940           0 :                 const long long int_min = -int_max - 1;
    3941           0 :                 if (PyLong_Check(value)) {
    3942             :                         long long test_var;
    3943           0 :                         test_var = PyLong_AsLongLong(value);
    3944           0 :                         if (PyErr_Occurred() != NULL) {
    3945           0 :                                 return -1;
    3946             :                         }
    3947           0 :                         if (test_var < int_min || test_var > int_max) {
    3948           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",\
    3949             :                                   PyLong_Type.tp_name, int_min, int_max, test_var);
    3950           0 :                                 return -1;
    3951             :                         }
    3952           0 :                         object->SignatureType = test_var;
    3953             :                 } else {
    3954           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3955             :                           PyLong_Type.tp_name);
    3956           0 :                         return -1;
    3957             :                 }
    3958             :         }
    3959           0 :         return 0;
    3960             : }
    3961             : 
    3962           0 : static PyObject *py_PAC_Validate_get_SignatureLength(PyObject *obj, void *closure)
    3963             : {
    3964           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(obj);
    3965             :         PyObject *py_SignatureLength;
    3966           0 :         py_SignatureLength = PyLong_FromUnsignedLongLong((uint32_t)object->SignatureLength);
    3967           0 :         return py_SignatureLength;
    3968             : }
    3969             : 
    3970           0 : static int py_PAC_Validate_set_SignatureLength(PyObject *py_obj, PyObject *value, void *closure)
    3971             : {
    3972           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(py_obj);
    3973           0 :         if (value == NULL) {
    3974           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->SignatureLength");
    3975           0 :                 return -1;
    3976             :         }
    3977             :         {
    3978           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->SignatureLength));
    3979           0 :                 if (PyLong_Check(value)) {
    3980             :                         unsigned long long test_var;
    3981           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3982           0 :                         if (PyErr_Occurred() != NULL) {
    3983           0 :                                 return -1;
    3984             :                         }
    3985           0 :                         if (test_var > uint_max) {
    3986           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3987             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3988           0 :                                 return -1;
    3989             :                         }
    3990           0 :                         object->SignatureLength = test_var;
    3991             :                 } else {
    3992           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3993             :                           PyLong_Type.tp_name);
    3994           0 :                         return -1;
    3995             :                 }
    3996             :         }
    3997           0 :         return 0;
    3998             : }
    3999             : 
    4000           0 : static PyObject *py_PAC_Validate_get_ChecksumAndSignature(PyObject *obj, void *closure)
    4001             : {
    4002           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(obj);
    4003             :         PyObject *py_ChecksumAndSignature;
    4004           0 :         py_ChecksumAndSignature = PyBytes_FromStringAndSize((char *)(object->ChecksumAndSignature).data, (object->ChecksumAndSignature).length);
    4005           0 :         return py_ChecksumAndSignature;
    4006             : }
    4007             : 
    4008           0 : static int py_PAC_Validate_set_ChecksumAndSignature(PyObject *py_obj, PyObject *value, void *closure)
    4009             : {
    4010           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(py_obj);
    4011           0 :         if (value == NULL) {
    4012           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ChecksumAndSignature");
    4013           0 :                 return -1;
    4014             :         }
    4015           0 :         object->ChecksumAndSignature = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
    4016           0 :         return 0;
    4017             : }
    4018             : 
    4019             : static PyGetSetDef py_PAC_Validate_getsetters[] = {
    4020             :         {
    4021             :                 .name = discard_const_p(char, "MessageType"),
    4022             :                 .get = py_PAC_Validate_get_MessageType,
    4023             :                 .set = py_PAC_Validate_set_MessageType,
    4024             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4025             :         },
    4026             :         {
    4027             :                 .name = discard_const_p(char, "ChecksumLength"),
    4028             :                 .get = py_PAC_Validate_get_ChecksumLength,
    4029             :                 .set = py_PAC_Validate_set_ChecksumLength,
    4030             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4031             :         },
    4032             :         {
    4033             :                 .name = discard_const_p(char, "SignatureType"),
    4034             :                 .get = py_PAC_Validate_get_SignatureType,
    4035             :                 .set = py_PAC_Validate_set_SignatureType,
    4036             :                 .doc = discard_const_p(char, "PIDL-generated element of base type int32")
    4037             :         },
    4038             :         {
    4039             :                 .name = discard_const_p(char, "SignatureLength"),
    4040             :                 .get = py_PAC_Validate_get_SignatureLength,
    4041             :                 .set = py_PAC_Validate_set_SignatureLength,
    4042             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4043             :         },
    4044             :         {
    4045             :                 .name = discard_const_p(char, "ChecksumAndSignature"),
    4046             :                 .get = py_PAC_Validate_get_ChecksumAndSignature,
    4047             :                 .set = py_PAC_Validate_set_ChecksumAndSignature,
    4048             :                 .doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
    4049             :         },
    4050             :         { .name = NULL }
    4051             : };
    4052             : 
    4053           0 : static PyObject *py_PAC_Validate_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4054             : {
    4055           0 :         return pytalloc_new(struct PAC_Validate, type);
    4056             : }
    4057             : 
    4058           0 : static PyObject *py_PAC_Validate_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    4059             : {
    4060           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(py_obj);
    4061           0 :         PyObject *ret = NULL;
    4062             :         DATA_BLOB blob;
    4063             :         enum ndr_err_code err;
    4064           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    4065           0 :         if (tmp_ctx == NULL) {
    4066           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4067           0 :                 return NULL;
    4068             :         }
    4069           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_PAC_Validate);
    4070           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4071           0 :                 TALLOC_FREE(tmp_ctx);
    4072           0 :                 PyErr_SetNdrError(err);
    4073           0 :                 return NULL;
    4074             :         }
    4075             : 
    4076           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    4077           0 :         TALLOC_FREE(tmp_ctx);
    4078           0 :         return ret;
    4079             : }
    4080             : 
    4081           0 : static PyObject *py_PAC_Validate_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4082             : {
    4083           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(py_obj);
    4084           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    4085           0 :         Py_ssize_t blob_length = 0;
    4086             :         enum ndr_err_code err;
    4087           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    4088           0 :         PyObject *allow_remaining_obj = NULL;
    4089           0 :         bool allow_remaining = false;
    4090             : 
    4091           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    4092             :                 discard_const_p(char *, kwnames),
    4093             :                 &blob.data, &blob_length,
    4094             :                 &allow_remaining_obj)) {
    4095           0 :                 return NULL;
    4096             :         }
    4097           0 :         blob.length = blob_length;
    4098             : 
    4099           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4100           0 :                 allow_remaining = true;
    4101             :         }
    4102             : 
    4103           0 :         if (allow_remaining) {
    4104           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_Validate);
    4105             :         } else {
    4106           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_PAC_Validate);
    4107             :         }
    4108           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4109           0 :                 PyErr_SetNdrError(err);
    4110           0 :                 return NULL;
    4111             :         }
    4112             : 
    4113           0 :         Py_RETURN_NONE;
    4114             : }
    4115             : 
    4116           0 : static PyObject *py_PAC_Validate_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4117             : {
    4118           0 :         struct PAC_Validate *object = (struct PAC_Validate *)pytalloc_get_ptr(py_obj);
    4119             :         PyObject *ret;
    4120             :         char *retstr;
    4121             : 
    4122           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_PAC_Validate, "PAC_Validate", object);
    4123           0 :         ret = PyUnicode_FromString(retstr);
    4124           0 :         talloc_free(retstr);
    4125             : 
    4126           0 :         return ret;
    4127             : }
    4128             : 
    4129             : static PyMethodDef py_PAC_Validate_methods[] = {
    4130             :         { "__ndr_pack__", (PyCFunction)py_PAC_Validate_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    4131             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_PAC_Validate_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    4132             :         { "__ndr_print__", (PyCFunction)py_PAC_Validate_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    4133             :         { NULL, NULL, 0, NULL }
    4134             : };
    4135             : 
    4136             : 
    4137             : static PyTypeObject PAC_Validate_Type = {
    4138             :         PyVarObject_HEAD_INIT(NULL, 0)
    4139             :         .tp_name = "krb5pac.PAC_Validate",
    4140             :         .tp_getset = py_PAC_Validate_getsetters,
    4141             :         .tp_methods = py_PAC_Validate_methods,
    4142             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4143             :         .tp_new = py_PAC_Validate_new,
    4144             : };
    4145             : 
    4146             : 
    4147           0 : static PyObject *py_netsamlogoncache_entry_get_timestamp(PyObject *obj, void *closure)
    4148             : {
    4149           0 :         struct netsamlogoncache_entry *object = (struct netsamlogoncache_entry *)pytalloc_get_ptr(obj);
    4150             :         PyObject *py_timestamp;
    4151           0 :         py_timestamp = PyLong_FromLong(object->timestamp);
    4152           0 :         return py_timestamp;
    4153             : }
    4154             : 
    4155           0 : static int py_netsamlogoncache_entry_set_timestamp(PyObject *py_obj, PyObject *value, void *closure)
    4156             : {
    4157           0 :         struct netsamlogoncache_entry *object = (struct netsamlogoncache_entry *)pytalloc_get_ptr(py_obj);
    4158           0 :         if (value == NULL) {
    4159           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->timestamp");
    4160           0 :                 return -1;
    4161             :         }
    4162             :         {
    4163           0 :                 const long long int_max = ndr_sizeof2intmax(sizeof(object->timestamp));
    4164           0 :                 const long long int_min = -int_max - 1;
    4165           0 :                 if (PyLong_Check(value)) {
    4166             :                         long long test_var;
    4167           0 :                         test_var = PyLong_AsLongLong(value);
    4168           0 :                         if (PyErr_Occurred() != NULL) {
    4169           0 :                                 return -1;
    4170             :                         }
    4171           0 :                         if (test_var < int_min || test_var > int_max) {
    4172           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",\
    4173             :                                   PyLong_Type.tp_name, int_min, int_max, test_var);
    4174           0 :                                 return -1;
    4175             :                         }
    4176           0 :                         object->timestamp = test_var;
    4177             :                 } else {
    4178           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4179             :                           PyLong_Type.tp_name);
    4180           0 :                         return -1;
    4181             :                 }
    4182             :         }
    4183           0 :         return 0;
    4184             : }
    4185             : 
    4186           0 : static PyObject *py_netsamlogoncache_entry_get_info3(PyObject *obj, void *closure)
    4187             : {
    4188           0 :         struct netsamlogoncache_entry *object = (struct netsamlogoncache_entry *)pytalloc_get_ptr(obj);
    4189             :         PyObject *py_info3;
    4190           0 :         py_info3 = pytalloc_reference_ex(netr_SamInfo3_Type, pytalloc_get_mem_ctx(obj), &object->info3);
    4191           0 :         return py_info3;
    4192             : }
    4193             : 
    4194           0 : static int py_netsamlogoncache_entry_set_info3(PyObject *py_obj, PyObject *value, void *closure)
    4195             : {
    4196           0 :         struct netsamlogoncache_entry *object = (struct netsamlogoncache_entry *)pytalloc_get_ptr(py_obj);
    4197           0 :         if (value == NULL) {
    4198           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->info3");
    4199           0 :                 return -1;
    4200             :         }
    4201           0 :         PY_CHECK_TYPE(netr_SamInfo3_Type, value, return -1;);
    4202           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    4203           0 :                 PyErr_NoMemory();
    4204           0 :                 return -1;
    4205             :         }
    4206           0 :         object->info3 = *(struct netr_SamInfo3 *)pytalloc_get_ptr(value);
    4207           0 :         return 0;
    4208             : }
    4209             : 
    4210             : static PyGetSetDef py_netsamlogoncache_entry_getsetters[] = {
    4211             :         {
    4212             :                 .name = discard_const_p(char, "timestamp"),
    4213             :                 .get = py_netsamlogoncache_entry_get_timestamp,
    4214             :                 .set = py_netsamlogoncache_entry_set_timestamp,
    4215             :                 .doc = discard_const_p(char, "PIDL-generated element of base type time_t")
    4216             :         },
    4217             :         {
    4218             :                 .name = discard_const_p(char, "info3"),
    4219             :                 .get = py_netsamlogoncache_entry_get_info3,
    4220             :                 .set = py_netsamlogoncache_entry_set_info3,
    4221             :                 .doc = discard_const_p(char, "PIDL-generated element of base type netr_SamInfo3")
    4222             :         },
    4223             :         { .name = NULL }
    4224             : };
    4225             : 
    4226           0 : static PyObject *py_netsamlogoncache_entry_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4227             : {
    4228           0 :         return pytalloc_new(struct netsamlogoncache_entry, type);
    4229             : }
    4230             : 
    4231           0 : static PyObject *py_netsamlogoncache_entry_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
    4232             : {
    4233           0 :         struct netsamlogoncache_entry *object = (struct netsamlogoncache_entry *)pytalloc_get_ptr(py_obj);
    4234           0 :         PyObject *ret = NULL;
    4235             :         DATA_BLOB blob;
    4236             :         enum ndr_err_code err;
    4237           0 :         TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
    4238           0 :         if (tmp_ctx == NULL) {
    4239           0 :                 PyErr_SetNdrError(NDR_ERR_ALLOC);
    4240           0 :                 return NULL;
    4241             :         }
    4242           0 :         err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_netsamlogoncache_entry);
    4243           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4244           0 :                 TALLOC_FREE(tmp_ctx);
    4245           0 :                 PyErr_SetNdrError(err);
    4246           0 :                 return NULL;
    4247             :         }
    4248             : 
    4249           0 :         ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
    4250           0 :         TALLOC_FREE(tmp_ctx);
    4251           0 :         return ret;
    4252             : }
    4253             : 
    4254           0 : static PyObject *py_netsamlogoncache_entry_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
    4255             : {
    4256           0 :         struct netsamlogoncache_entry *object = (struct netsamlogoncache_entry *)pytalloc_get_ptr(py_obj);
    4257           0 :         DATA_BLOB blob = {.data = NULL, .length = 0};
    4258           0 :         Py_ssize_t blob_length = 0;
    4259             :         enum ndr_err_code err;
    4260           0 :         const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
    4261           0 :         PyObject *allow_remaining_obj = NULL;
    4262           0 :         bool allow_remaining = false;
    4263             : 
    4264           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
    4265             :                 discard_const_p(char *, kwnames),
    4266             :                 &blob.data, &blob_length,
    4267             :                 &allow_remaining_obj)) {
    4268           0 :                 return NULL;
    4269             :         }
    4270           0 :         blob.length = blob_length;
    4271             : 
    4272           0 :         if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
    4273           0 :                 allow_remaining = true;
    4274             :         }
    4275             : 
    4276           0 :         if (allow_remaining) {
    4277           0 :                 err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netsamlogoncache_entry);
    4278             :         } else {
    4279           0 :                 err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_netsamlogoncache_entry);
    4280             :         }
    4281           0 :         if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
    4282           0 :                 PyErr_SetNdrError(err);
    4283           0 :                 return NULL;
    4284             :         }
    4285             : 
    4286           0 :         Py_RETURN_NONE;
    4287             : }
    4288             : 
    4289           0 : static PyObject *py_netsamlogoncache_entry_ndr_print(PyObject *py_obj, PyObject *Py_UNUSED(ignored))
    4290             : {
    4291           0 :         struct netsamlogoncache_entry *object = (struct netsamlogoncache_entry *)pytalloc_get_ptr(py_obj);
    4292             :         PyObject *ret;
    4293             :         char *retstr;
    4294             : 
    4295           0 :         retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_netsamlogoncache_entry, "netsamlogoncache_entry", object);
    4296           0 :         ret = PyUnicode_FromString(retstr);
    4297           0 :         talloc_free(retstr);
    4298             : 
    4299           0 :         return ret;
    4300             : }
    4301             : 
    4302             : static PyMethodDef py_netsamlogoncache_entry_methods[] = {
    4303             :         { "__ndr_pack__", (PyCFunction)py_netsamlogoncache_entry_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
    4304             :         { "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_netsamlogoncache_entry_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
    4305             :         { "__ndr_print__", (PyCFunction)py_netsamlogoncache_entry_ndr_print, METH_NOARGS, "S.ndr_print(object) -> None\nNDR print" },
    4306             :         { NULL, NULL, 0, NULL }
    4307             : };
    4308             : 
    4309             : 
    4310             : static PyTypeObject netsamlogoncache_entry_Type = {
    4311             :         PyVarObject_HEAD_INIT(NULL, 0)
    4312             :         .tp_name = "krb5pac.netsamlogoncache_entry",
    4313             :         .tp_getset = py_netsamlogoncache_entry_getsetters,
    4314             :         .tp_methods = py_netsamlogoncache_entry_methods,
    4315             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4316             :         .tp_new = py_netsamlogoncache_entry_new,
    4317             : };
    4318             : 
    4319             : 
    4320             : const struct PyNdrRpcMethodDef py_ndr_krb5pac_methods[] = {
    4321             :         {0}
    4322             : };
    4323             : 
    4324           0 : static PyObject *interface_krb5pac_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4325             : {
    4326           0 :         return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_krb5pac);
    4327             : }
    4328             : 
    4329             : #define PY_DOC_KRB5PAC "Active Directory KRB5 PAC"
    4330             : static PyTypeObject krb5pac_InterfaceType = {
    4331             :         PyVarObject_HEAD_INIT(NULL, 0)
    4332             :         .tp_name = "krb5pac.krb5pac",
    4333             :         .tp_basicsize = sizeof(dcerpc_InterfaceObject),
    4334             :         .tp_doc = "krb5pac(binding, lp_ctx=None, credentials=None) -> connection\n"
    4335             : "\n"
    4336             : "binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
    4337             : "lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
    4338             : "credentials should be a credentials.Credentials object.\n\n"PY_DOC_KRB5PAC,
    4339             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4340             :         .tp_new = interface_krb5pac_new,
    4341             : };
    4342             : 
    4343           0 : static PyObject *syntax_krb5pac_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4344             : {
    4345           0 :         return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_krb5pac.syntax_id);
    4346             : }
    4347             : 
    4348             : #define PY_DOC_KRB5PAC_SYNTAX "Active Directory KRB5 PAC"
    4349             : static PyTypeObject krb5pac_SyntaxType = {
    4350             :         PyVarObject_HEAD_INIT(NULL, 0)
    4351             :         .tp_name = "krb5pac.krb5pac_abstract_syntax",
    4352             :         .tp_doc = "krb5pac_abstract_syntax()\n"PY_DOC_KRB5PAC_SYNTAX,
    4353             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4354             :         .tp_new = syntax_krb5pac_new,
    4355             : };
    4356             : 
    4357             : static PyMethodDef krb5pac_methods[] = {
    4358             :         { NULL, NULL, 0, NULL }
    4359             : };
    4360             : 
    4361             : static struct PyModuleDef moduledef = {
    4362             :         PyModuleDef_HEAD_INIT,
    4363             :         .m_name = "krb5pac",
    4364             :         .m_doc = "krb5pac DCE/RPC",
    4365             :         .m_size = -1,
    4366             :         .m_methods = krb5pac_methods,
    4367             : };
    4368        3229 : MODULE_INIT_FUNC(krb5pac)
    4369             : {
    4370        3229 :         PyObject *m = NULL;
    4371        3229 :         PyObject *dep_samba_dcerpc_security = NULL;
    4372        3229 :         PyObject *dep_samba_dcerpc_lsa = NULL;
    4373        3229 :         PyObject *dep_samba_dcerpc_netlogon = NULL;
    4374        3229 :         PyObject *dep_samba_dcerpc_samr = NULL;
    4375        3229 :         PyObject *dep_talloc = NULL;
    4376        3229 :         PyObject *dep_samba_dcerpc_base = NULL;
    4377        3229 :         PyObject *dep_samba_dcerpc_misc = NULL;
    4378             : 
    4379        3229 :         dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
    4380        3229 :         if (dep_samba_dcerpc_security == NULL)
    4381           0 :                 goto out;
    4382             : 
    4383        3229 :         dep_samba_dcerpc_lsa = PyImport_ImportModule("samba.dcerpc.lsa");
    4384        3229 :         if (dep_samba_dcerpc_lsa == NULL)
    4385           0 :                 goto out;
    4386             : 
    4387        3229 :         dep_samba_dcerpc_netlogon = PyImport_ImportModule("samba.dcerpc.netlogon");
    4388        3229 :         if (dep_samba_dcerpc_netlogon == NULL)
    4389           0 :                 goto out;
    4390             : 
    4391        3229 :         dep_samba_dcerpc_samr = PyImport_ImportModule("samba.dcerpc.samr");
    4392        3229 :         if (dep_samba_dcerpc_samr == NULL)
    4393           0 :                 goto out;
    4394             : 
    4395        3229 :         dep_talloc = PyImport_ImportModule("talloc");
    4396        3229 :         if (dep_talloc == NULL)
    4397           0 :                 goto out;
    4398             : 
    4399        3229 :         dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
    4400        3229 :         if (dep_samba_dcerpc_base == NULL)
    4401           0 :                 goto out;
    4402             : 
    4403        3229 :         dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
    4404        3229 :         if (dep_samba_dcerpc_misc == NULL)
    4405           0 :                 goto out;
    4406             : 
    4407        3229 :         BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
    4408        3229 :         if (BaseObject_Type == NULL)
    4409           0 :                 goto out;
    4410             : 
    4411        3229 :         dom_sid_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "dom_sid");
    4412        3229 :         if (dom_sid_Type == NULL)
    4413           0 :                 goto out;
    4414             : 
    4415        3229 :         samr_RidWithAttributeArray_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_samr, "RidWithAttributeArray");
    4416        3229 :         if (samr_RidWithAttributeArray_Type == NULL)
    4417           0 :                 goto out;
    4418             : 
    4419        3229 :         netr_SamInfo3_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_netlogon, "netr_SamInfo3");
    4420        3229 :         if (netr_SamInfo3_Type == NULL)
    4421           0 :                 goto out;
    4422             : 
    4423        3229 :         samr_Password_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_samr, "Password");
    4424        3229 :         if (samr_Password_Type == NULL)
    4425           0 :                 goto out;
    4426             : 
    4427        3229 :         lsa_String_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_lsa, "String");
    4428        3229 :         if (lsa_String_Type == NULL)
    4429           0 :                 goto out;
    4430             : 
    4431        3229 :         ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
    4432        3229 :         if (ClientConnection_Type == NULL)
    4433           0 :                 goto out;
    4434             : 
    4435        3229 :         ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
    4436        3229 :         if (ndr_syntax_id_Type == NULL)
    4437           0 :                 goto out;
    4438             : 
    4439        3229 :         PAC_LOGON_NAME_Type.tp_base = BaseObject_Type;
    4440        3229 :         PAC_LOGON_NAME_Type.tp_basicsize = pytalloc_BaseObject_size();
    4441             : 
    4442        3229 :         PAC_SIGNATURE_DATA_Type.tp_base = BaseObject_Type;
    4443        3229 :         PAC_SIGNATURE_DATA_Type.tp_basicsize = pytalloc_BaseObject_size();
    4444             : 
    4445        3229 :         PAC_DOMAIN_GROUP_MEMBERSHIP_Type.tp_base = BaseObject_Type;
    4446        3229 :         PAC_DOMAIN_GROUP_MEMBERSHIP_Type.tp_basicsize = pytalloc_BaseObject_size();
    4447             : 
    4448        3229 :         PAC_LOGON_INFO_Type.tp_base = BaseObject_Type;
    4449        3229 :         PAC_LOGON_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
    4450             : 
    4451        3229 :         PAC_CREDENTIAL_NTLM_SECPKG_Type.tp_base = BaseObject_Type;
    4452        3229 :         PAC_CREDENTIAL_NTLM_SECPKG_Type.tp_basicsize = pytalloc_BaseObject_size();
    4453             : 
    4454        3229 :         PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type.tp_base = BaseObject_Type;
    4455        3229 :         PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type.tp_basicsize = pytalloc_BaseObject_size();
    4456             : 
    4457        3229 :         PAC_CREDENTIAL_DATA_Type.tp_base = BaseObject_Type;
    4458        3229 :         PAC_CREDENTIAL_DATA_Type.tp_basicsize = pytalloc_BaseObject_size();
    4459             : 
    4460        3229 :         PAC_CREDENTIAL_DATA_CTR_Type.tp_base = BaseObject_Type;
    4461        3229 :         PAC_CREDENTIAL_DATA_CTR_Type.tp_basicsize = pytalloc_BaseObject_size();
    4462             : 
    4463        3229 :         PAC_CREDENTIAL_DATA_NDR_Type.tp_base = BaseObject_Type;
    4464        3229 :         PAC_CREDENTIAL_DATA_NDR_Type.tp_basicsize = pytalloc_BaseObject_size();
    4465             : 
    4466        3229 :         PAC_CREDENTIAL_INFO_Type.tp_base = BaseObject_Type;
    4467        3229 :         PAC_CREDENTIAL_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
    4468             : 
    4469        3229 :         PAC_CONSTRAINED_DELEGATION_Type.tp_base = BaseObject_Type;
    4470        3229 :         PAC_CONSTRAINED_DELEGATION_Type.tp_basicsize = pytalloc_BaseObject_size();
    4471             : 
    4472        3229 :         PAC_UPN_DNS_INFO_Type.tp_base = BaseObject_Type;
    4473        3229 :         PAC_UPN_DNS_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
    4474             : 
    4475        3229 :         PAC_LOGON_INFO_CTR_Type.tp_base = BaseObject_Type;
    4476        3229 :         PAC_LOGON_INFO_CTR_Type.tp_basicsize = pytalloc_BaseObject_size();
    4477             : 
    4478        3229 :         PAC_CONSTRAINED_DELEGATION_CTR_Type.tp_base = BaseObject_Type;
    4479        3229 :         PAC_CONSTRAINED_DELEGATION_CTR_Type.tp_basicsize = pytalloc_BaseObject_size();
    4480             : 
    4481        3229 :         DATA_BLOB_REM_Type.tp_base = BaseObject_Type;
    4482        3229 :         DATA_BLOB_REM_Type.tp_basicsize = pytalloc_BaseObject_size();
    4483             : 
    4484        3229 :         PAC_INFO_Type.tp_base = BaseObject_Type;
    4485        3229 :         PAC_INFO_Type.tp_basicsize = pytalloc_BaseObject_size();
    4486             : 
    4487        3229 :         PAC_BUFFER_Type.tp_base = BaseObject_Type;
    4488        3229 :         PAC_BUFFER_Type.tp_basicsize = pytalloc_BaseObject_size();
    4489             : 
    4490        3229 :         PAC_DATA_Type.tp_base = BaseObject_Type;
    4491        3229 :         PAC_DATA_Type.tp_basicsize = pytalloc_BaseObject_size();
    4492             : 
    4493        3229 :         PAC_BUFFER_RAW_Type.tp_base = BaseObject_Type;
    4494        3229 :         PAC_BUFFER_RAW_Type.tp_basicsize = pytalloc_BaseObject_size();
    4495             : 
    4496        3229 :         PAC_DATA_RAW_Type.tp_base = BaseObject_Type;
    4497        3229 :         PAC_DATA_RAW_Type.tp_basicsize = pytalloc_BaseObject_size();
    4498             : 
    4499        3229 :         PAC_Validate_Type.tp_base = BaseObject_Type;
    4500        3229 :         PAC_Validate_Type.tp_basicsize = pytalloc_BaseObject_size();
    4501             : 
    4502        3229 :         netsamlogoncache_entry_Type.tp_base = BaseObject_Type;
    4503        3229 :         netsamlogoncache_entry_Type.tp_basicsize = pytalloc_BaseObject_size();
    4504             : 
    4505        3229 :         krb5pac_InterfaceType.tp_base = ClientConnection_Type;
    4506             : 
    4507        3229 :         krb5pac_SyntaxType.tp_base = ndr_syntax_id_Type;
    4508        3229 :         krb5pac_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();
    4509             : 
    4510        3229 :         if (PyType_Ready(&PAC_LOGON_NAME_Type) < 0)
    4511           0 :                 goto out;
    4512        3229 :         if (PyType_Ready(&PAC_SIGNATURE_DATA_Type) < 0)
    4513           0 :                 goto out;
    4514        3229 :         if (PyType_Ready(&PAC_DOMAIN_GROUP_MEMBERSHIP_Type) < 0)
    4515           0 :                 goto out;
    4516        3229 :         if (PyType_Ready(&PAC_LOGON_INFO_Type) < 0)
    4517           0 :                 goto out;
    4518        3229 :         if (PyType_Ready(&PAC_CREDENTIAL_NTLM_SECPKG_Type) < 0)
    4519           0 :                 goto out;
    4520        3229 :         if (PyType_Ready(&PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type) < 0)
    4521           0 :                 goto out;
    4522        3229 :         if (PyType_Ready(&PAC_CREDENTIAL_DATA_Type) < 0)
    4523           0 :                 goto out;
    4524        3229 :         if (PyType_Ready(&PAC_CREDENTIAL_DATA_CTR_Type) < 0)
    4525           0 :                 goto out;
    4526        3229 :         if (PyType_Ready(&PAC_CREDENTIAL_DATA_NDR_Type) < 0)
    4527           0 :                 goto out;
    4528        3229 :         if (PyType_Ready(&PAC_CREDENTIAL_INFO_Type) < 0)
    4529           0 :                 goto out;
    4530        3229 :         if (PyType_Ready(&PAC_CONSTRAINED_DELEGATION_Type) < 0)
    4531           0 :                 goto out;
    4532        3229 :         if (PyType_Ready(&PAC_UPN_DNS_INFO_Type) < 0)
    4533           0 :                 goto out;
    4534        3229 :         if (PyType_Ready(&PAC_LOGON_INFO_CTR_Type) < 0)
    4535           0 :                 goto out;
    4536        3229 :         if (PyType_Ready(&PAC_CONSTRAINED_DELEGATION_CTR_Type) < 0)
    4537           0 :                 goto out;
    4538        3229 :         if (PyType_Ready(&DATA_BLOB_REM_Type) < 0)
    4539           0 :                 goto out;
    4540        3229 :         if (PyType_Ready(&PAC_INFO_Type) < 0)
    4541           0 :                 goto out;
    4542        3229 :         if (PyType_Ready(&PAC_BUFFER_Type) < 0)
    4543           0 :                 goto out;
    4544        3229 :         if (PyType_Ready(&PAC_DATA_Type) < 0)
    4545           0 :                 goto out;
    4546        3229 :         if (PyType_Ready(&PAC_BUFFER_RAW_Type) < 0)
    4547           0 :                 goto out;
    4548        3229 :         if (PyType_Ready(&PAC_DATA_RAW_Type) < 0)
    4549           0 :                 goto out;
    4550        3229 :         if (PyType_Ready(&PAC_Validate_Type) < 0)
    4551           0 :                 goto out;
    4552        3229 :         if (PyType_Ready(&netsamlogoncache_entry_Type) < 0)
    4553           0 :                 goto out;
    4554        3229 :         if (PyType_Ready(&krb5pac_InterfaceType) < 0)
    4555           0 :                 goto out;
    4556        3229 :         if (PyType_Ready(&krb5pac_SyntaxType) < 0)
    4557           0 :                 goto out;
    4558        3229 :         if (!PyInterface_AddNdrRpcMethods(&krb5pac_InterfaceType, py_ndr_krb5pac_methods))
    4559           0 :                 return NULL;
    4560             : 
    4561             : #ifdef PY_PAC_LOGON_NAME_PATCH
    4562             :         PY_PAC_LOGON_NAME_PATCH(&PAC_LOGON_NAME_Type);
    4563             : #endif
    4564             : #ifdef PY_PAC_SIGNATURE_DATA_PATCH
    4565             :         PY_PAC_SIGNATURE_DATA_PATCH(&PAC_SIGNATURE_DATA_Type);
    4566             : #endif
    4567             : #ifdef PY_PAC_DOMAIN_GROUP_MEMBERSHIP_PATCH
    4568             :         PY_PAC_DOMAIN_GROUP_MEMBERSHIP_PATCH(&PAC_DOMAIN_GROUP_MEMBERSHIP_Type);
    4569             : #endif
    4570             : #ifdef PY_PAC_LOGON_INFO_PATCH
    4571             :         PY_PAC_LOGON_INFO_PATCH(&PAC_LOGON_INFO_Type);
    4572             : #endif
    4573             : #ifdef PY_PAC_CREDENTIAL_NTLM_SECPKG_PATCH
    4574             :         PY_PAC_CREDENTIAL_NTLM_SECPKG_PATCH(&PAC_CREDENTIAL_NTLM_SECPKG_Type);
    4575             : #endif
    4576             : #ifdef PY_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_PATCH
    4577             :         PY_PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_PATCH(&PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type);
    4578             : #endif
    4579             : #ifdef PY_PAC_CREDENTIAL_DATA_PATCH
    4580             :         PY_PAC_CREDENTIAL_DATA_PATCH(&PAC_CREDENTIAL_DATA_Type);
    4581             : #endif
    4582             : #ifdef PY_PAC_CREDENTIAL_DATA_CTR_PATCH
    4583             :         PY_PAC_CREDENTIAL_DATA_CTR_PATCH(&PAC_CREDENTIAL_DATA_CTR_Type);
    4584             : #endif
    4585             : #ifdef PY_PAC_CREDENTIAL_DATA_NDR_PATCH
    4586             :         PY_PAC_CREDENTIAL_DATA_NDR_PATCH(&PAC_CREDENTIAL_DATA_NDR_Type);
    4587             : #endif
    4588             : #ifdef PY_PAC_CREDENTIAL_INFO_PATCH
    4589             :         PY_PAC_CREDENTIAL_INFO_PATCH(&PAC_CREDENTIAL_INFO_Type);
    4590             : #endif
    4591             : #ifdef PY_PAC_CONSTRAINED_DELEGATION_PATCH
    4592             :         PY_PAC_CONSTRAINED_DELEGATION_PATCH(&PAC_CONSTRAINED_DELEGATION_Type);
    4593             : #endif
    4594             : #ifdef PY_PAC_UPN_DNS_INFO_PATCH
    4595             :         PY_PAC_UPN_DNS_INFO_PATCH(&PAC_UPN_DNS_INFO_Type);
    4596             : #endif
    4597             : #ifdef PY_PAC_LOGON_INFO_CTR_PATCH
    4598             :         PY_PAC_LOGON_INFO_CTR_PATCH(&PAC_LOGON_INFO_CTR_Type);
    4599             : #endif
    4600             : #ifdef PY_PAC_CONSTRAINED_DELEGATION_CTR_PATCH
    4601             :         PY_PAC_CONSTRAINED_DELEGATION_CTR_PATCH(&PAC_CONSTRAINED_DELEGATION_CTR_Type);
    4602             : #endif
    4603             : #ifdef PY_DATA_BLOB_REM_PATCH
    4604             :         PY_DATA_BLOB_REM_PATCH(&DATA_BLOB_REM_Type);
    4605             : #endif
    4606             : #ifdef PY_PAC_INFO_PATCH
    4607             :         PY_PAC_INFO_PATCH(&PAC_INFO_Type);
    4608             : #endif
    4609             : #ifdef PY_PAC_BUFFER_PATCH
    4610             :         PY_PAC_BUFFER_PATCH(&PAC_BUFFER_Type);
    4611             : #endif
    4612             : #ifdef PY_PAC_DATA_PATCH
    4613             :         PY_PAC_DATA_PATCH(&PAC_DATA_Type);
    4614             : #endif
    4615             : #ifdef PY_PAC_BUFFER_RAW_PATCH
    4616             :         PY_PAC_BUFFER_RAW_PATCH(&PAC_BUFFER_RAW_Type);
    4617             : #endif
    4618             : #ifdef PY_PAC_DATA_RAW_PATCH
    4619             :         PY_PAC_DATA_RAW_PATCH(&PAC_DATA_RAW_Type);
    4620             : #endif
    4621             : #ifdef PY_PAC_VALIDATE_PATCH
    4622             :         PY_PAC_VALIDATE_PATCH(&PAC_Validate_Type);
    4623             : #endif
    4624             : #ifdef PY_NETSAMLOGONCACHE_ENTRY_PATCH
    4625             :         PY_NETSAMLOGONCACHE_ENTRY_PATCH(&netsamlogoncache_entry_Type);
    4626             : #endif
    4627             : #ifdef PY_KRB5PAC_PATCH
    4628             :         PY_KRB5PAC_PATCH(&krb5pac_InterfaceType);
    4629             : #endif
    4630             : #ifdef PY_KRB5PAC_ABSTRACT_SYNTAX_PATCH
    4631             :         PY_KRB5PAC_ABSTRACT_SYNTAX_PATCH(&krb5pac_SyntaxType);
    4632             : #endif
    4633             : #ifdef PY_ABSTRACT_SYNTAX_PATCH
    4634             :         PY_ABSTRACT_SYNTAX_PATCH(&krb5pac_SyntaxType);
    4635             : #endif
    4636             : 
    4637        3229 :         m = PyModule_Create(&moduledef);
    4638        3229 :         if (m == NULL)
    4639           0 :                 goto out;
    4640             : 
    4641        3229 :         PyModule_AddObject(m, "NETLOGON_GENERIC_KRB5_PAC_VALIDATE", PyLong_FromUnsignedLongLong(3));
    4642        3229 :         PyModule_AddObject(m, "PAC_CREDENTIAL_NTLM_HAS_LM_HASH", PyLong_FromUnsignedLongLong((uint32_t)PAC_CREDENTIAL_NTLM_HAS_LM_HASH));
    4643        3229 :         PyModule_AddObject(m, "PAC_CREDENTIAL_NTLM_HAS_NT_HASH", PyLong_FromUnsignedLongLong((uint32_t)PAC_CREDENTIAL_NTLM_HAS_NT_HASH));
    4644        3229 :         PyModule_AddObject(m, "PAC_UPN_DNS_FLAG_CONSTRUCTED", PyLong_FromUnsignedLongLong((uint32_t)PAC_UPN_DNS_FLAG_CONSTRUCTED));
    4645        3229 :         PyModule_AddObject(m, "PAC_TYPE_LOGON_INFO", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_LOGON_INFO));
    4646        3229 :         PyModule_AddObject(m, "PAC_TYPE_CREDENTIAL_INFO", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_CREDENTIAL_INFO));
    4647        3229 :         PyModule_AddObject(m, "PAC_TYPE_SRV_CHECKSUM", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_SRV_CHECKSUM));
    4648        3229 :         PyModule_AddObject(m, "PAC_TYPE_KDC_CHECKSUM", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_KDC_CHECKSUM));
    4649        3229 :         PyModule_AddObject(m, "PAC_TYPE_LOGON_NAME", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_LOGON_NAME));
    4650        3229 :         PyModule_AddObject(m, "PAC_TYPE_CONSTRAINED_DELEGATION", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_CONSTRAINED_DELEGATION));
    4651        3229 :         PyModule_AddObject(m, "PAC_TYPE_UPN_DNS_INFO", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_UPN_DNS_INFO));
    4652        3229 :         PyModule_AddObject(m, "PAC_TYPE_TICKET_CHECKSUM", PyLong_FromUnsignedLongLong((uint32_t)PAC_TYPE_TICKET_CHECKSUM));
    4653        3229 :         Py_INCREF((PyObject *)(void *)&PAC_LOGON_NAME_Type);
    4654        3229 :         PyModule_AddObject(m, "PAC_LOGON_NAME", (PyObject *)(void *)&PAC_LOGON_NAME_Type);
    4655        3229 :         Py_INCREF((PyObject *)(void *)&PAC_SIGNATURE_DATA_Type);
    4656        3229 :         PyModule_AddObject(m, "PAC_SIGNATURE_DATA", (PyObject *)(void *)&PAC_SIGNATURE_DATA_Type);
    4657        3229 :         Py_INCREF((PyObject *)(void *)&PAC_DOMAIN_GROUP_MEMBERSHIP_Type);
    4658        3229 :         PyModule_AddObject(m, "PAC_DOMAIN_GROUP_MEMBERSHIP", (PyObject *)(void *)&PAC_DOMAIN_GROUP_MEMBERSHIP_Type);
    4659        3229 :         Py_INCREF((PyObject *)(void *)&PAC_LOGON_INFO_Type);
    4660        3229 :         PyModule_AddObject(m, "PAC_LOGON_INFO", (PyObject *)(void *)&PAC_LOGON_INFO_Type);
    4661        3229 :         Py_INCREF((PyObject *)(void *)&PAC_CREDENTIAL_NTLM_SECPKG_Type);
    4662        3229 :         PyModule_AddObject(m, "PAC_CREDENTIAL_NTLM_SECPKG", (PyObject *)(void *)&PAC_CREDENTIAL_NTLM_SECPKG_Type);
    4663        3229 :         Py_INCREF((PyObject *)(void *)&PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type);
    4664        3229 :         PyModule_AddObject(m, "PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG", (PyObject *)(void *)&PAC_CREDENTIAL_SUPPLEMENTAL_SECPKG_Type);
    4665        3229 :         Py_INCREF((PyObject *)(void *)&PAC_CREDENTIAL_DATA_Type);
    4666        3229 :         PyModule_AddObject(m, "PAC_CREDENTIAL_DATA", (PyObject *)(void *)&PAC_CREDENTIAL_DATA_Type);
    4667        3229 :         Py_INCREF((PyObject *)(void *)&PAC_CREDENTIAL_DATA_CTR_Type);
    4668        3229 :         PyModule_AddObject(m, "PAC_CREDENTIAL_DATA_CTR", (PyObject *)(void *)&PAC_CREDENTIAL_DATA_CTR_Type);
    4669        3229 :         Py_INCREF((PyObject *)(void *)&PAC_CREDENTIAL_DATA_NDR_Type);
    4670        3229 :         PyModule_AddObject(m, "PAC_CREDENTIAL_DATA_NDR", (PyObject *)(void *)&PAC_CREDENTIAL_DATA_NDR_Type);
    4671        3229 :         Py_INCREF((PyObject *)(void *)&PAC_CREDENTIAL_INFO_Type);
    4672        3229 :         PyModule_AddObject(m, "PAC_CREDENTIAL_INFO", (PyObject *)(void *)&PAC_CREDENTIAL_INFO_Type);
    4673        3229 :         Py_INCREF((PyObject *)(void *)&PAC_CONSTRAINED_DELEGATION_Type);
    4674        3229 :         PyModule_AddObject(m, "PAC_CONSTRAINED_DELEGATION", (PyObject *)(void *)&PAC_CONSTRAINED_DELEGATION_Type);
    4675        3229 :         Py_INCREF((PyObject *)(void *)&PAC_UPN_DNS_INFO_Type);
    4676        3229 :         PyModule_AddObject(m, "PAC_UPN_DNS_INFO", (PyObject *)(void *)&PAC_UPN_DNS_INFO_Type);
    4677        3229 :         Py_INCREF((PyObject *)(void *)&PAC_LOGON_INFO_CTR_Type);
    4678        3229 :         PyModule_AddObject(m, "PAC_LOGON_INFO_CTR", (PyObject *)(void *)&PAC_LOGON_INFO_CTR_Type);
    4679        3229 :         Py_INCREF((PyObject *)(void *)&PAC_CONSTRAINED_DELEGATION_CTR_Type);
    4680        3229 :         PyModule_AddObject(m, "PAC_CONSTRAINED_DELEGATION_CTR", (PyObject *)(void *)&PAC_CONSTRAINED_DELEGATION_CTR_Type);
    4681        3229 :         Py_INCREF((PyObject *)(void *)&DATA_BLOB_REM_Type);
    4682        3229 :         PyModule_AddObject(m, "DATA_BLOB_REM", (PyObject *)(void *)&DATA_BLOB_REM_Type);
    4683        3229 :         Py_INCREF((PyObject *)(void *)&PAC_INFO_Type);
    4684        3229 :         PyModule_AddObject(m, "PAC_INFO", (PyObject *)(void *)&PAC_INFO_Type);
    4685        3229 :         Py_INCREF((PyObject *)(void *)&PAC_BUFFER_Type);
    4686        3229 :         PyModule_AddObject(m, "PAC_BUFFER", (PyObject *)(void *)&PAC_BUFFER_Type);
    4687        3229 :         Py_INCREF((PyObject *)(void *)&PAC_DATA_Type);
    4688        3229 :         PyModule_AddObject(m, "PAC_DATA", (PyObject *)(void *)&PAC_DATA_Type);
    4689        3229 :         Py_INCREF((PyObject *)(void *)&PAC_BUFFER_RAW_Type);
    4690        3229 :         PyModule_AddObject(m, "PAC_BUFFER_RAW", (PyObject *)(void *)&PAC_BUFFER_RAW_Type);
    4691        3229 :         Py_INCREF((PyObject *)(void *)&PAC_DATA_RAW_Type);
    4692        3229 :         PyModule_AddObject(m, "PAC_DATA_RAW", (PyObject *)(void *)&PAC_DATA_RAW_Type);
    4693        3229 :         Py_INCREF((PyObject *)(void *)&PAC_Validate_Type);
    4694        3229 :         PyModule_AddObject(m, "PAC_Validate", (PyObject *)(void *)&PAC_Validate_Type);
    4695        3229 :         Py_INCREF((PyObject *)(void *)&netsamlogoncache_entry_Type);
    4696        3229 :         PyModule_AddObject(m, "netsamlogoncache_entry", (PyObject *)(void *)&netsamlogoncache_entry_Type);
    4697        3229 :         Py_INCREF((PyObject *)(void *)&krb5pac_InterfaceType);
    4698        3229 :         PyModule_AddObject(m, "krb5pac", (PyObject *)(void *)&krb5pac_InterfaceType);
    4699        3229 :         Py_INCREF((PyObject *)(void *)&krb5pac_SyntaxType);
    4700        3229 :         PyModule_AddObject(m, "krb5pac_abstract_syntax", (PyObject *)(void *)&krb5pac_SyntaxType);
    4701        3229 :         Py_INCREF((PyObject *)(void *)&krb5pac_SyntaxType);
    4702        3229 :         PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&krb5pac_SyntaxType);
    4703             : #ifdef PY_MOD_KRB5PAC_PATCH
    4704             :         PY_MOD_KRB5PAC_PATCH(m);
    4705             : #endif
    4706        3229 :         out:
    4707        3229 :         Py_XDECREF(dep_samba_dcerpc_security);
    4708        3229 :         Py_XDECREF(dep_samba_dcerpc_lsa);
    4709        3229 :         Py_XDECREF(dep_samba_dcerpc_netlogon);
    4710        3229 :         Py_XDECREF(dep_samba_dcerpc_samr);
    4711        3229 :         Py_XDECREF(dep_talloc);
    4712        3229 :         Py_XDECREF(dep_samba_dcerpc_base);
    4713        3229 :         Py_XDECREF(dep_samba_dcerpc_misc);
    4714        3113 :         return m;
    4715             : 
    4716             : }

Generated by: LCOV version 1.13