From 59f3f92ba6150e9a5a57f71b6e781802148916d0 Mon Sep 17 00:00:00 2001 From: Grant Pannell Date: Sun, 26 Apr 2015 16:12:23 +0200 Subject: 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 --- lib/curl_sasl.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib/curl_sasl.c') 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) -- cgit v1.2.3