char *header) /* rest of the www-authenticate:
header */
{
- struct SessionHandle *data=conn->data;
-
/* skip initial whitespaces */
while(*header && isspace((int)*header))
header++;
int size = Curl_base64_decode(header, buffer);
- data->state.ntlm.state = NTLMSTATE_TYPE2; /* we got a type-2 */
+ conn->ntlm.state = NTLMSTATE_TYPE2; /* we got a type-2 */
if(size >= 48)
/* the nonce of interest is index [24 .. 31], 8 bytes */
- memcpy(data->state.ntlm.nonce, &buffer[24], 8);
+ memcpy(conn->ntlm.nonce, &buffer[24], 8);
/* at index decimal 20, there's a 32bit NTLM flag field */
}
else {
- if(data->state.ntlm.state >= NTLMSTATE_TYPE1)
+ if(conn->ntlm.state >= NTLMSTATE_TYPE1)
return CURLNTLM_BAD;
- data->state.ntlm.state = NTLMSTATE_TYPE1; /* we should sent away a
+ conn->ntlm.state = NTLMSTATE_TYPE1; /* we should sent away a
type-1 */
}
}
char *base64=NULL;
unsigned char ntlm[256]; /* enough, unless the host/domain is very long */
- switch(data->state.ntlm.state) {
+ switch(conn->ntlm.state) {
case NTLMSTATE_TYPE1:
default: /* for the weird cases we (re)start here */
hostoff = 32;
user = data->state.user;
userlen = strlen(user);
- mkhash(data->state.passwd, &data->state.ntlm.nonce[0], lmresp
+ mkhash(data->state.passwd, &conn->ntlm.nonce[0], lmresp
#ifdef USE_NTRESPONSES
, ntresp
#endif
else
return CURLE_OUT_OF_MEMORY; /* FIX TODO */
- data->state.ntlm.state = NTLMSTATE_TYPE3; /* we sent a type-3 */
+ conn->ntlm.state = NTLMSTATE_TYPE3; /* we sent a type-3 */
}
break;
curl_read_callback fread; /* function that reads the input */
void *fread_in; /* pointer to pass to the fread() above */
+ struct ntlmdata ntlm; /* NTLM differs from other authentication schemes
+ because it authenticates connections, not
+ single requests! */
};
/* The end of connectdata. */
is always set TRUE when curl_easy_perform() is called. */
struct digestdata digest;
- struct ntlmdata ntlm;
#ifdef GSSAPI
struct negotiatedata negotiate;