summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2016-03-20 11:56:07 +0000
committerSteve Holme <steve_holme@hotmail.com>2016-08-18 20:31:20 +0100
commita0f212946b1e839a673973930034b98031f1507c (patch)
tree176a18d51867ce716a224b607ca82f8752ba5b5f
parentcdd61dc35fc093f6e78da0168070a09f45becf5c (diff)
downloadgnurl-a0f212946b1e839a673973930034b98031f1507c.tar.gz
gnurl-a0f212946b1e839a673973930034b98031f1507c.tar.bz2
gnurl-a0f212946b1e839a673973930034b98031f1507c.zip
vauth: Introduced Curl_auth_is_<mechansism>_supported() functions
As Windows SSPI authentication calls fail when a particular mechanism isn't available, introduced these functions for DIGEST, NTLM, Kerberos 5 and Negotiate to allow both HTTP and SASL authentication the opportunity to query support for a supported mechanism before selecting it. For now each function returns TRUE to maintain compatability with the existing code when called.
-rw-r--r--lib/vauth/digest.c14
-rw-r--r--lib/vauth/digest_sspi.c16
-rw-r--r--lib/vauth/krb5_gssapi.c14
-rw-r--r--lib/vauth/krb5_sspi.c16
-rw-r--r--lib/vauth/ntlm.c14
-rw-r--r--lib/vauth/ntlm_sspi.c16
-rw-r--r--lib/vauth/spnego_gssapi.c14
-rw-r--r--lib/vauth/spnego_sspi.c16
-rw-r--r--lib/vauth/vauth.h12
9 files changed, 132 insertions, 0 deletions
diff --git a/lib/vauth/digest.c b/lib/vauth/digest.c
index 26ea7b598..f4898404f 100644
--- a/lib/vauth/digest.c
+++ b/lib/vauth/digest.c
@@ -306,6 +306,20 @@ static CURLcode auth_decode_digest_md5_message(const char *chlg64,
}
/*
+ * Curl_auth_is_digest_supported()
+ *
+ * This is used to evaluate if DIGEST is supported.
+ *
+ * Parameters: None
+ *
+ * Returns TRUE as DIGEST as handled by libcurl.
+ */
+bool Curl_auth_is_digest_supported(void)
+{
+ return TRUE;
+}
+
+/*
* Curl_auth_create_digest_md5_message()
*
* This is used to generate an already encoded DIGEST-MD5 response message
diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c
index 6a7315eb5..9254385e5 100644
--- a/lib/vauth/digest_sspi.c
+++ b/lib/vauth/digest_sspi.c
@@ -44,6 +44,22 @@
#include "memdebug.h"
/*
+* Curl_auth_is_digest_supported()
+*
+* This is used to evaluate if DIGEST is supported.
+*
+* Parameters: None
+*
+* Returns TRUE if DIGEST is supported by Windows SSPI.
+*/
+bool Curl_auth_is_digest_supported(void)
+{
+ /* TODO: Return true for now which maintains compatability with the existing
+ code */
+ return TRUE;
+}
+
+/*
* Curl_auth_create_digest_md5_message()
*
* This is used to generate an already encoded DIGEST-MD5 response message
diff --git a/lib/vauth/krb5_gssapi.c b/lib/vauth/krb5_gssapi.c
index 31c8c7da4..c754fae45 100644
--- a/lib/vauth/krb5_gssapi.c
+++ b/lib/vauth/krb5_gssapi.c
@@ -42,6 +42,20 @@
#include "memdebug.h"
/*
+ * Curl_auth_is_gssapi_supported()
+ *
+ * This is used to evaluate if GSSAPI (Kerberos V5) is supported.
+ *
+ * Parameters: None
+ *
+ * Returns TRUE if Kerberos V5 is supported by the GSS-API library.
+ */
+bool Curl_auth_is_gssapi_supported(void)
+{
+ return TRUE;
+}
+
+/*
* Curl_auth_create_gssapi_user_message()
*
* This is used to generate an already encoded GSSAPI (Kerberos V5) user token
diff --git a/lib/vauth/krb5_sspi.c b/lib/vauth/krb5_sspi.c
index 08774f6c9..e04690046 100644
--- a/lib/vauth/krb5_sspi.c
+++ b/lib/vauth/krb5_sspi.c
@@ -40,6 +40,22 @@
#include "memdebug.h"
/*
+ * Curl_auth_is_gssapi_supported()
+ *
+ * This is used to evaluate if GSSAPI (Kerberos V5) is supported.
+ *
+ * Parameters: None
+ *
+ * Returns TRUE if Kerberos V5 is supported by Windows SSPI.
+ */
+bool Curl_auth_is_gssapi_supported(void)
+{
+ /* TODO: Return true for now which maintains compatability with the existing
+ code */
+ return TRUE;
+}
+
+/*
* Curl_auth_create_gssapi_user_message()
*
* This is used to generate an already encoded GSSAPI (Kerberos V5) user token
diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c
index c85fe4298..b484a011a 100644
--- a/lib/vauth/ntlm.c
+++ b/lib/vauth/ntlm.c
@@ -217,6 +217,20 @@ static CURLcode ntlm_decode_type2_target(struct Curl_easy *data,
*/
/*
+ * Curl_auth_is_ntlm_supported()
+ *
+ * This is used to evaluate if NTLM is supported.
+ *
+ * Parameters: None
+ *
+ * Returns TRUE as NTLM as handled by libcurl.
+ */
+bool Curl_auth_is_ntlm_supported(void)
+{
+ return TRUE;
+}
+
+/*
* Curl_auth_decode_ntlm_type2_message()
*
* This is used to decode an already encoded NTLM type-2 message. The message
diff --git a/lib/vauth/ntlm_sspi.c b/lib/vauth/ntlm_sspi.c
index 982a9d378..6f446780e 100644
--- a/lib/vauth/ntlm_sspi.c
+++ b/lib/vauth/ntlm_sspi.c
@@ -38,6 +38,22 @@
#include "memdebug.h"
/*
+ * Curl_auth_is_ntlm_supported()
+ *
+ * This is used to evaluate if NTLM is supported.
+ *
+ * Parameters: None
+ *
+ * Returns TRUE if NTLM is supported by Windows SSPI.
+ */
+bool Curl_auth_is_ntlm_supported(void)
+{
+ /* TODO: Return true for now which maintains compatability with the existing
+ code */
+ return TRUE;
+}
+
+/*
* Curl_auth_create_ntlm_type1_message()
*
* This is used to generate an already encoded NTLM type-1 message ready for
diff --git a/lib/vauth/spnego_gssapi.c b/lib/vauth/spnego_gssapi.c
index b256ee616..8840db8fd 100644
--- a/lib/vauth/spnego_gssapi.c
+++ b/lib/vauth/spnego_gssapi.c
@@ -41,6 +41,20 @@
#include "memdebug.h"
/*
+ * Curl_auth_is_spnego_supported()
+ *
+ * This is used to evaluate if SPNEGO (Negotiate) is supported.
+ *
+ * Parameters: None
+ *
+ * Returns TRUE if Negotiate supported by the GSS-API library.
+ */
+bool Curl_auth_is_spnego_supported(void)
+{
+ return TRUE;
+}
+
+/*
* Curl_auth_decode_spnego_message()
*
* This is used to decode an already encoded SPNEGO (Negotiate) challenge
diff --git a/lib/vauth/spnego_sspi.c b/lib/vauth/spnego_sspi.c
index b6176ece1..1222a654d 100644
--- a/lib/vauth/spnego_sspi.c
+++ b/lib/vauth/spnego_sspi.c
@@ -40,6 +40,22 @@
#include "memdebug.h"
/*
+ * Curl_auth_is_spnego_supported()
+ *
+ * This is used to evaluate if SPNEGO (Negotiate) is supported.
+ *
+ * Parameters: None
+ *
+ * Returns TRUE if Negotiate is supported by Windows SSPI.
+ */
+bool Curl_auth_is_spnego_supported(void)
+{
+ /* TODO: Return true for now which maintains compatability with the existing
+ code */
+ return TRUE;
+}
+
+/*
* Curl_auth_decode_spnego_message()
*
* This is used to decode an already encoded SPNEGO (Negotiate) challenge
diff --git a/lib/vauth/vauth.h b/lib/vauth/vauth.h
index 38806ee73..3ad2139f9 100644
--- a/lib/vauth/vauth.h
+++ b/lib/vauth/vauth.h
@@ -83,6 +83,9 @@ CURLcode Curl_auth_create_cram_md5_message(struct Curl_easy *data,
const char *passwdp,
char **outptr, size_t *outlen);
+/* This is used to evaluate if DIGEST is supported */
+bool Curl_auth_is_digest_supported(void);
+
/* This is used to generate a base64 encoded DIGEST-MD5 response message */
CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
const char *chlg64,
@@ -109,6 +112,9 @@ void Curl_auth_digest_cleanup(struct digestdata *digest);
#endif /* !CURL_DISABLE_CRYPTO_AUTH */
#if defined(USE_NTLM)
+/* This is used to evaluate if NTLM is supported */
+bool Curl_auth_is_ntlm_supported(void);
+
/* This is used to generate a base64 encoded NTLM type-1 message */
CURLcode Curl_auth_create_ntlm_type1_message(const char *userp,
const char *passwdp,
@@ -140,6 +146,9 @@ CURLcode Curl_auth_create_oauth_bearer_message(struct Curl_easy *data,
const char *bearer,
char **outptr, size_t *outlen);
#if defined(USE_KERBEROS5)
+/* This is used to evaluate if GSSAPI (Kerberos V5) is supported */
+bool Curl_auth_is_gssapi_supported(void);
+
/* This is used to generate a base64 encoded GSSAPI (Kerberos V5) user token
message */
CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data,
@@ -165,6 +174,9 @@ void Curl_auth_gssapi_cleanup(struct kerberos5data *krb5);
#endif /* USE_KERBEROS5 */
#if defined(USE_SPNEGO)
+/* This is used to evaluate if SPNEGO (Negotiate) is supported */
+bool Curl_auth_is_spnego_supported(void);
+
/* This is used to decode a base64 encoded SPNEGO (Negotiate) challenge
message */
CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,