*
* 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 */
*
* 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;
}
Curl_safefree(resp);
resp = NULL;
}
+
if(mech) {
result = sasl->params->sendauth(conn, mech, resp);
if(!result) {
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,