Loading lib/curl_sasl.c +10 −11 Original line number Original line Diff line number Diff line Loading @@ -92,12 +92,7 @@ const struct { #endif #endif #if !defined(CURL_DISABLE_CRYPTO_AUTH) #if !defined(CURL_DISABLE_CRYPTO_AUTH) /* bool Curl_sasl_digest_get_pair(const char *str, char *value, char *content, * Returns 0 on success and then the buffers are filled in fine. * * Non-zero means failure to parse. */ int Curl_sasl_digest_get_pair(const char *str, char *value, char *content, const char **endptr) const char **endptr) { { int c; int c; Loading @@ -110,7 +105,7 @@ int Curl_sasl_digest_get_pair(const char *str, char *value, char *content, if('=' != *str++) if('=' != *str++) /* eek, no match */ /* eek, no match */ return 1; return FALSE; if('\"' == *str) { if('\"' == *str) { /* this starts with a quote so it must end with one as well! */ /* this starts with a quote so it must end with one as well! */ Loading @@ -129,6 +124,7 @@ int Curl_sasl_digest_get_pair(const char *str, char *value, char *content, continue; continue; } } break; break; case ',': case ',': if(!starts_with_quote) { if(!starts_with_quote) { /* this signals the end of the content if we didn't get a starting /* this signals the end of the content if we didn't get a starting Loading @@ -137,11 +133,13 @@ int Curl_sasl_digest_get_pair(const char *str, char *value, char *content, continue; continue; } } break; break; case '\r': case '\r': case '\n': case '\n': /* end of string */ /* end of string */ c = 0; c = 0; continue; continue; case '\"': case '\"': if(!escape && starts_with_quote) { if(!escape && starts_with_quote) { /* end of string */ /* end of string */ Loading @@ -150,14 +148,15 @@ int Curl_sasl_digest_get_pair(const char *str, char *value, char *content, } } break; break; } } escape = FALSE; escape = FALSE; *content++ = *str; *content++ = *str; } } *content = 0; *content = 0; *endptr = str; *endptr = str; return 0; /* all is fine! */ return TRUE; } } #endif #endif Loading Loading @@ -780,7 +779,7 @@ CURLcode Curl_sasl_decode_digest_http_message(const char *chlg, chlg++; chlg++; /* Extract a value=content pair */ /* Extract a value=content pair */ if(!Curl_sasl_digest_get_pair(chlg, value, content, &chlg)) { if(Curl_sasl_digest_get_pair(chlg, value, content, &chlg)) { if(Curl_raw_equal(value, "nonce")) { if(Curl_raw_equal(value, "nonce")) { free(digest->nonce); free(digest->nonce); digest->nonce = strdup(content); digest->nonce = strdup(content); Loading lib/curl_sasl.h +3 −3 Original line number Original line Diff line number Diff line Loading @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____| * * * Copyright (C) 2012 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 2012 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * * * This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms Loading Loading @@ -149,7 +149,7 @@ char *Curl_sasl_build_gssapi_spn(const char *service, const char *instance); #ifndef CURL_DISABLE_CRYPTO_AUTH #ifndef CURL_DISABLE_CRYPTO_AUTH /* This is used to extract the realm from a challenge message */ /* This is used to extract the realm from a challenge message */ int Curl_sasl_digest_get_pair(const char *str, char *value, char *content, bool Curl_sasl_digest_get_pair(const char *str, char *value, char *content, const char **endptr); const char **endptr); /* This is used to generate a base64 encoded DIGEST-MD5 response message */ /* This is used to generate a base64 encoded DIGEST-MD5 response message */ Loading lib/curl_sasl_sspi.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -304,7 +304,7 @@ CURLcode Curl_override_sspi_http_realm(const char *chlg, chlg++; chlg++; /* Extract a value=content pair */ /* Extract a value=content pair */ if(!Curl_sasl_digest_get_pair(chlg, value, content, &chlg)) { if(Curl_sasl_digest_get_pair(chlg, value, content, &chlg)) { if(Curl_raw_equal(value, "realm")) { if(Curl_raw_equal(value, "realm")) { /* Setup identity's domain and length */ /* Setup identity's domain and length */ Loading Loading
lib/curl_sasl.c +10 −11 Original line number Original line Diff line number Diff line Loading @@ -92,12 +92,7 @@ const struct { #endif #endif #if !defined(CURL_DISABLE_CRYPTO_AUTH) #if !defined(CURL_DISABLE_CRYPTO_AUTH) /* bool Curl_sasl_digest_get_pair(const char *str, char *value, char *content, * Returns 0 on success and then the buffers are filled in fine. * * Non-zero means failure to parse. */ int Curl_sasl_digest_get_pair(const char *str, char *value, char *content, const char **endptr) const char **endptr) { { int c; int c; Loading @@ -110,7 +105,7 @@ int Curl_sasl_digest_get_pair(const char *str, char *value, char *content, if('=' != *str++) if('=' != *str++) /* eek, no match */ /* eek, no match */ return 1; return FALSE; if('\"' == *str) { if('\"' == *str) { /* this starts with a quote so it must end with one as well! */ /* this starts with a quote so it must end with one as well! */ Loading @@ -129,6 +124,7 @@ int Curl_sasl_digest_get_pair(const char *str, char *value, char *content, continue; continue; } } break; break; case ',': case ',': if(!starts_with_quote) { if(!starts_with_quote) { /* this signals the end of the content if we didn't get a starting /* this signals the end of the content if we didn't get a starting Loading @@ -137,11 +133,13 @@ int Curl_sasl_digest_get_pair(const char *str, char *value, char *content, continue; continue; } } break; break; case '\r': case '\r': case '\n': case '\n': /* end of string */ /* end of string */ c = 0; c = 0; continue; continue; case '\"': case '\"': if(!escape && starts_with_quote) { if(!escape && starts_with_quote) { /* end of string */ /* end of string */ Loading @@ -150,14 +148,15 @@ int Curl_sasl_digest_get_pair(const char *str, char *value, char *content, } } break; break; } } escape = FALSE; escape = FALSE; *content++ = *str; *content++ = *str; } } *content = 0; *content = 0; *endptr = str; *endptr = str; return 0; /* all is fine! */ return TRUE; } } #endif #endif Loading Loading @@ -780,7 +779,7 @@ CURLcode Curl_sasl_decode_digest_http_message(const char *chlg, chlg++; chlg++; /* Extract a value=content pair */ /* Extract a value=content pair */ if(!Curl_sasl_digest_get_pair(chlg, value, content, &chlg)) { if(Curl_sasl_digest_get_pair(chlg, value, content, &chlg)) { if(Curl_raw_equal(value, "nonce")) { if(Curl_raw_equal(value, "nonce")) { free(digest->nonce); free(digest->nonce); digest->nonce = strdup(content); digest->nonce = strdup(content); Loading
lib/curl_sasl.h +3 −3 Original line number Original line Diff line number Diff line Loading @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____| * * * Copyright (C) 2012 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 2012 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * * * This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms Loading Loading @@ -149,7 +149,7 @@ char *Curl_sasl_build_gssapi_spn(const char *service, const char *instance); #ifndef CURL_DISABLE_CRYPTO_AUTH #ifndef CURL_DISABLE_CRYPTO_AUTH /* This is used to extract the realm from a challenge message */ /* This is used to extract the realm from a challenge message */ int Curl_sasl_digest_get_pair(const char *str, char *value, char *content, bool Curl_sasl_digest_get_pair(const char *str, char *value, char *content, const char **endptr); const char **endptr); /* This is used to generate a base64 encoded DIGEST-MD5 response message */ /* This is used to generate a base64 encoded DIGEST-MD5 response message */ Loading
lib/curl_sasl_sspi.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -304,7 +304,7 @@ CURLcode Curl_override_sspi_http_realm(const char *chlg, chlg++; chlg++; /* Extract a value=content pair */ /* Extract a value=content pair */ if(!Curl_sasl_digest_get_pair(chlg, value, content, &chlg)) { if(Curl_sasl_digest_get_pair(chlg, value, content, &chlg)) { if(Curl_raw_equal(value, "realm")) { if(Curl_raw_equal(value, "realm")) { /* Setup identity's domain and length */ /* Setup identity's domain and length */ Loading