aboutsummaryrefslogtreecommitdiff
path: root/lib/curl_sasl_sspi.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2015-09-12 11:48:24 +0100
committerSteve Holme <steve_holme@hotmail.com>2016-03-25 09:12:01 +0000
commit685fee3828b0b22f5a3ca9c8debd92dfecec751f (patch)
treea8c25105f04a74c4f8fb267bddb2f321f995c28b /lib/curl_sasl_sspi.c
parent709991d548225f4dd512687ae7bc8af8a0f8f2c6 (diff)
vauth: Moved Curl_sasl_build_spn() to create the initial vauth source files
Diffstat (limited to 'lib/curl_sasl_sspi.c')
-rw-r--r--lib/curl_sasl_sspi.c46
1 files changed, 1 insertions, 45 deletions
diff --git a/lib/curl_sasl_sspi.c b/lib/curl_sasl_sspi.c
index f46376cc4..bdb1ea6d9 100644
--- a/lib/curl_sasl_sspi.c
+++ b/lib/curl_sasl_sspi.c
@@ -33,6 +33,7 @@
#include <curl/curl.h>
#include "curl_sasl.h"
+#include "vauth/vauth.h"
#include "urldata.h"
#include "curl_base64.h"
#include "warnless.h"
@@ -46,51 +47,6 @@
#include "curl_memory.h"
#include "memdebug.h"
-/*
- * Curl_sasl_build_spn()
- *
- * This is used to build a SPN string in the format service/instance.
- *
- * Parameters:
- *
- * serivce [in] - The service type such as www, smtp, pop or imap.
- * instance [in] - The host name or realm.
- *
- * Returns a pointer to the newly allocated SPN.
- */
-TCHAR *Curl_sasl_build_spn(const char *service, const char *instance)
-{
- char *utf8_spn = NULL;
- TCHAR *tchar_spn = NULL;
-
- /* Note: We could use DsMakeSPN() or DsClientMakeSpnForTargetServer() rather
- than doing this ourselves but the first is only available in Windows XP
- and Windows Server 2003 and the latter is only available in Windows 2000
- but not Windows95/98/ME or Windows NT4.0 unless the Active Directory
- Client Extensions are installed. As such it is far simpler for us to
- formulate the SPN instead. */
-
- /* Allocate our UTF8 based SPN */
- utf8_spn = aprintf("%s/%s", service, instance);
- if(!utf8_spn) {
- return NULL;
- }
-
- /* Allocate our TCHAR based SPN */
- tchar_spn = Curl_convert_UTF8_to_tchar(utf8_spn);
- if(!tchar_spn) {
- free(utf8_spn);
-
- return NULL;
- }
-
- /* Release the UTF8 variant when operating with Unicode */
- Curl_unicodefree(utf8_spn);
-
- /* Return our newly allocated SPN */
- return tchar_spn;
-}
-
#if !defined(CURL_DISABLE_CRYPTO_AUTH)
/*
* Curl_sasl_create_digest_md5_message()