From 656ec98e5b248f9107af5713495e4aeca17e3155 Mon Sep 17 00:00:00 2001 From: Joe Guo Date: Wed, 2 May 2018 21:40:39 +0000 Subject: [PATCH] pycredentials: add py_creds_get_secure_channel_type We have only set, need get. Signed-off-by: Joe Guo Reviewed-by: Andrew Bartlett Reviewed-by: Garming Sam --- auth/credentials/pycredentials.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c index 68bb3060a99..c626e3fa8a0 100644 --- a/auth/credentials/pycredentials.c +++ b/auth/credentials/pycredentials.c @@ -680,6 +680,16 @@ static PyObject *py_creds_set_secure_channel_type(PyObject *self, PyObject *args Py_RETURN_NONE; } +static PyObject *py_creds_get_secure_channel_type(PyObject *self, PyObject *args) +{ + enum netr_SchannelType channel_type = SEC_CHAN_NULL; + + channel_type = cli_credentials_get_secure_channel_type( + PyCredentials_AsCliCredentials(self)); + + return PyInt_FromLong(channel_type); +} + static PyObject *py_creds_encrypt_netr_crypt_password(PyObject *self, PyObject *args) { @@ -815,6 +825,8 @@ static PyMethodDef py_creds_methods[] = { "Get a new client NETLOGON_AUTHENTICATOR"}, { "set_secure_channel_type", py_creds_set_secure_channel_type, METH_VARARGS, NULL }, + { "get_secure_channel_type", py_creds_get_secure_channel_type, + METH_VARARGS }, { "encrypt_netr_crypt_password", py_creds_encrypt_netr_crypt_password, METH_VARARGS,