]> granicus.if.org Git - curl/commitdiff
curl_sasl.c: More code policing
authorSteve Holme <steve_holme@hotmail.com>
Mon, 2 Feb 2015 16:44:00 +0000 (16:44 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Mon, 2 Feb 2015 16:50:39 +0000 (16:50 +0000)
Better use of 80 character line limit, comment corrections and line
spacing preferences.

lib/curl_sasl.c

index c6b95a6c9671a013065ac96cf037c9d3f24e20db..4591edb276d53e3a0b287fd88597c31a26d9a124 100644 (file)
@@ -1313,8 +1313,8 @@ void Curl_sasl_init(struct SASL *sasl, const struct SASLproto *params)
  *
  * This is the ONLY way to change SASL state!
  */
-static void state(struct SASL *sasl,
-                  struct connectdata *conn, saslstate newstate)
+static void state(struct SASL *sasl, struct connectdata *conn,
+                  saslstate newstate)
 {
 #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS)
   /* for debug purposes */
@@ -1353,14 +1353,15 @@ static void state(struct SASL *sasl,
  *
  * Check if we have enough auth data and capabilities to authenticate.
  */
-
 bool Curl_sasl_can_authenticate(struct SASL *sasl, struct connectdata *conn)
 {
+  /* Have credentials been provided? */
   if(conn->bits.user_passwd)
-    return TRUE;        /* Credentials provided */
+    return TRUE;
 
+  /* EXTERNAL can authenticate without a user name and/or password */
   if(sasl->authmechs & sasl->prefmech & SASL_MECH_EXTERNAL)
-    return TRUE;        /* Can authenticate without password */
+    return TRUE;
 
   return FALSE;
 }
@@ -1478,6 +1479,7 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
       Curl_safefree(resp);
       resp = NULL;
     }
+
     if(mech) {
       result = sasl->params->sendauth(conn, mech, resp);
       if(!result) {
@@ -1573,15 +1575,14 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn,
   case SASL_NTLM:
     /* Create the type-1 message */
     result = Curl_sasl_create_ntlm_type1_message(conn->user, conn->passwd,
-                                                 &conn->ntlm,
-                                                 &resp, &len);
+                                                 &conn->ntlm, &resp, &len);
     newstate = SASL_NTLM_TYPE2MSG;
     break;
   case SASL_NTLM_TYPE2MSG:
     /* Decode the type-2 message */
     sasl->params->getmessage(data->state.buffer, &serverdata);
-    result = Curl_sasl_decode_ntlm_type2_message(data,
-                                                 serverdata, &conn->ntlm);
+    result = Curl_sasl_decode_ntlm_type2_message(data, serverdata,
+                                                 &conn->ntlm);
     if(!result)
       result = Curl_sasl_create_ntlm_type3_message(data, conn->user,
                                                    conn->passwd, &conn->ntlm,