]> granicus.if.org Git - curl/commitdiff
sasl_gssapi: Added Curl_sasl_build_gssapi_spn() function
authorSteve Holme <steve_holme@hotmail.com>
Wed, 3 Dec 2014 18:38:43 +0000 (18:38 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Wed, 3 Dec 2014 18:36:48 +0000 (18:36 +0000)
Added helper function for returning a GSS-API compatible SPN.

lib/curl_sasl_gssapi.c

index 24a2f452e5dba36998b66bc7abab2b69c24df5a4..096729fef97f92a935b10b7cfddbc70a1658fe51 100644 (file)
 #include "curl_sasl.h"
 #include "urldata.h"
 
+#define _MPRINTF_REPLACE /* use our functions only */
+#include <curl/mprintf.h>
+
 /* The last #include file should be: */
 #include "memdebug.h"
 
+/*
+* Curl_sasl_build_gssapi_spn()
+*
+* This is used to build a SPN string in the format service@host.
+*
+* Parameters:
+*
+* serivce  [in] - The service type such as www, smtp, pop or imap.
+* host     [in] - The host name or realm.
+*
+* Returns a pointer to the newly allocated SPN.
+*/
+static char *Curl_sasl_build_gssapi_spn(const char *service, const char *host)
+{
+  /* Generate and return our SPN */
+  return aprintf("%s@%s", service, host);
+}
+
 /*
  * Curl_sasl_create_gssapi_user_message()
  *