aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2015-09-04 07:11:09 +0100
committerSteve Holme <steve_holme@hotmail.com>2015-11-09 22:25:08 +0000
commiteaa98cef8d31e40327c4db672d401578733140d2 (patch)
treed196cbefae3756d1eb845def076d62cfd4fc1041 /lib
parent4e3d39690079121e173bd0319e1fa61bc95d31a3 (diff)
oauth2: Don't use XOAUTH2 in OAuth 2.0 variables
Diffstat (limited to 'lib')
-rw-r--r--lib/curl_sasl.c7
-rw-r--r--lib/url.c6
-rw-r--r--lib/urldata.h2
3 files changed, 8 insertions, 7 deletions
diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c
index 8c97c10f1..ad3b3721f 100644
--- a/lib/curl_sasl.c
+++ b/lib/curl_sasl.c
@@ -24,6 +24,7 @@
* RFC4422 Simple Authentication and Security Layer (SASL)
* RFC4616 PLAIN authentication
* RFC6749 OAuth 2.0 Authorization Framework
+ * RFC7628 A Set of SASL Mechanisms for OAuth
* Draft LOGIN SASL Mechanism <draft-murchison-sasl-login-00.txt>
*
***************************************************************************/
@@ -1443,14 +1444,14 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
}
else
#endif
- if((enabledmechs & SASL_MECH_XOAUTH2) || conn->xoauth2_bearer) {
+ if((enabledmechs & SASL_MECH_XOAUTH2) || conn->oauth_bearer) {
mech = SASL_MECH_STRING_XOAUTH2;
state1 = SASL_XOAUTH2;
sasl->authused = SASL_MECH_XOAUTH2;
if(force_ir || data->set.sasl_ir)
result = sasl_create_xoauth2_message(data, conn->user,
- conn->xoauth2_bearer,
+ conn->oauth_bearer,
&resp, &len);
}
else if(enabledmechs & SASL_MECH_LOGIN) {
@@ -1629,7 +1630,7 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn,
case SASL_XOAUTH2:
/* Create the authorisation message */
result = sasl_create_xoauth2_message(data, conn->user,
- conn->xoauth2_bearer, &resp, &len);
+ conn->oauth_bearer, &resp, &len);
break;
case SASL_CANCEL:
/* Remove the offending mechanism from the supported list */
diff --git a/lib/url.c b/lib/url.c
index 89274f769..feb4517fc 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -2725,7 +2725,7 @@ static void conn_free(struct connectdata *conn)
Curl_safefree(conn->user);
Curl_safefree(conn->passwd);
- Curl_safefree(conn->xoauth2_bearer);
+ Curl_safefree(conn->oauth_bearer);
Curl_safefree(conn->options);
Curl_safefree(conn->proxyuser);
Curl_safefree(conn->proxypasswd);
@@ -5535,8 +5535,8 @@ static CURLcode create_conn(struct SessionHandle *data,
}
if(data->set.str[STRING_BEARER]) {
- conn->xoauth2_bearer = strdup(data->set.str[STRING_BEARER]);
- if(!conn->xoauth2_bearer) {
+ conn->oauth_bearer = strdup(data->set.str[STRING_BEARER]);
+ if(!conn->oauth_bearer) {
result = CURLE_OUT_OF_MEMORY;
goto out;
}
diff --git a/lib/urldata.h b/lib/urldata.h
index 4500623c1..fbed8f823 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -915,7 +915,7 @@ struct connectdata {
char *passwd; /* password string, allocated */
char *options; /* options string, allocated */
- char *xoauth2_bearer; /* bearer token for OAuth 2.0, allocated */
+ char *oauth_bearer; /* bearer token for OAuth 2.0, allocated */
char *proxyuser; /* proxy user name string, allocated */
char *proxypasswd; /* proxy password string, allocated */