diff options
-rw-r--r-- | lib/curl_sasl.c | 71 |
1 files changed, 37 insertions, 34 deletions
diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index f4c901e10..347f1a302 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -280,7 +280,7 @@ char *Curl_sasl_build_spn(const char *service, const char *host) #endif /* - * create_plain_message() + * sasl_create_plain_message() * * This is used to generate an already encoded PLAIN message ready * for sending to the recipient. @@ -296,9 +296,10 @@ char *Curl_sasl_build_spn(const char *service, const char *host) * * Returns CURLE_OK on success. */ -static CURLcode create_plain_message(struct SessionHandle *data, - const char *userp, const char *passwdp, - char **outptr, size_t *outlen) +static CURLcode sasl_create_plain_message(struct SessionHandle *data, + const char *userp, + const char *passwdp, + char **outptr, size_t *outlen) { CURLcode result; char *plainauth; @@ -330,7 +331,7 @@ static CURLcode create_plain_message(struct SessionHandle *data, } /* - * create_login_message() + * sasl_create_login_message() * * This is used to generate an already encoded LOGIN message containing the * user name or password ready for sending to the recipient. @@ -345,9 +346,9 @@ static CURLcode create_plain_message(struct SessionHandle *data, * * Returns CURLE_OK on success. */ -static CURLcode create_login_message(struct SessionHandle *data, - const char *valuep, char **outptr, - size_t *outlen) +static CURLcode sasl_create_login_message(struct SessionHandle *data, + const char *valuep, char **outptr, + size_t *outlen) { size_t vlen = strlen(valuep); @@ -369,7 +370,7 @@ static CURLcode create_login_message(struct SessionHandle *data, #ifndef CURL_DISABLE_CRYPTO_AUTH /* - * decode_cram_md5_message() + * sasl_decode_cram_md5_message() * * This is used to decode an already encoded CRAM-MD5 challenge message. * @@ -382,8 +383,8 @@ static CURLcode create_login_message(struct SessionHandle *data, * * Returns CURLE_OK on success. */ -static CURLcode decode_cram_md5_message(const char *chlg64, char **outptr, - size_t *outlen) +static CURLcode sasl_decode_cram_md5_message(const char *chlg64, char **outptr, + size_t *outlen) { CURLcode result = CURLE_OK; size_t chlg64len = strlen(chlg64); @@ -399,7 +400,7 @@ static CURLcode decode_cram_md5_message(const char *chlg64, char **outptr, } /* - * create_cram_md5_message() + * sasl_create_cram_md5_message() * * This is used to generate an already encoded CRAM-MD5 response message ready * for sending to the recipient. @@ -416,11 +417,11 @@ static CURLcode decode_cram_md5_message(const char *chlg64, char **outptr, * * Returns CURLE_OK on success. */ -static CURLcode create_cram_md5_message(struct SessionHandle *data, - const char *chlg, - const char *userp, - const char *passwdp, - char **outptr, size_t *outlen) +static CURLcode sasl_create_cram_md5_message(struct SessionHandle *data, + const char *chlg, + const char *userp, + const char *passwdp, + char **outptr, size_t *outlen) { CURLcode result = CURLE_OK; size_t chlglen = 0; @@ -1128,7 +1129,7 @@ void Curl_sasl_ntlm_cleanup(struct ntlmdata *ntlm) #endif /* USE_NTLM && !USE_WINDOWS_SSPI*/ /* - * create_xoauth2_message() + * sasl_create_xoauth2_message() * * This is used to generate an already encoded OAuth 2.0 message ready for * sending to the recipient. @@ -1144,9 +1145,10 @@ void Curl_sasl_ntlm_cleanup(struct ntlmdata *ntlm) * * Returns CURLE_OK on success. */ -static CURLcode create_xoauth2_message(struct SessionHandle *data, - const char *user, const char *bearer, - char **outptr, size_t *outlen) +static CURLcode sasl_create_xoauth2_message(struct SessionHandle *data, + const char *user, + const char *bearer, + char **outptr, size_t *outlen) { CURLcode result = CURLE_OK; char *xoauth = NULL; @@ -1394,8 +1396,8 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn, sasl->authused = SASL_MECH_XOAUTH2; if(force_ir || data->set.sasl_ir) - result = create_xoauth2_message(data, conn->user, conn->xoauth2_bearer, - &resp, &len); + result = sasl_create_xoauth2_message(data, conn->user, + conn->xoauth2_bearer, &resp, &len); } else if(enabledmechs & SASL_MECH_LOGIN) { mech = SASL_MECH_STRING_LOGIN; @@ -1404,7 +1406,7 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn, sasl->authused = SASL_MECH_LOGIN; if(force_ir || data->set.sasl_ir) - result = create_login_message(data, conn->user, &resp, &len); + result = sasl_create_login_message(data, conn->user, &resp, &len); } else if(enabledmechs & SASL_MECH_PLAIN) { mech = SASL_MECH_STRING_PLAIN; @@ -1412,8 +1414,8 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn, sasl->authused = SASL_MECH_PLAIN; if(force_ir || data->set.sasl_ir) - result = create_plain_message(data, conn->user, conn->passwd, - &resp, &len); + result = sasl_create_plain_message(data, conn->user, conn->passwd, + &resp, &len); } else state2 = SASL_STOP; /* No authentication started */ @@ -1478,23 +1480,24 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn, *progress = SASL_DONE; return result; case SASL_PLAIN: - result = create_plain_message(data, conn->user, conn->passwd, &resp, &len); + result = sasl_create_plain_message(data, conn->user, conn->passwd, &resp, + &len); break; case SASL_LOGIN: - result = create_login_message(data, conn->user, &resp, &len); + result = sasl_create_login_message(data, conn->user, &resp, &len); newstate = SASL_LOGIN_PASSWD; break; case SASL_LOGIN_PASSWD: - result = create_login_message(data, conn->passwd, &resp, &len); + result = sasl_create_login_message(data, conn->passwd, &resp, &len); break; #ifndef CURL_DISABLE_CRYPTO_AUTH case SASL_CRAMMD5: sasl->params->getmessage(data->state.buffer, &serverdata); - result = decode_cram_md5_message(serverdata, &chlg, &chlglen); + result = sasl_decode_cram_md5_message(serverdata, &chlg, &chlglen); if(!result) - result = create_cram_md5_message(data, chlg, conn->user, conn->passwd, - &resp, &len); + result = sasl_create_cram_md5_message(data, chlg, conn->user, + conn->passwd, &resp, &len); Curl_safefree(chlg); break; case SASL_DIGESTMD5: @@ -1569,8 +1572,8 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn, case SASL_XOAUTH2: /* Create the authorisation message */ - result = create_xoauth2_message(data, conn->user, conn->xoauth2_bearer, - &resp, &len); + result = sasl_create_xoauth2_message(data, conn->user, + conn->xoauth2_bearer, &resp, &len); break; case SASL_CANCEL: /* Remove the offending mechanism from the supported list */ |