diff options
author | Andrew Bartlett <abartlet@samba.org> | 2004-04-13 20:57:26 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:51:13 -0500 |
commit | 8e87cf8ad99d8e67620222959ce54f199b231025 (patch) | |
tree | 52af8470c0ed201e2e5710fe7a47ba9ff332ed1c | |
parent | 42bdc37e94adb4bed0658c569cf484060527481c (diff) | |
download | samba-8e87cf8ad99d8e67620222959ce54f199b231025.tar.gz samba-8e87cf8ad99d8e67620222959ce54f199b231025.tar.bz2 samba-8e87cf8ad99d8e67620222959ce54f199b231025.zip |
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)
-rw-r--r-- | source3/utils/ntlm_auth.c | 17 |
1 files changed, 9 insertions, 8 deletions
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")) { |