1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

pyglue: Export some GKDI constants

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton 2023-12-12 18:31:34 +13:00 committed by Andrew Bartlett
parent e19d74bb25
commit a5a58918f7
2 changed files with 38 additions and 0 deletions

View File

@ -28,6 +28,7 @@
#include "librpc/ndr/ndr_private.h" #include "librpc/ndr/ndr_private.h"
#include "lib/cmdline/cmdline.h" #include "lib/cmdline/cmdline.h"
#include "libcli/util/hresult.h" #include "libcli/util/hresult.h"
#include "lib/crypto/gkdi.h"
void init_glue(void); void init_glue(void);
static PyObject *PyExc_NTSTATUSError; static PyObject *PyExc_NTSTATUSError;
@ -600,6 +601,8 @@ static struct PyModuleDef moduledef = {
MODULE_INIT_FUNC(_glue) MODULE_INIT_FUNC(_glue)
{ {
PyObject *m; PyObject *m;
PyObject *py_obj = NULL;
int ret;
debug_setup_talloc_log(); debug_setup_talloc_log();
@ -643,5 +646,39 @@ MODULE_INIT_FUNC(_glue)
PyLong_FromUnsignedLongLong(HRES_ERROR_V(HRES_SEC_E_INVALID_TOKEN))); PyLong_FromUnsignedLongLong(HRES_ERROR_V(HRES_SEC_E_INVALID_TOKEN)));
PyModule_AddObject(m, "HRES_SEC_E_LOGON_DENIED", PyModule_AddObject(m, "HRES_SEC_E_LOGON_DENIED",
PyLong_FromUnsignedLongLong(HRES_ERROR_V(HRES_SEC_E_LOGON_DENIED))); PyLong_FromUnsignedLongLong(HRES_ERROR_V(HRES_SEC_E_LOGON_DENIED)));
ret = PyModule_AddIntConstant(m, "GKDI_L1_KEY_ITERATION", gkdi_l1_key_iteration);
if (ret) {
Py_DECREF(m);
return NULL;
}
ret = PyModule_AddIntConstant(m, "GKDI_L2_KEY_ITERATION", gkdi_l2_key_iteration);
if (ret) {
Py_DECREF(m);
return NULL;
}
py_obj = PyLong_FromLongLong(gkdi_key_cycle_duration);
if (py_obj == NULL) {
Py_DECREF(m);
return NULL;
}
ret = PyModule_AddObject(m, "GKDI_KEY_CYCLE_DURATION", py_obj);
if (ret) {
Py_DECREF(py_obj);
Py_DECREF(m);
return NULL;
}
py_obj = PyLong_FromLongLong(gkdi_max_clock_skew);
if (py_obj == NULL) {
Py_DECREF(m);
return NULL;
}
ret = PyModule_AddObject(m, "GKDI_MAX_CLOCK_SKEW", py_obj);
if (ret) {
Py_DECREF(py_obj);
Py_DECREF(m);
return NULL;
}
return m; return m;
} }

View File

@ -118,6 +118,7 @@ def build(bld):
netif netif
ndr ndr
cmdline cmdline
gkdi
%s %s
''' % (pyparam_util, pytalloc_util), ''' % (pyparam_util, pytalloc_util),
realname='samba/_glue.so') realname='samba/_glue.so')