aboutsummaryrefslogtreecommitdiff
path: root/lib/curl_sasl.c
diff options
context:
space:
mode:
authorGrant Pannell <grant@pannell.net.au>2015-04-26 16:12:23 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-04-26 16:12:23 +0200
commit59f3f92ba6150e9a5a57f71b6e781802148916d0 (patch)
tree61f20d9de4e2732a9b73f0feaf4c1938b7cf79ce /lib/curl_sasl.c
parent6a7261359b4c7ebddff0c096468047077e7d06ef (diff)
sasl_sspi: Populate domain from the realm in the challenge
Without this, SSPI based digest auth was broken. Bug: https://github.com/bagder/curl/pull/141.patch
Diffstat (limited to 'lib/curl_sasl.c')
-rw-r--r--lib/curl_sasl.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c
index d9f63ab0b..68646bc1a 100644
--- a/lib/curl_sasl.c
+++ b/lib/curl_sasl.c
@@ -76,9 +76,6 @@ const struct {
#define DIGEST_QOP_VALUE_STRING_AUTH_INT "auth-int"
#define DIGEST_QOP_VALUE_STRING_AUTH_CONF "auth-conf"
-#define DIGEST_MAX_VALUE_LENGTH 256
-#define DIGEST_MAX_CONTENT_LENGTH 1024
-
/* The CURL_OUTPUT_DIGEST_CONV macro below is for non-ASCII machines.
It converts digest text to ASCII so the MD5 will be correct for
what ultimately goes over the network.
@@ -90,13 +87,16 @@ const struct {
return result; \
}
+#endif
+
+#if !defined(CURL_DISABLE_CRYPTO_AUTH)
/*
* Returns 0 on success and then the buffers are filled in fine.
*
* Non-zero means failure to parse.
*/
-static int sasl_digest_get_pair(const char *str, char *value, char *content,
- const char **endptr)
+int Curl_sasl_digest_get_pair(const char *str, char *value, char *content,
+ const char **endptr)
{
int c;
bool starts_with_quote = FALSE;
@@ -157,7 +157,9 @@ static int sasl_digest_get_pair(const char *str, char *value, char *content,
return 0; /* all is fine! */
}
+#endif
+#if !defined(CURL_DISABLE_CRYPTO_AUTH) && !defined(USE_WINDOWS_SSPI)
/* Convert md5 chunk to RFC2617 (section 3.1.3) -suitable ascii string*/
static void sasl_digest_md5_to_ascii(unsigned char *source, /* 16 bytes */
unsigned char *dest) /* 33 bytes */
@@ -776,7 +778,7 @@ CURLcode Curl_sasl_decode_digest_http_message(const char *chlg,
chlg++;
/* Extract a value=content pair */
- if(!sasl_digest_get_pair(chlg, value, content, &chlg)) {
+ if(!Curl_sasl_digest_get_pair(chlg, value, content, &chlg)) {
if(Curl_raw_equal(value, "nonce")) {
digest->nonce = strdup(content);
if(!digest->nonce)