Lines Matching refs:sasl

145 CURLcode Curl_sasl_parse_url_auth_option(struct SASL *sasl,  in Curl_sasl_parse_url_auth_option()  argument
154 if(sasl->resetprefs) { in Curl_sasl_parse_url_auth_option()
155 sasl->resetprefs = FALSE; in Curl_sasl_parse_url_auth_option()
156 sasl->prefmech = SASL_AUTH_NONE; in Curl_sasl_parse_url_auth_option()
160 sasl->prefmech = SASL_AUTH_DEFAULT; in Curl_sasl_parse_url_auth_option()
164 sasl->prefmech |= mechbit; in Curl_sasl_parse_url_auth_option()
177 void Curl_sasl_init(struct SASL *sasl, const struct SASLproto *params) in Curl_sasl_init() argument
179 sasl->params = params; /* Set protocol dependent parameters */ in Curl_sasl_init()
180 sasl->state = SASL_STOP; /* Not yet running */ in Curl_sasl_init()
181 sasl->authmechs = SASL_AUTH_NONE; /* No known authentication mechanism yet */ in Curl_sasl_init()
182 sasl->prefmech = SASL_AUTH_DEFAULT; /* Prefer all mechanisms */ in Curl_sasl_init()
183 sasl->authused = SASL_AUTH_NONE; /* No the authentication mechanism used */ in Curl_sasl_init()
184 sasl->resetprefs = TRUE; /* Reset prefmech upon AUTH parsing. */ in Curl_sasl_init()
185 sasl->mutual_auth = FALSE; /* No mutual authentication (GSSAPI only) */ in Curl_sasl_init()
186 sasl->force_ir = FALSE; /* Respect external option */ in Curl_sasl_init()
194 static void state(struct SASL *sasl, struct connectdata *conn, in state() argument
220 if(sasl->state != newstate) in state()
222 (void *)sasl, names[sasl->state], names[newstate]); in state()
227 sasl->state = newstate; in state()
235 bool Curl_sasl_can_authenticate(struct SASL *sasl, struct connectdata *conn) in Curl_sasl_can_authenticate() argument
242 if(sasl->authmechs & sasl->prefmech & SASL_MECH_EXTERNAL) in Curl_sasl_can_authenticate()
253 CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn, in Curl_sasl_start() argument
270 sasl->params->service; in Curl_sasl_start()
273 sasl->force_ir = force_ir; /* Latch for future use */ in Curl_sasl_start()
274 sasl->authused = 0; /* No mechanism used yet */ in Curl_sasl_start()
275 enabledmechs = sasl->authmechs & sasl->prefmech; in Curl_sasl_start()
283 sasl->authused = SASL_MECH_EXTERNAL; in Curl_sasl_start()
293 sasl->mutual_auth = FALSE; /* TODO: Calculate mutual authentication */ in Curl_sasl_start()
297 sasl->authused = SASL_MECH_GSSAPI; in Curl_sasl_start()
304 sasl->mutual_auth, in Curl_sasl_start()
315 sasl->authused = SASL_MECH_DIGEST_MD5; in Curl_sasl_start()
320 sasl->authused = SASL_MECH_CRAM_MD5; in Curl_sasl_start()
329 sasl->authused = SASL_MECH_NTLM; in Curl_sasl_start()
345 sasl->authused = SASL_MECH_OAUTHBEARER; in Curl_sasl_start()
357 sasl->authused = SASL_MECH_XOAUTH2; in Curl_sasl_start()
368 sasl->authused = SASL_MECH_PLAIN; in Curl_sasl_start()
378 sasl->authused = SASL_MECH_LOGIN; in Curl_sasl_start()
386 if(resp && sasl->params->maxirlen && in Curl_sasl_start()
387 strlen(mech) + len > sasl->params->maxirlen) { in Curl_sasl_start()
392 result = sasl->params->sendauth(conn, mech, resp); in Curl_sasl_start()
395 state(sasl, conn, resp ? state2 : state1); in Curl_sasl_start()
409 CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn, in Curl_sasl_continue() argument
427 sasl->params->service; in Curl_sasl_continue()
434 if(sasl->state == SASL_FINAL) { in Curl_sasl_continue()
435 if(code != sasl->params->finalcode) in Curl_sasl_continue()
438 state(sasl, conn, SASL_STOP); in Curl_sasl_continue()
442 if(sasl->state != SASL_CANCEL && sasl->state != SASL_OAUTH2_RESP && in Curl_sasl_continue()
443 code != sasl->params->contcode) { in Curl_sasl_continue()
445 state(sasl, conn, SASL_STOP); in Curl_sasl_continue()
449 switch(sasl->state) { in Curl_sasl_continue()
471 sasl->params->getmessage(data->state.buffer, &serverdata); in Curl_sasl_continue()
479 sasl->params->getmessage(data->state.buffer, &serverdata); in Curl_sasl_continue()
504 sasl->params->getmessage(data->state.buffer, &serverdata); in Curl_sasl_continue()
520 sasl->mutual_auth, NULL, in Curl_sasl_continue()
526 sasl->params->getmessage(data->state.buffer, &serverdata); in Curl_sasl_continue()
527 if(sasl->mutual_auth) { in Curl_sasl_continue()
532 sasl->mutual_auth, in Curl_sasl_continue()
544 sasl->params->getmessage(data->state.buffer, &serverdata); in Curl_sasl_continue()
554 if(sasl->authused == SASL_MECH_OAUTHBEARER) { in Curl_sasl_continue()
573 if(code == sasl->params->finalcode) { in Curl_sasl_continue()
576 state(sasl, conn, SASL_STOP); in Curl_sasl_continue()
579 else if(code == sasl->params->contcode) { in Curl_sasl_continue()
589 state(sasl, conn, SASL_STOP); in Curl_sasl_continue()
595 sasl->authmechs ^= sasl->authused; in Curl_sasl_continue()
598 result = Curl_sasl_start(sasl, conn, sasl->force_ir, progress); in Curl_sasl_continue()
599 newstate = sasl->state; /* Use state from Curl_sasl_start() */ in Curl_sasl_continue()
610 result = sasl->params->sendcont(conn, "*"); in Curl_sasl_continue()
615 result = sasl->params->sendcont(conn, resp); in Curl_sasl_continue()
625 state(sasl, conn, newstate); in Curl_sasl_continue()