2003-06-11 09:38:55 -04:00
|
|
|
/***************************************************************************
|
2004-05-25 07:13:49 -04:00
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
2003-06-11 09:38:55 -04:00
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2011-04-19 18:48:20 -04:00
|
|
|
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2003-06-11 09:38:55 -04:00
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
|
|
|
* are also available at http://curl.haxx.se/docs/copyright.html.
|
2004-05-25 07:13:49 -04:00
|
|
|
*
|
2003-06-11 09:38:55 -04:00
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
2011-07-26 11:23:27 -04:00
|
|
|
|
2003-06-11 09:38:55 -04:00
|
|
|
#include "setup.h"
|
|
|
|
|
2003-06-26 07:26:26 -04:00
|
|
|
/* NTLM details:
|
2004-05-25 07:13:49 -04:00
|
|
|
|
2003-06-26 07:26:26 -04:00
|
|
|
http://davenport.sourceforge.net/ntlm.html
|
|
|
|
http://www.innovation.ch/java/ntlm.html
|
|
|
|
*/
|
2003-06-11 09:38:55 -04:00
|
|
|
|
|
|
|
#ifndef CURL_DISABLE_HTTP
|
2005-04-07 11:27:13 -04:00
|
|
|
#ifdef USE_NTLM
|
2003-06-11 09:38:55 -04:00
|
|
|
|
2006-04-05 08:35:48 -04:00
|
|
|
#define DEBUG_ME 0
|
|
|
|
|
2006-11-01 19:33:43 -05:00
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
2011-07-31 14:44:41 -04:00
|
|
|
#ifdef HAVE_SYS_WAIT_H
|
2011-07-18 17:36:36 -04:00
|
|
|
#include <sys/wait.h>
|
2011-07-31 14:44:41 -04:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SIGNAL_H
|
2011-07-18 17:36:36 -04:00
|
|
|
#include <signal.h>
|
|
|
|
#endif
|
|
|
|
|
2007-07-11 05:08:03 -04:00
|
|
|
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
|
|
|
|
#include <netdb.h>
|
|
|
|
#endif
|
|
|
|
|
2003-06-11 09:38:55 -04:00
|
|
|
#include "urldata.h"
|
2011-04-19 18:48:20 -04:00
|
|
|
#include "non-ascii.h" /* for Curl_convert_... prototypes */
|
2003-06-11 09:38:55 -04:00
|
|
|
#include "sendf.h"
|
2011-07-28 15:27:55 -04:00
|
|
|
#include "select.h"
|
2008-10-23 07:49:19 -04:00
|
|
|
#include "rawstr.h"
|
2008-08-16 20:25:38 -04:00
|
|
|
#include "curl_base64.h"
|
2003-06-11 09:38:55 -04:00
|
|
|
#include "http_ntlm.h"
|
2003-07-21 09:16:01 -04:00
|
|
|
#include "url.h"
|
2011-07-27 13:12:06 -04:00
|
|
|
#include "strerror.h"
|
2010-07-29 18:47:49 -04:00
|
|
|
#include "curl_gethostname.h"
|
2009-04-21 07:46:16 -04:00
|
|
|
#include "curl_memory.h"
|
2003-06-11 09:38:55 -04:00
|
|
|
|
|
|
|
#define _MPRINTF_REPLACE /* use our functions only */
|
|
|
|
#include <curl/mprintf.h>
|
|
|
|
|
2006-04-05 08:35:48 -04:00
|
|
|
#if DEBUG_ME
|
|
|
|
# define DEBUG_OUT(x) x
|
|
|
|
#else
|
|
|
|
# define DEBUG_OUT(x)
|
|
|
|
#endif
|
|
|
|
|
2011-08-13 17:58:27 -04:00
|
|
|
CURLcode Curl_input_ntlm(struct connectdata *conn,
|
2011-08-12 13:51:50 -04:00
|
|
|
bool proxy, /* if proxy or not */
|
2007-08-27 02:31:28 -04:00
|
|
|
const char *header) /* rest of the www-authenticate:
|
|
|
|
header */
|
2003-06-11 09:38:55 -04:00
|
|
|
{
|
2003-07-22 05:59:36 -04:00
|
|
|
/* point to the correct struct with this */
|
|
|
|
struct ntlmdata *ntlm;
|
2011-08-13 17:58:27 -04:00
|
|
|
CURLcode result = CURLE_OK;
|
2003-07-22 05:59:36 -04:00
|
|
|
|
2010-06-26 21:38:01 -04:00
|
|
|
#ifdef USE_NSS
|
2011-08-13 17:58:27 -04:00
|
|
|
result = Curl_nss_force_init(conn->data);
|
|
|
|
if(result)
|
|
|
|
return result;
|
2010-06-26 21:38:01 -04:00
|
|
|
#endif
|
|
|
|
|
2011-08-09 16:53:48 -04:00
|
|
|
ntlm = proxy ? &conn->proxyntlm : &conn->ntlm;
|
2003-07-22 05:59:36 -04:00
|
|
|
|
2003-06-11 09:38:55 -04:00
|
|
|
/* skip initial whitespaces */
|
2006-10-17 17:32:56 -04:00
|
|
|
while(*header && ISSPACE(*header))
|
2003-06-11 09:38:55 -04:00
|
|
|
header++;
|
|
|
|
|
|
|
|
if(checkprefix("NTLM", header)) {
|
|
|
|
header += strlen("NTLM");
|
|
|
|
|
2006-10-17 17:32:56 -04:00
|
|
|
while(*header && ISSPACE(*header))
|
2003-06-11 09:38:55 -04:00
|
|
|
header++;
|
|
|
|
|
|
|
|
if(*header) {
|
2011-08-12 13:51:50 -04:00
|
|
|
/* We got a type-2 message */
|
2006-04-05 08:35:48 -04:00
|
|
|
|
http NTLM: split http_ntlm.[ch] between http_ntlm.[ch] and curl_ntlm.[ch]
For modularity purposes, huge chunks of NTLM existing code is transformed into
functions to allow future internal code reuse.
Resulting three new libcurl private functions:
- Curl_ntlm_create_type1_message()
- Curl_ntlm_create_type3_message()
- Curl_ntlm_decode_type2_message()
Changing static ntlm_sspi_cleanup() into non-static Curl_ntlm_sspi_cleanup()
This 'refactoring' has been prepared by previous commits to allow that this
specific one does not introduce any change to existing code. All existing
goodness and badness previous to this commit should remain the same once it is
applied, the only difference should be that existing code is moved into
functions.
Given the quite big portions of code being moved around, and the importance of
change traceability, this commit has been done in such a way that it is
possible to perform a three-way diff from initial http_ntlm.[ch] to resulting
http_ntlm.[ch] and curl_ntlm.[ch] to actually verify that no functional change
is introduced here.
Notice that Steve Holme has provided several patches, but these included this
refactoring along with 'extra' fixes. I really wanted this 'clean' refactoring
done first, in order to allow discussion or committing of 'extra' fixes on a
case by case basis, so, I had to bite the bullet ;-)
Comments, line adjustments, compiler warning fixes, whatever, may follow
afterwards.
2011-08-14 09:45:19 -04:00
|
|
|
result = Curl_ntlm_decode_type2_message(conn->data, header, ntlm);
|
|
|
|
if(CURLE_OK != result)
|
|
|
|
return result;
|
2003-06-11 09:38:55 -04:00
|
|
|
}
|
|
|
|
else {
|
2011-08-13 17:58:27 -04:00
|
|
|
if(ntlm->state >= NTLMSTATE_TYPE1) {
|
|
|
|
infof(conn->data, "NTLM handshake failure (internal error)\n");
|
|
|
|
return CURLE_REMOTE_ACCESS_DENIED;
|
|
|
|
}
|
2003-06-11 10:05:13 -04:00
|
|
|
|
2003-07-22 05:59:36 -04:00
|
|
|
ntlm->state = NTLMSTATE_TYPE1; /* we should sent away a type-1 */
|
2003-06-11 09:38:55 -04:00
|
|
|
}
|
|
|
|
}
|
2011-08-10 20:18:16 -04:00
|
|
|
|
2011-08-13 17:58:27 -04:00
|
|
|
return result;
|
2003-06-11 09:38:55 -04:00
|
|
|
}
|
|
|
|
|
2011-07-31 14:44:41 -04:00
|
|
|
#ifdef WINBIND_NTLM_AUTH_ENABLED
|
2011-07-18 17:36:36 -04:00
|
|
|
static void sso_ntlm_close(struct connectdata *conn)
|
|
|
|
{
|
2011-07-29 07:25:52 -04:00
|
|
|
if(conn->ntlm_auth_hlpr_socket != CURL_SOCKET_BAD) {
|
|
|
|
sclose(conn->ntlm_auth_hlpr_socket);
|
|
|
|
conn->ntlm_auth_hlpr_socket = CURL_SOCKET_BAD;
|
2011-07-18 17:36:36 -04:00
|
|
|
}
|
|
|
|
|
2011-07-29 07:25:52 -04:00
|
|
|
if(conn->ntlm_auth_hlpr_pid) {
|
|
|
|
int i;
|
2011-07-18 17:36:36 -04:00
|
|
|
for(i = 0; i < 4; i++) {
|
2011-07-29 07:25:52 -04:00
|
|
|
pid_t ret = waitpid(conn->ntlm_auth_hlpr_pid, NULL, WNOHANG);
|
|
|
|
if(ret == conn->ntlm_auth_hlpr_pid || errno == ECHILD)
|
2011-07-18 17:36:36 -04:00
|
|
|
break;
|
|
|
|
switch(i) {
|
|
|
|
case 0:
|
2011-07-29 07:25:52 -04:00
|
|
|
kill(conn->ntlm_auth_hlpr_pid, SIGTERM);
|
2011-07-18 17:36:36 -04:00
|
|
|
break;
|
2011-07-28 15:27:55 -04:00
|
|
|
case 1:
|
|
|
|
/* Give the process another moment to shut down cleanly before
|
|
|
|
bringing down the axe */
|
|
|
|
Curl_wait_ms(1);
|
|
|
|
break;
|
2011-07-18 17:36:36 -04:00
|
|
|
case 2:
|
2011-07-29 07:25:52 -04:00
|
|
|
kill(conn->ntlm_auth_hlpr_pid, SIGKILL);
|
2011-07-18 17:36:36 -04:00
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2011-07-29 07:25:52 -04:00
|
|
|
conn->ntlm_auth_hlpr_pid = 0;
|
2011-07-18 17:36:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
Curl_safefree(conn->challenge_header);
|
|
|
|
conn->challenge_header = NULL;
|
|
|
|
Curl_safefree(conn->response_header);
|
|
|
|
conn->response_header = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static CURLcode sso_ntlm_initiate(struct connectdata *conn,
|
|
|
|
const char *userp)
|
|
|
|
{
|
2011-07-29 07:25:52 -04:00
|
|
|
curl_socket_t sockfds[2];
|
|
|
|
pid_t child_pid;
|
2011-07-18 17:36:36 -04:00
|
|
|
const char *username;
|
|
|
|
char *slash, *domain = NULL;
|
2011-07-19 17:54:21 -04:00
|
|
|
const char *ntlm_auth = NULL;
|
2011-07-27 13:12:06 -04:00
|
|
|
char *ntlm_auth_alloc = NULL;
|
|
|
|
int error;
|
2011-07-18 17:36:36 -04:00
|
|
|
|
|
|
|
/* Return if communication with ntlm_auth already set up */
|
2011-07-29 07:25:52 -04:00
|
|
|
if(conn->ntlm_auth_hlpr_socket != CURL_SOCKET_BAD ||
|
|
|
|
conn->ntlm_auth_hlpr_pid)
|
2011-07-18 17:36:36 -04:00
|
|
|
return CURLE_OK;
|
|
|
|
|
|
|
|
username = userp;
|
|
|
|
slash = strpbrk(username, "\\/");
|
|
|
|
if(slash) {
|
|
|
|
if((domain = strdup(username)) == NULL)
|
|
|
|
return CURLE_OUT_OF_MEMORY;
|
|
|
|
slash = domain + (slash - username);
|
|
|
|
*slash = '\0';
|
|
|
|
username = username + (slash - domain) + 1;
|
|
|
|
}
|
|
|
|
|
2011-07-31 14:44:41 -04:00
|
|
|
/* For testing purposes, when DEBUGBUILD is defined and environment
|
|
|
|
variable CURL_NTLM_AUTH is set a fake_ntlm is used to perform
|
|
|
|
NTLM challenge/response which only accepts commands and output
|
|
|
|
strings pre-written in test case definitions */
|
2011-07-18 17:36:36 -04:00
|
|
|
#ifdef DEBUGBUILD
|
2011-07-31 14:44:41 -04:00
|
|
|
ntlm_auth_alloc = curl_getenv("CURL_NTLM_AUTH");
|
2011-07-27 13:12:06 -04:00
|
|
|
if(ntlm_auth_alloc)
|
|
|
|
ntlm_auth = ntlm_auth_alloc;
|
|
|
|
else
|
2011-07-18 17:36:36 -04:00
|
|
|
#endif
|
2011-07-31 14:44:41 -04:00
|
|
|
ntlm_auth = WINBIND_NTLM_AUTH_FILE;
|
2011-07-18 17:36:36 -04:00
|
|
|
|
2011-07-27 13:12:06 -04:00
|
|
|
if(access(ntlm_auth, X_OK) != 0) {
|
|
|
|
error = ERRNO;
|
|
|
|
failf(conn->data, "Could not access ntlm_auth: %s errno %d: %s",
|
|
|
|
ntlm_auth, error, Curl_strerror(conn, error));
|
2011-07-18 17:36:36 -04:00
|
|
|
goto done;
|
2011-07-27 13:12:06 -04:00
|
|
|
}
|
2011-07-18 17:36:36 -04:00
|
|
|
|
2011-07-27 13:12:06 -04:00
|
|
|
if(socketpair(AF_UNIX, SOCK_STREAM, 0, sockfds)) {
|
|
|
|
error = ERRNO;
|
|
|
|
failf(conn->data, "Could not open socket pair. errno %d: %s",
|
|
|
|
error, Curl_strerror(conn, error));
|
2011-07-18 17:36:36 -04:00
|
|
|
goto done;
|
2011-07-27 13:12:06 -04:00
|
|
|
}
|
2011-07-18 17:36:36 -04:00
|
|
|
|
2011-07-29 07:25:52 -04:00
|
|
|
child_pid = fork();
|
|
|
|
if(child_pid == -1) {
|
2011-07-27 13:12:06 -04:00
|
|
|
error = ERRNO;
|
2011-07-29 07:25:52 -04:00
|
|
|
sclose(sockfds[0]);
|
|
|
|
sclose(sockfds[1]);
|
2011-07-27 13:12:06 -04:00
|
|
|
failf(conn->data, "Could not fork. errno %d: %s",
|
|
|
|
error, Curl_strerror(conn, error));
|
2011-07-18 17:36:36 -04:00
|
|
|
goto done;
|
|
|
|
}
|
2011-07-29 07:25:52 -04:00
|
|
|
else if(!child_pid) {
|
2011-07-27 13:12:06 -04:00
|
|
|
/*
|
|
|
|
* child process
|
|
|
|
*/
|
|
|
|
|
2011-07-29 07:25:52 -04:00
|
|
|
sclose(sockfds[0]);
|
2011-07-27 13:12:06 -04:00
|
|
|
|
|
|
|
if(dup2(sockfds[1], STDIN_FILENO) == -1) {
|
|
|
|
error = ERRNO;
|
|
|
|
failf(conn->data, "Could not redirect child stdin. errno %d: %s",
|
|
|
|
error, Curl_strerror(conn, error));
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(dup2(sockfds[1], STDOUT_FILENO) == -1) {
|
|
|
|
error = ERRNO;
|
|
|
|
failf(conn->data, "Could not redirect child stdout. errno %d: %s",
|
|
|
|
error, Curl_strerror(conn, error));
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(domain)
|
|
|
|
execl(ntlm_auth, ntlm_auth,
|
|
|
|
"--helper-protocol", "ntlmssp-client-1",
|
|
|
|
"--use-cached-creds",
|
|
|
|
"--username", username,
|
|
|
|
"--domain", domain,
|
|
|
|
NULL);
|
|
|
|
else
|
|
|
|
execl(ntlm_auth, ntlm_auth,
|
|
|
|
"--helper-protocol", "ntlmssp-client-1",
|
|
|
|
"--use-cached-creds",
|
|
|
|
"--username", username,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
error = ERRNO;
|
2011-07-29 07:25:52 -04:00
|
|
|
sclose(sockfds[1]);
|
2011-07-27 13:12:06 -04:00
|
|
|
failf(conn->data, "Could not execl(). errno %d: %s",
|
|
|
|
error, Curl_strerror(conn, error));
|
|
|
|
exit(1);
|
|
|
|
}
|
2011-07-18 17:36:36 -04:00
|
|
|
|
2011-07-29 07:25:52 -04:00
|
|
|
sclose(sockfds[1]);
|
|
|
|
conn->ntlm_auth_hlpr_socket = sockfds[0];
|
|
|
|
conn->ntlm_auth_hlpr_pid = child_pid;
|
2011-07-18 17:36:36 -04:00
|
|
|
Curl_safefree(domain);
|
2011-07-27 21:07:02 -04:00
|
|
|
Curl_safefree(ntlm_auth_alloc);
|
2011-07-18 17:36:36 -04:00
|
|
|
return CURLE_OK;
|
|
|
|
|
|
|
|
done:
|
|
|
|
Curl_safefree(domain);
|
2011-07-27 13:12:06 -04:00
|
|
|
Curl_safefree(ntlm_auth_alloc);
|
2011-07-18 17:36:36 -04:00
|
|
|
return CURLE_REMOTE_ACCESS_DENIED;
|
|
|
|
}
|
|
|
|
|
|
|
|
static CURLcode sso_ntlm_response(struct connectdata *conn,
|
|
|
|
const char *input, curlntlm state)
|
|
|
|
{
|
|
|
|
ssize_t size;
|
|
|
|
char buf[200]; /* enough, type 1, 3 message length is less then 200 */
|
|
|
|
char *tmpbuf = buf;
|
|
|
|
size_t len_in = strlen(input), len_out = sizeof(buf);
|
|
|
|
|
|
|
|
while(len_in > 0) {
|
2011-08-06 21:05:04 -04:00
|
|
|
ssize_t written = swrite(conn->ntlm_auth_hlpr_socket, input, len_in);
|
2011-07-18 17:36:36 -04:00
|
|
|
if(written == -1) {
|
|
|
|
/* Interrupted by a signal, retry it */
|
|
|
|
if(errno == EINTR)
|
|
|
|
continue;
|
|
|
|
/* write failed if other errors happen */
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
input += written;
|
|
|
|
len_in -= written;
|
|
|
|
}
|
|
|
|
/* Read one line */
|
|
|
|
while(len_out > 0) {
|
2011-08-06 21:05:04 -04:00
|
|
|
size = sread(conn->ntlm_auth_hlpr_socket, tmpbuf, len_out);
|
2011-07-18 17:36:36 -04:00
|
|
|
if(size == -1) {
|
|
|
|
if(errno == EINTR)
|
|
|
|
continue;
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
else if(size == 0)
|
|
|
|
goto done;
|
|
|
|
else if(tmpbuf[size - 1] == '\n') {
|
|
|
|
tmpbuf[size - 1] = '\0';
|
|
|
|
goto wrfinish;
|
|
|
|
}
|
|
|
|
tmpbuf += size;
|
|
|
|
len_out -= size;
|
|
|
|
}
|
|
|
|
goto done;
|
|
|
|
wrfinish:
|
|
|
|
/* Samba/winbind installed but not configured */
|
|
|
|
if(state == NTLMSTATE_TYPE1 &&
|
|
|
|
size == 3 &&
|
|
|
|
buf[0] == 'P' && buf[1] == 'W')
|
|
|
|
return CURLE_REMOTE_ACCESS_DENIED;
|
|
|
|
/* invalid response */
|
|
|
|
if(size < 4)
|
|
|
|
goto done;
|
|
|
|
if(state == NTLMSTATE_TYPE1 &&
|
|
|
|
(buf[0]!='Y' || buf[1]!='R' || buf[2]!=' '))
|
|
|
|
goto done;
|
|
|
|
if(state == NTLMSTATE_TYPE2 &&
|
|
|
|
(buf[0]!='K' || buf[1]!='K' || buf[2]!=' ') &&
|
|
|
|
(buf[0]!='A' || buf[1]!='F' || buf[2]!=' '))
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
conn->response_header = aprintf("NTLM %.*s", size - 4, buf + 3);
|
|
|
|
return CURLE_OK;
|
|
|
|
done:
|
|
|
|
return CURLE_REMOTE_ACCESS_DENIED;
|
|
|
|
}
|
|
|
|
|
2011-08-12 13:51:50 -04:00
|
|
|
/*
|
|
|
|
* This is for creating ntlm header output by delegating challenge/response
|
|
|
|
* to a Samba's daemon helper ntlm_auth
|
|
|
|
*/
|
2011-07-18 17:36:36 -04:00
|
|
|
CURLcode Curl_output_ntlm_sso(struct connectdata *conn,
|
|
|
|
bool proxy)
|
|
|
|
{
|
|
|
|
/* point to the address of the pointer that holds the string to sent to the
|
|
|
|
server, which is for a plain host or for a HTTP proxy */
|
|
|
|
char **allocuserpwd;
|
|
|
|
/* point to the name and password for this */
|
|
|
|
const char *userp;
|
|
|
|
/* point to the correct struct with this */
|
|
|
|
struct ntlmdata *ntlm;
|
|
|
|
struct auth *authp;
|
|
|
|
|
|
|
|
CURLcode res = CURLE_OK;
|
|
|
|
char *input;
|
|
|
|
|
|
|
|
DEBUGASSERT(conn);
|
|
|
|
DEBUGASSERT(conn->data);
|
|
|
|
|
|
|
|
if(proxy) {
|
|
|
|
allocuserpwd = &conn->allocptr.proxyuserpwd;
|
|
|
|
userp = conn->proxyuser;
|
|
|
|
ntlm = &conn->proxyntlm;
|
|
|
|
authp = &conn->data->state.authproxy;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
allocuserpwd = &conn->allocptr.userpwd;
|
|
|
|
userp = conn->user;
|
|
|
|
ntlm = &conn->ntlm;
|
|
|
|
authp = &conn->data->state.authhost;
|
|
|
|
}
|
|
|
|
authp->done = FALSE;
|
|
|
|
|
|
|
|
/* not set means empty */
|
|
|
|
if(!userp)
|
|
|
|
userp="";
|
|
|
|
|
|
|
|
switch(ntlm->state) {
|
|
|
|
case NTLMSTATE_TYPE1:
|
|
|
|
default:
|
|
|
|
/* Use Samba's 'winbind' daemon to support NTLM single-sign-on,
|
|
|
|
* by delegating the NTLM challenge/response protocal to a helper
|
|
|
|
* in ntlm_auth.
|
|
|
|
* http://devel.squid-cache.org/ntlm/squid_helper_protocol.html
|
|
|
|
* http://www.samba.org/samba/docs/man/manpages-3/winbindd.8.html
|
|
|
|
* http://www.samba.org/samba/docs/man/manpages-3/ntlm_auth.1.html
|
2011-07-31 14:44:41 -04:00
|
|
|
* Preprocessor symbol 'WINBIND_NTLM_AUTH_ENABLED' is defined when
|
|
|
|
* this feature is enabled and 'WINBIND_NTLM_AUTH_FILE' symbol holds
|
|
|
|
* absolute filename of ntlm_auth helper.
|
2011-07-18 17:36:36 -04:00
|
|
|
* If NTLM single-sign-on fails, go back to original request
|
|
|
|
* handling process.
|
|
|
|
*/
|
|
|
|
/* Create communication with ntlm_auth */
|
|
|
|
res = sso_ntlm_initiate(conn, userp);
|
|
|
|
if(res)
|
|
|
|
return res;
|
|
|
|
res = sso_ntlm_response(conn, "YR\n", ntlm->state);
|
|
|
|
if(res)
|
|
|
|
return res;
|
|
|
|
|
|
|
|
Curl_safefree(*allocuserpwd);
|
|
|
|
*allocuserpwd = aprintf("%sAuthorization: %s\r\n",
|
2011-08-12 13:51:50 -04:00
|
|
|
proxy ? "Proxy-" : "",
|
2011-07-18 17:36:36 -04:00
|
|
|
conn->response_header);
|
|
|
|
DEBUG_OUT(fprintf(stderr, "**** Header %s\n ", *allocuserpwd));
|
|
|
|
Curl_safefree(conn->response_header);
|
|
|
|
conn->response_header = NULL;
|
|
|
|
break;
|
|
|
|
case NTLMSTATE_TYPE2:
|
2011-07-28 15:41:44 -04:00
|
|
|
input = aprintf("TT %s", conn->challenge_header);
|
2011-07-27 21:07:02 -04:00
|
|
|
if(!input)
|
|
|
|
return CURLE_OUT_OF_MEMORY;
|
2011-07-18 17:36:36 -04:00
|
|
|
res = sso_ntlm_response(conn,
|
|
|
|
input,
|
|
|
|
ntlm->state);
|
2011-07-27 21:07:02 -04:00
|
|
|
free(input);
|
|
|
|
input = NULL;
|
2011-07-18 17:36:36 -04:00
|
|
|
if(res)
|
|
|
|
return res;
|
|
|
|
|
|
|
|
Curl_safefree(*allocuserpwd);
|
|
|
|
*allocuserpwd = aprintf("%sAuthorization: %s\r\n",
|
2011-08-12 13:51:50 -04:00
|
|
|
proxy ? "Proxy-" : "",
|
2011-07-18 17:36:36 -04:00
|
|
|
conn->response_header);
|
|
|
|
DEBUG_OUT(fprintf(stderr, "**** %s\n ", *allocuserpwd));
|
|
|
|
ntlm->state = NTLMSTATE_TYPE3; /* we sent a type-3 */
|
|
|
|
authp->done = TRUE;
|
|
|
|
sso_ntlm_close(conn);
|
|
|
|
break;
|
|
|
|
case NTLMSTATE_TYPE3:
|
|
|
|
/* connection is already authenticated,
|
|
|
|
* don't send a header in future requests */
|
|
|
|
if(*allocuserpwd) {
|
|
|
|
free(*allocuserpwd);
|
|
|
|
*allocuserpwd=NULL;
|
|
|
|
}
|
|
|
|
authp->done = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return CURLE_OK;
|
|
|
|
}
|
2011-07-31 14:44:41 -04:00
|
|
|
#endif /* WINBIND_NTLM_AUTH_ENABLED */
|
2011-07-18 17:36:36 -04:00
|
|
|
|
2011-08-12 13:51:50 -04:00
|
|
|
/*
|
|
|
|
* This is for creating ntlm header output
|
|
|
|
*/
|
2003-07-21 09:16:01 -04:00
|
|
|
CURLcode Curl_output_ntlm(struct connectdata *conn,
|
2004-03-30 01:39:24 -05:00
|
|
|
bool proxy)
|
2003-06-11 09:38:55 -04:00
|
|
|
{
|
2011-08-14 10:36:47 -04:00
|
|
|
size_t size = 0;
|
2011-08-09 16:53:48 -04:00
|
|
|
char *base64 = NULL;
|
2011-08-12 13:51:50 -04:00
|
|
|
unsigned char ntlmbuf[NTLM_BUFSIZE];
|
http NTLM: split http_ntlm.[ch] between http_ntlm.[ch] and curl_ntlm.[ch]
For modularity purposes, huge chunks of NTLM existing code is transformed into
functions to allow future internal code reuse.
Resulting three new libcurl private functions:
- Curl_ntlm_create_type1_message()
- Curl_ntlm_create_type3_message()
- Curl_ntlm_decode_type2_message()
Changing static ntlm_sspi_cleanup() into non-static Curl_ntlm_sspi_cleanup()
This 'refactoring' has been prepared by previous commits to allow that this
specific one does not introduce any change to existing code. All existing
goodness and badness previous to this commit should remain the same once it is
applied, the only difference should be that existing code is moved into
functions.
Given the quite big portions of code being moved around, and the importance of
change traceability, this commit has been done in such a way that it is
possible to perform a three-way diff from initial http_ntlm.[ch] to resulting
http_ntlm.[ch] and curl_ntlm.[ch] to actually verify that no functional change
is introduced here.
Notice that Steve Holme has provided several patches, but these included this
refactoring along with 'extra' fixes. I really wanted this 'clean' refactoring
done first, in order to allow discussion or committing of 'extra' fixes on a
case by case basis, so, I had to bite the bullet ;-)
Comments, line adjustments, compiler warning fixes, whatever, may follow
afterwards.
2011-08-14 09:45:19 -04:00
|
|
|
CURLcode res;
|
2003-07-21 09:16:01 -04:00
|
|
|
|
|
|
|
/* point to the address of the pointer that holds the string to sent to the
|
|
|
|
server, which is for a plain host or for a HTTP proxy */
|
|
|
|
char **allocuserpwd;
|
|
|
|
|
|
|
|
/* point to the name and password for this */
|
2008-09-02 13:41:20 -04:00
|
|
|
const char *userp;
|
|
|
|
const char *passwdp;
|
2011-08-09 16:53:48 -04:00
|
|
|
|
2003-07-22 05:59:36 -04:00
|
|
|
/* point to the correct struct with this */
|
|
|
|
struct ntlmdata *ntlm;
|
2004-05-04 03:52:53 -04:00
|
|
|
struct auth *authp;
|
2003-07-21 09:16:01 -04:00
|
|
|
|
2007-02-21 14:03:20 -05:00
|
|
|
DEBUGASSERT(conn);
|
|
|
|
DEBUGASSERT(conn->data);
|
2011-08-12 13:51:50 -04:00
|
|
|
|
2010-06-26 21:38:01 -04:00
|
|
|
#ifdef USE_NSS
|
|
|
|
if(CURLE_OK != Curl_nss_force_init(conn->data))
|
|
|
|
return CURLE_OUT_OF_MEMORY;
|
|
|
|
#endif
|
|
|
|
|
2003-07-21 09:16:01 -04:00
|
|
|
if(proxy) {
|
|
|
|
allocuserpwd = &conn->allocptr.proxyuserpwd;
|
|
|
|
userp = conn->proxyuser;
|
|
|
|
passwdp = conn->proxypasswd;
|
2003-07-22 05:59:36 -04:00
|
|
|
ntlm = &conn->proxyntlm;
|
2004-05-04 03:52:53 -04:00
|
|
|
authp = &conn->data->state.authproxy;
|
2003-07-21 09:16:01 -04:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
allocuserpwd = &conn->allocptr.userpwd;
|
|
|
|
userp = conn->user;
|
|
|
|
passwdp = conn->passwd;
|
2003-07-22 05:59:36 -04:00
|
|
|
ntlm = &conn->ntlm;
|
2004-05-04 03:52:53 -04:00
|
|
|
authp = &conn->data->state.authhost;
|
2003-07-21 09:16:01 -04:00
|
|
|
}
|
2004-05-04 03:52:53 -04:00
|
|
|
authp->done = FALSE;
|
2003-09-04 09:31:49 -04:00
|
|
|
|
2003-10-17 05:29:06 -04:00
|
|
|
/* not set means empty */
|
|
|
|
if(!userp)
|
2011-08-09 16:53:48 -04:00
|
|
|
userp = "";
|
2003-10-17 05:29:06 -04:00
|
|
|
|
|
|
|
if(!passwdp)
|
2011-08-09 16:53:48 -04:00
|
|
|
passwdp = "";
|
2004-05-25 07:13:49 -04:00
|
|
|
|
2005-11-08 09:15:34 -05:00
|
|
|
#ifdef USE_WINDOWS_SSPI
|
2011-04-20 09:17:42 -04:00
|
|
|
if(s_hSecDll == NULL) {
|
2008-08-11 16:29:36 -04:00
|
|
|
/* not thread safe and leaks - use curl_global_init() to avoid */
|
2009-01-29 15:32:27 -05:00
|
|
|
CURLcode err = Curl_sspi_global_init();
|
2011-04-20 09:17:42 -04:00
|
|
|
if(s_hSecDll == NULL)
|
2008-08-11 16:29:36 -04:00
|
|
|
return err;
|
2005-11-08 09:15:34 -05:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2003-07-22 05:59:36 -04:00
|
|
|
switch(ntlm->state) {
|
2003-06-26 07:26:26 -04:00
|
|
|
case NTLMSTATE_TYPE1:
|
|
|
|
default: /* for the weird cases we (re)start here */
|
2011-08-10 20:18:16 -04:00
|
|
|
|
2011-08-12 13:51:50 -04:00
|
|
|
/* Create a type-1 message */
|
2005-03-10 18:15:29 -05:00
|
|
|
|
http NTLM: split http_ntlm.[ch] between http_ntlm.[ch] and curl_ntlm.[ch]
For modularity purposes, huge chunks of NTLM existing code is transformed into
functions to allow future internal code reuse.
Resulting three new libcurl private functions:
- Curl_ntlm_create_type1_message()
- Curl_ntlm_create_type3_message()
- Curl_ntlm_decode_type2_message()
Changing static ntlm_sspi_cleanup() into non-static Curl_ntlm_sspi_cleanup()
This 'refactoring' has been prepared by previous commits to allow that this
specific one does not introduce any change to existing code. All existing
goodness and badness previous to this commit should remain the same once it is
applied, the only difference should be that existing code is moved into
functions.
Given the quite big portions of code being moved around, and the importance of
change traceability, this commit has been done in such a way that it is
possible to perform a three-way diff from initial http_ntlm.[ch] to resulting
http_ntlm.[ch] and curl_ntlm.[ch] to actually verify that no functional change
is introduced here.
Notice that Steve Holme has provided several patches, but these included this
refactoring along with 'extra' fixes. I really wanted this 'clean' refactoring
done first, in order to allow discussion or committing of 'extra' fixes on a
case by case basis, so, I had to bite the bullet ;-)
Comments, line adjustments, compiler warning fixes, whatever, may follow
afterwards.
2011-08-14 09:45:19 -04:00
|
|
|
res = Curl_ntlm_create_type1_message(userp, passwdp,
|
|
|
|
ntlm, ntlmbuf, &size);
|
2005-03-10 18:15:29 -05:00
|
|
|
|
http NTLM: split http_ntlm.[ch] between http_ntlm.[ch] and curl_ntlm.[ch]
For modularity purposes, huge chunks of NTLM existing code is transformed into
functions to allow future internal code reuse.
Resulting three new libcurl private functions:
- Curl_ntlm_create_type1_message()
- Curl_ntlm_create_type3_message()
- Curl_ntlm_decode_type2_message()
Changing static ntlm_sspi_cleanup() into non-static Curl_ntlm_sspi_cleanup()
This 'refactoring' has been prepared by previous commits to allow that this
specific one does not introduce any change to existing code. All existing
goodness and badness previous to this commit should remain the same once it is
applied, the only difference should be that existing code is moved into
functions.
Given the quite big portions of code being moved around, and the importance of
change traceability, this commit has been done in such a way that it is
possible to perform a three-way diff from initial http_ntlm.[ch] to resulting
http_ntlm.[ch] and curl_ntlm.[ch] to actually verify that no functional change
is introduced here.
Notice that Steve Holme has provided several patches, but these included this
refactoring along with 'extra' fixes. I really wanted this 'clean' refactoring
done first, in order to allow discussion or committing of 'extra' fixes on a
case by case basis, so, I had to bite the bullet ;-)
Comments, line adjustments, compiler warning fixes, whatever, may follow
afterwards.
2011-08-14 09:45:19 -04:00
|
|
|
if(CURLE_OK == res) {
|
|
|
|
/* now size is the size of the base64 encoded package size */
|
|
|
|
size = Curl_base64_encode(NULL, (char *)ntlmbuf, size, &base64);
|
2005-03-10 18:15:29 -05:00
|
|
|
|
http NTLM: split http_ntlm.[ch] between http_ntlm.[ch] and curl_ntlm.[ch]
For modularity purposes, huge chunks of NTLM existing code is transformed into
functions to allow future internal code reuse.
Resulting three new libcurl private functions:
- Curl_ntlm_create_type1_message()
- Curl_ntlm_create_type3_message()
- Curl_ntlm_decode_type2_message()
Changing static ntlm_sspi_cleanup() into non-static Curl_ntlm_sspi_cleanup()
This 'refactoring' has been prepared by previous commits to allow that this
specific one does not introduce any change to existing code. All existing
goodness and badness previous to this commit should remain the same once it is
applied, the only difference should be that existing code is moved into
functions.
Given the quite big portions of code being moved around, and the importance of
change traceability, this commit has been done in such a way that it is
possible to perform a three-way diff from initial http_ntlm.[ch] to resulting
http_ntlm.[ch] and curl_ntlm.[ch] to actually verify that no functional change
is introduced here.
Notice that Steve Holme has provided several patches, but these included this
refactoring along with 'extra' fixes. I really wanted this 'clean' refactoring
done first, in order to allow discussion or committing of 'extra' fixes on a
case by case basis, so, I had to bite the bullet ;-)
Comments, line adjustments, compiler warning fixes, whatever, may follow
afterwards.
2011-08-14 09:45:19 -04:00
|
|
|
if(size > 0) {
|
|
|
|
Curl_safefree(*allocuserpwd);
|
|
|
|
*allocuserpwd = aprintf("%sAuthorization: NTLM %s\r\n",
|
|
|
|
proxy ? "Proxy-" : "",
|
|
|
|
base64);
|
|
|
|
DEBUG_OUT(fprintf(stderr, "**** Header %s\n ", *allocuserpwd));
|
|
|
|
free(base64);
|
|
|
|
}
|
2003-06-11 09:38:55 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
return CURLE_OUT_OF_MEMORY; /* FIX TODO */
|
2003-06-11 12:14:45 -04:00
|
|
|
|
2003-06-26 07:26:26 -04:00
|
|
|
break;
|
2004-05-25 07:13:49 -04:00
|
|
|
|
2003-06-26 07:26:26 -04:00
|
|
|
case NTLMSTATE_TYPE2:
|
2011-08-12 13:51:50 -04:00
|
|
|
/* We already received the type-2 message, create a type-3 message */
|
2005-03-10 18:15:29 -05:00
|
|
|
|
http NTLM: split http_ntlm.[ch] between http_ntlm.[ch] and curl_ntlm.[ch]
For modularity purposes, huge chunks of NTLM existing code is transformed into
functions to allow future internal code reuse.
Resulting three new libcurl private functions:
- Curl_ntlm_create_type1_message()
- Curl_ntlm_create_type3_message()
- Curl_ntlm_decode_type2_message()
Changing static ntlm_sspi_cleanup() into non-static Curl_ntlm_sspi_cleanup()
This 'refactoring' has been prepared by previous commits to allow that this
specific one does not introduce any change to existing code. All existing
goodness and badness previous to this commit should remain the same once it is
applied, the only difference should be that existing code is moved into
functions.
Given the quite big portions of code being moved around, and the importance of
change traceability, this commit has been done in such a way that it is
possible to perform a three-way diff from initial http_ntlm.[ch] to resulting
http_ntlm.[ch] and curl_ntlm.[ch] to actually verify that no functional change
is introduced here.
Notice that Steve Holme has provided several patches, but these included this
refactoring along with 'extra' fixes. I really wanted this 'clean' refactoring
done first, in order to allow discussion or committing of 'extra' fixes on a
case by case basis, so, I had to bite the bullet ;-)
Comments, line adjustments, compiler warning fixes, whatever, may follow
afterwards.
2011-08-14 09:45:19 -04:00
|
|
|
res = Curl_ntlm_create_type3_message(conn->data, userp, passwdp,
|
|
|
|
ntlm, ntlmbuf, &size);
|
2011-08-09 16:53:48 -04:00
|
|
|
|
http NTLM: split http_ntlm.[ch] between http_ntlm.[ch] and curl_ntlm.[ch]
For modularity purposes, huge chunks of NTLM existing code is transformed into
functions to allow future internal code reuse.
Resulting three new libcurl private functions:
- Curl_ntlm_create_type1_message()
- Curl_ntlm_create_type3_message()
- Curl_ntlm_decode_type2_message()
Changing static ntlm_sspi_cleanup() into non-static Curl_ntlm_sspi_cleanup()
This 'refactoring' has been prepared by previous commits to allow that this
specific one does not introduce any change to existing code. All existing
goodness and badness previous to this commit should remain the same once it is
applied, the only difference should be that existing code is moved into
functions.
Given the quite big portions of code being moved around, and the importance of
change traceability, this commit has been done in such a way that it is
possible to perform a three-way diff from initial http_ntlm.[ch] to resulting
http_ntlm.[ch] and curl_ntlm.[ch] to actually verify that no functional change
is introduced here.
Notice that Steve Holme has provided several patches, but these included this
refactoring along with 'extra' fixes. I really wanted this 'clean' refactoring
done first, in order to allow discussion or committing of 'extra' fixes on a
case by case basis, so, I had to bite the bullet ;-)
Comments, line adjustments, compiler warning fixes, whatever, may follow
afterwards.
2011-08-14 09:45:19 -04:00
|
|
|
if(CURLE_OK == res) {
|
|
|
|
/* convert the binary blob into base64 */
|
|
|
|
size = Curl_base64_encode(NULL, (char *)ntlmbuf, size, &base64);
|
2003-07-15 18:58:36 -04:00
|
|
|
|
http NTLM: split http_ntlm.[ch] between http_ntlm.[ch] and curl_ntlm.[ch]
For modularity purposes, huge chunks of NTLM existing code is transformed into
functions to allow future internal code reuse.
Resulting three new libcurl private functions:
- Curl_ntlm_create_type1_message()
- Curl_ntlm_create_type3_message()
- Curl_ntlm_decode_type2_message()
Changing static ntlm_sspi_cleanup() into non-static Curl_ntlm_sspi_cleanup()
This 'refactoring' has been prepared by previous commits to allow that this
specific one does not introduce any change to existing code. All existing
goodness and badness previous to this commit should remain the same once it is
applied, the only difference should be that existing code is moved into
functions.
Given the quite big portions of code being moved around, and the importance of
change traceability, this commit has been done in such a way that it is
possible to perform a three-way diff from initial http_ntlm.[ch] to resulting
http_ntlm.[ch] and curl_ntlm.[ch] to actually verify that no functional change
is introduced here.
Notice that Steve Holme has provided several patches, but these included this
refactoring along with 'extra' fixes. I really wanted this 'clean' refactoring
done first, in order to allow discussion or committing of 'extra' fixes on a
case by case basis, so, I had to bite the bullet ;-)
Comments, line adjustments, compiler warning fixes, whatever, may follow
afterwards.
2011-08-14 09:45:19 -04:00
|
|
|
if(size > 0) {
|
|
|
|
Curl_safefree(*allocuserpwd);
|
|
|
|
*allocuserpwd = aprintf("%sAuthorization: NTLM %s\r\n",
|
|
|
|
proxy ? "Proxy-" : "",
|
|
|
|
base64);
|
|
|
|
DEBUG_OUT(fprintf(stderr, "**** %s\n ", *allocuserpwd));
|
|
|
|
free(base64);
|
|
|
|
}
|
2003-06-11 09:38:55 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
return CURLE_OUT_OF_MEMORY; /* FIX TODO */
|
|
|
|
|
2003-07-22 05:59:36 -04:00
|
|
|
ntlm->state = NTLMSTATE_TYPE3; /* we sent a type-3 */
|
2004-05-04 03:52:53 -04:00
|
|
|
authp->done = TRUE;
|
http NTLM: split http_ntlm.[ch] between http_ntlm.[ch] and curl_ntlm.[ch]
For modularity purposes, huge chunks of NTLM existing code is transformed into
functions to allow future internal code reuse.
Resulting three new libcurl private functions:
- Curl_ntlm_create_type1_message()
- Curl_ntlm_create_type3_message()
- Curl_ntlm_decode_type2_message()
Changing static ntlm_sspi_cleanup() into non-static Curl_ntlm_sspi_cleanup()
This 'refactoring' has been prepared by previous commits to allow that this
specific one does not introduce any change to existing code. All existing
goodness and badness previous to this commit should remain the same once it is
applied, the only difference should be that existing code is moved into
functions.
Given the quite big portions of code being moved around, and the importance of
change traceability, this commit has been done in such a way that it is
possible to perform a three-way diff from initial http_ntlm.[ch] to resulting
http_ntlm.[ch] and curl_ntlm.[ch] to actually verify that no functional change
is introduced here.
Notice that Steve Holme has provided several patches, but these included this
refactoring along with 'extra' fixes. I really wanted this 'clean' refactoring
done first, in order to allow discussion or committing of 'extra' fixes on a
case by case basis, so, I had to bite the bullet ;-)
Comments, line adjustments, compiler warning fixes, whatever, may follow
afterwards.
2011-08-14 09:45:19 -04:00
|
|
|
|
2011-08-12 13:51:50 -04:00
|
|
|
break;
|
2003-06-26 07:26:26 -04:00
|
|
|
|
|
|
|
case NTLMSTATE_TYPE3:
|
|
|
|
/* connection is already authenticated,
|
|
|
|
* don't send a header in future requests */
|
2003-07-21 09:16:01 -04:00
|
|
|
if(*allocuserpwd) {
|
|
|
|
free(*allocuserpwd);
|
2011-08-10 20:18:16 -04:00
|
|
|
*allocuserpwd = NULL;
|
2003-06-26 07:26:26 -04:00
|
|
|
}
|
2004-05-04 03:52:53 -04:00
|
|
|
authp->done = TRUE;
|
2003-06-26 07:26:26 -04:00
|
|
|
break;
|
2003-06-11 09:38:55 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return CURLE_OK;
|
|
|
|
}
|
2005-03-10 18:15:29 -05:00
|
|
|
|
2011-08-09 16:53:48 -04:00
|
|
|
void Curl_http_ntlm_cleanup(struct connectdata *conn)
|
2005-03-10 18:15:29 -05:00
|
|
|
{
|
|
|
|
#ifdef USE_WINDOWS_SSPI
|
http NTLM: split http_ntlm.[ch] between http_ntlm.[ch] and curl_ntlm.[ch]
For modularity purposes, huge chunks of NTLM existing code is transformed into
functions to allow future internal code reuse.
Resulting three new libcurl private functions:
- Curl_ntlm_create_type1_message()
- Curl_ntlm_create_type3_message()
- Curl_ntlm_decode_type2_message()
Changing static ntlm_sspi_cleanup() into non-static Curl_ntlm_sspi_cleanup()
This 'refactoring' has been prepared by previous commits to allow that this
specific one does not introduce any change to existing code. All existing
goodness and badness previous to this commit should remain the same once it is
applied, the only difference should be that existing code is moved into
functions.
Given the quite big portions of code being moved around, and the importance of
change traceability, this commit has been done in such a way that it is
possible to perform a three-way diff from initial http_ntlm.[ch] to resulting
http_ntlm.[ch] and curl_ntlm.[ch] to actually verify that no functional change
is introduced here.
Notice that Steve Holme has provided several patches, but these included this
refactoring along with 'extra' fixes. I really wanted this 'clean' refactoring
done first, in order to allow discussion or committing of 'extra' fixes on a
case by case basis, so, I had to bite the bullet ;-)
Comments, line adjustments, compiler warning fixes, whatever, may follow
afterwards.
2011-08-14 09:45:19 -04:00
|
|
|
Curl_ntlm_sspi_cleanup(&conn->ntlm);
|
|
|
|
Curl_ntlm_sspi_cleanup(&conn->proxyntlm);
|
2011-08-09 16:56:17 -04:00
|
|
|
#elif defined(WINBIND_NTLM_AUTH_ENABLED)
|
2011-07-18 17:36:36 -04:00
|
|
|
sso_ntlm_close(conn);
|
2011-08-09 16:56:17 -04:00
|
|
|
#else
|
2008-08-11 16:29:36 -04:00
|
|
|
(void)conn;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2005-04-07 11:27:13 -04:00
|
|
|
#endif /* USE_NTLM */
|
2003-06-11 09:38:55 -04:00
|
|
|
#endif /* !CURL_DISABLE_HTTP */
|