summaryrefslogtreecommitdiff
path: root/source3/python/py_winbind.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/python/py_winbind.c')
-rw-r--r--source3/python/py_winbind.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/source3/python/py_winbind.c b/source3/python/py_winbind.c
index 783ac54439..ef6bc06233 100644
--- a/source3/python/py_winbind.c
+++ b/source3/python/py_winbind.c
@@ -412,18 +412,13 @@ static PyObject *py_auth_plaintext(PyObject *self, PyObject *args)
/* Challenge/response authentication */
-static PyObject *py_auth_crap(PyObject *self, PyObject *args, PyObject *kw)
+static PyObject *py_auth_crap(PyObject *self, PyObject *args)
{
- static char *kwlist[] =
- {"username", "password", "use_lm_hash", "use_nt_hash", NULL };
struct winbindd_request request;
struct winbindd_response response;
char *username, *password;
- int use_lm_hash = 1, use_nt_hash = 1;
- if (!PyArg_ParseTupleAndKeywords(
- args, kw, "ss|ii", kwlist, &username, &password,
- &use_lm_hash, &use_nt_hash))
+ if (!PyArg_ParseTuple(args, "ss", &username, &password))
return NULL;
ZERO_STRUCT(request);
@@ -433,17 +428,13 @@ static PyObject *py_auth_crap(PyObject *self, PyObject *args, PyObject *kw)
generate_random_buffer(request.data.auth_crap.chal, 8, False);
- if (use_lm_hash) {
- SMBencrypt((uchar *)password, request.data.auth_crap.chal,
- (uchar *)request.data.auth_crap.lm_resp);
- request.data.auth_crap.lm_resp_len = 24;
- }
+ SMBencrypt((uchar *)password, request.data.auth_crap.chal,
+ (uchar *)request.data.auth_crap.lm_resp);
+ SMBNTencrypt((uchar *)password, request.data.auth_crap.chal,
+ (uchar *)request.data.auth_crap.nt_resp);
- if (use_nt_hash) {
- SMBNTencrypt((uchar *)password, request.data.auth_crap.chal,
- (uchar *)request.data.auth_crap.nt_resp);
- request.data.auth_crap.nt_resp_len = 24;
- }
+ request.data.auth_crap.lm_resp_len = 24;
+ request.data.auth_crap.nt_resp_len = 24;
if (winbindd_request(WINBINDD_PAM_AUTH_CRAP, &request, &response)
!= NSS_STATUS_SUCCESS) {