diff options
author | Steve Holme <steve_holme@hotmail.com> | 2015-02-02 16:44:00 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2015-02-02 16:50:39 +0000 |
commit | 0a7182f6ad1e1a7d585d8b05c9939ae9f143fcad (patch) | |
tree | 5aefb4dfd41bc2565fd0ac381219708d5312043b | |
parent | ae9963776a4ee736e15e274c243f136276baf0b8 (diff) |
curl_sasl.c: More code policing
Better use of 80 character line limit, comment corrections and line
spacing preferences.
-rw-r--r-- | lib/curl_sasl.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index c6b95a6c9..4591edb27 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -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, |