diff options
author | Steve Holme <steve_holme@hotmail.com> | 2011-10-01 13:03:40 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2011-10-03 23:28:17 +0200 |
commit | 185ed3409a883d32f7b6d41e20fddd5b04d98a7d (patch) | |
tree | 622943a9c6ad4bc76de857e963298dce012ce80b /lib/curl_ntlm_msgs.c | |
parent | d54bcebad49b395b183455133e3e1fc8537826d2 (diff) |
Curl_ntlm_create_typeX_message: Added the outlen parameter
Added the output message length as a parameter to both
Curl_ntlm_create_type1_message() and Curl_ntlm_create_type3_message()
for use by future functions that require it.
Updated curl_ntlm.c to cater for the extra parameter on these two
functions.
Diffstat (limited to 'lib/curl_ntlm_msgs.c')
-rw-r--r-- | lib/curl_ntlm_msgs.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/curl_ntlm_msgs.c b/lib/curl_ntlm_msgs.c index c67fdb2cf..23dbb7e18 100644 --- a/lib/curl_ntlm_msgs.c +++ b/lib/curl_ntlm_msgs.c @@ -354,13 +354,15 @@ static void unicodecpy(unsigned char *dest, * 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: @@ -377,7 +379,6 @@ CURLcode Curl_ntlm_create_type1_message(const char *userp, */ unsigned char ntlmbuf[NTLM_BUFSIZE]; - size_t base64_sz = 0; size_t size; #ifdef USE_WINDOWS_SSPI @@ -556,7 +557,7 @@ CURLcode Curl_ntlm_create_type1_message(const char *userp, }); /* 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); } /* @@ -574,6 +575,7 @@ CURLcode Curl_ntlm_create_type1_message(const char *userp, * 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. */ @@ -581,7 +583,8 @@ 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) { /* NTLM type-3 message structure: @@ -602,7 +605,6 @@ CURLcode Curl_ntlm_create_type3_message(struct SessionHandle *data, */ unsigned char ntlmbuf[NTLM_BUFSIZE]; - size_t base64_sz = 0; size_t size; #ifdef USE_WINDOWS_SSPI @@ -950,7 +952,7 @@ CURLcode Curl_ntlm_create_type3_message(struct SessionHandle *data, #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 */ |