From 8e87cf8ad99d8e67620222959ce54f199b231025 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 13 Apr 2004 20:57:26 +0000 Subject: r201: Fix bugs in the --helper-protocol=ntlm-server-1 implementation. (allow the use of base64 encoded strings, LM or NT passwords) Andrew Bartlett (This used to be commit 57a5563b421b0684e7bb40d10c2168916c59c89d) --- source3/utils/ntlm_auth.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'source3') diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c index 0e763968ab..70383b31dc 100644 --- a/source3/utils/ntlm_auth.c +++ b/source3/utils/ntlm_auth.c @@ -1418,7 +1418,7 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod } else { x_fprintf(x_stdout, "Authenticated: No\n"); } - } else if (!lm_response.data || !nt_response.data) { + } else if (!lm_response.data && !nt_response.data) { x_fprintf(x_stdout, "Error: No password supplied!\n"); } else if (!challenge.data) { x_fprintf(x_stdout, "Error: No lanman-challenge supplied!\n"); @@ -1513,30 +1513,31 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod request = buf; - parameter = strstr_m(request, ": "); + /* Indicates a base64 encoded structure */ + parameter = strstr_m(request, ":: "); if (!parameter) { - /* Indicates a base64 encoded structure */ - parameter = strstr_m(request, ":: "); + parameter = strstr_m(request, ": "); if (!parameter) { DEBUG(0, ("Parameter not found!\n")); x_fprintf(x_stdout, "Error: Parameter not found!\n.\n"); return; } - parameter[0] ='\0'; - parameter++; + parameter[0] ='\0'; parameter++; parameter[0] ='\0'; parameter++; - base64_decode_inplace(parameter); } else { - parameter[0] ='\0'; parameter++; parameter[0] ='\0'; parameter++; + parameter[0] ='\0'; + parameter++; + + base64_decode_inplace(parameter); } if (strequal(request, "LANMAN-Challenge")) { -- cgit