Commit 70100d55 authored by Steve Holme's avatar Steve Holme
Browse files

http_digest: Post SSPI support tidy up

Post tidy up to ensure commonality of code style and variable names.
parent e2828af6
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -787,7 +787,7 @@ CURLcode Curl_sasl_decode_digest_http_message(const char *chlg,

        free(tmp);

        /* Select only auth o auth-int. Otherwise, ignore */
        /* Select only auth or auth-int. Otherwise, ignore */
        if(foundAuth) {
          digest->qop = strdup(DIGEST_QOP_VALUE_STRING_AUTH);
          if(!digest->qop)
+16 −14
Original line number Diff line number Diff line
@@ -49,13 +49,15 @@ CURLcode Curl_input_digest(struct connectdata *conn,
                                                  header */
{
  struct SessionHandle *data = conn->data;
  struct digestdata *d;

  /* Point to the correct struct with this */
  struct digestdata *digest;

  if(proxy) {
    d = &data->state.proxydigest;
    digest = &data->state.proxydigest;
  }
  else {
    d = &data->state.digest;
    digest = &data->state.digest;
  }

  if(!checkprefix("Digest", header))
@@ -65,7 +67,7 @@ CURLcode Curl_input_digest(struct connectdata *conn,
  while(*header && ISSPACE(*header))
    header++;

  return Curl_sasl_decode_digest_http_message(header, d);
  return Curl_sasl_decode_digest_http_message(header, digest);
}

CURLcode Curl_output_digest(struct connectdata *conn,
@@ -90,18 +92,18 @@ CURLcode Curl_output_digest(struct connectdata *conn,
  const char *passwdp;

  /* Point to the correct struct with this */
  struct digestdata *d;
  struct digestdata *digest;
  struct auth *authp;

  if(proxy) {
    d = &data->state.proxydigest;
    digest = &data->state.proxydigest;
    allocuserpwd = &conn->allocptr.proxyuserpwd;
    userp = conn->proxyuser;
    passwdp = conn->proxypasswd;
    authp = &data->state.authproxy;
  }
  else {
    d = &data->state.digest;
    digest = &data->state.digest;
    allocuserpwd = &conn->allocptr.userpwd;
    userp = conn->user;
    passwdp = conn->passwd;
@@ -118,9 +120,9 @@ CURLcode Curl_output_digest(struct connectdata *conn,
    passwdp = "";

#if defined(USE_WINDOWS_SSPI)
  have_chlg = d->input_token ? TRUE : FALSE;
  have_chlg = digest->input_token ? TRUE : FALSE;
#else
  have_chlg = d->nonce ? TRUE : FALSE;
  have_chlg = digest->nonce ? TRUE : FALSE;
#endif

  if(!have_chlg) {
@@ -153,7 +155,7 @@ CURLcode Curl_output_digest(struct connectdata *conn,
    return CURLE_OUT_OF_MEMORY;

  result = Curl_sasl_create_digest_http_message(data, userp, passwdp, request,
                                                path, d, &response, &len);
                                                path, digest, &response, &len);
  free(path);
  if(result)
    return result;