bool proxy)
{
char *base64 = NULL;
+ size_t len = 0;
CURLcode error;
/* point to the address of the pointer that holds the string to send to the
case NTLMSTATE_TYPE1:
default: /* for the weird cases we (re)start here */
/* Create a type-1 message */
- error = Curl_ntlm_create_type1_message(userp, passwdp, ntlm, &base64);
+ error = Curl_ntlm_create_type1_message(userp, passwdp, ntlm, &base64,
+ &len);
+
if(error)
return error;
case NTLMSTATE_TYPE2:
/* We already received the type-2 message, create a type-3 message */
error = Curl_ntlm_create_type3_message(conn->data, userp, passwdp,
- ntlm, &base64);
+ ntlm, &base64, &len);
if(error)
return error;
* ntlm [in/out] - The ntlm data struct being used and modified.
* outptr [in/out] - The adress where a pointer to newly allocated memory
* holding the result will be stored upon completion.
+ * outlen [out] - The length of the output message.
*
* Returns CURLE_OK on success.
*/
CURLcode Curl_ntlm_create_type1_message(const char *userp,
const char *passwdp,
struct ntlmdata *ntlm,
- char **outptr)
+ char **outptr,
+ size_t *outlen)
{
/* NTLM type-1 message structure:
*/
unsigned char ntlmbuf[NTLM_BUFSIZE];
- size_t base64_sz = 0;
size_t size;
#ifdef USE_WINDOWS_SSPI
});
/* Return with binary blob encoded into base64 */
- return Curl_base64_encode(NULL, (char *)ntlmbuf, size, outptr, &base64_sz);
+ return Curl_base64_encode(NULL, (char *)ntlmbuf, size, outptr, outlen);
}
/*
* ntlm [in/out] - The ntlm data struct being used and modified.
* outptr [in/out] - The adress where a pointer to newly allocated memory
* holding the result will be stored upon completion.
+ * outlen [out] - The length of the output message.
*
* Returns CURLE_OK on success.
*/
const char *userp,
const char *passwdp,
struct ntlmdata *ntlm,
- char **outptr)
+ char **outptr,
+ size_t *outlen)
{
/* NTLM type-3 message structure:
*/
unsigned char ntlmbuf[NTLM_BUFSIZE];
- size_t base64_sz = 0;
size_t size;
#ifdef USE_WINDOWS_SSPI
#endif
/* Return with binary blob encoded into base64 */
- return Curl_base64_encode(NULL, (char *)ntlmbuf, size, outptr, &base64_sz);
+ return Curl_base64_encode(NULL, (char *)ntlmbuf, size, outptr, outlen);
}
#endif /* USE_NTLM */
CURLcode Curl_ntlm_create_type1_message(const char *userp,
const char *passwdp,
struct ntlmdata *ntlm,
- char **outptr);
+ char **outptr,
+ size_t *outlen);
/* This is to generate a base64 encoded NTLM type-3 message */
CURLcode Curl_ntlm_create_type3_message(struct SessionHandle *data,
const char *userp,
const char *passwdp,
struct ntlmdata *ntlm,
- char **outptr);
+ char **outptr,
+ size_t *outlen);
/* This is to decode a NTLM type-2 message */
CURLcode Curl_ntlm_decode_type2_message(struct SessionHandle *data,