1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

oauth2: Re-factored OAuth 2.0 state variable

This commit is contained in:
Steve Holme 2015-09-05 17:32:37 +01:00
parent d6d58dd558
commit 88702ebb31
2 changed files with 4 additions and 4 deletions

View File

@ -1344,7 +1344,7 @@ static void state(struct SASL *sasl, struct connectdata *conn,
"GSSAPI", "GSSAPI",
"GSSAPI_TOKEN", "GSSAPI_TOKEN",
"GSSAPI_NO_DATA", "GSSAPI_NO_DATA",
"XOAUTH2", "OAUTH2",
"CANCEL", "CANCEL",
"FINAL", "FINAL",
/* LAST */ /* LAST */
@ -1458,7 +1458,7 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
if((enabledmechs & SASL_MECH_XOAUTH2) && ((conn->oauth_bearer) || if((enabledmechs & SASL_MECH_XOAUTH2) && ((conn->oauth_bearer) ||
(!conn->passwd))) { (!conn->passwd))) {
mech = SASL_MECH_STRING_XOAUTH2; mech = SASL_MECH_STRING_XOAUTH2;
state1 = SASL_XOAUTH2; state1 = SASL_OAUTH2;
sasl->authused = SASL_MECH_XOAUTH2; sasl->authused = SASL_MECH_XOAUTH2;
if(force_ir || data->set.sasl_ir) if(force_ir || data->set.sasl_ir)
@ -1640,7 +1640,7 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn,
break; break;
#endif #endif
case SASL_XOAUTH2: case SASL_OAUTH2:
/* Create the authorisation message */ /* Create the authorisation message */
result = sasl_create_oauth_bearer_message(data, conn->user, result = sasl_create_oauth_bearer_message(data, conn->user,
NULL, 0, NULL, 0,

View File

@ -90,7 +90,7 @@ typedef enum {
SASL_GSSAPI, SASL_GSSAPI,
SASL_GSSAPI_TOKEN, SASL_GSSAPI_TOKEN,
SASL_GSSAPI_NO_DATA, SASL_GSSAPI_NO_DATA,
SASL_XOAUTH2, SASL_OAUTH2,
SASL_CANCEL, SASL_CANCEL,
SASL_FINAL SASL_FINAL
} saslstate; } saslstate;