aboutsummaryrefslogtreecommitdiff
path: root/lib/curl_sasl.h
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-08-09 16:26:58 +0100
committerSteve Holme <steve_holme@hotmail.com>2014-08-09 16:40:24 +0100
commit1b69122810462cff569eb0929230961aa356bae0 (patch)
treeec25943700e724163629d40ae322f7c05d5a1b85 /lib/curl_sasl.h
parente9b4a96975e24ad75167e367d64f33daee887dcd (diff)
sasl: Introduced Curl_sasl_build_spn() for building a SPN
Various parts of the libcurl source code build a SPN for inclusion in authentication data. This information is either used by our own native generation routines or passed to authentication functions in third-party libraries such as SSPI. However, some of these instances use fixed buffers rather than dynamically allocated ones and not all of those that should, convert to wide character strings in Unicode builds. Implemented a common function that generates a SPN and performs the wide character conversion where necessary.
Diffstat (limited to 'lib/curl_sasl.h')
-rw-r--r--lib/curl_sasl.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/curl_sasl.h b/lib/curl_sasl.h
index d2967b0f3..fe7c471ce 100644
--- a/lib/curl_sasl.h
+++ b/lib/curl_sasl.h
@@ -57,6 +57,13 @@ struct ntlmdata;
(wordlen == (sizeof(mech) - 1) / sizeof(char) && \
!memcmp(line, mech, wordlen))
+/* This is used to build a SPN string */
+#if !defined(USE_WINDOWS_SSPI)
+char *Curl_sasl_build_spn(const char *service, const char *instance);
+#else
+TCHAR *Curl_sasl_build_spn(const char *service, const char *instance);
+#endif
+
/* This is used to generate a base64 encoded PLAIN authentication message */
CURLcode Curl_sasl_create_plain_message(struct SessionHandle *data,
const char *userp,