* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
header++;
if(*header) {
- result = Curl_sasl_decode_ntlm_type2_message(conn->data, header, ntlm);
+ result = Curl_auth_decode_ntlm_type2_message(conn->data, header, ntlm);
if(result)
return result;
case NTLMSTATE_TYPE1:
default: /* for the weird cases we (re)start here */
/* Create a type-1 message */
- result = Curl_sasl_create_ntlm_type1_message(userp, passwdp, ntlm, &base64,
+ result = Curl_auth_create_ntlm_type1_message(userp, passwdp, ntlm, &base64,
&len);
if(result)
return result;
case NTLMSTATE_TYPE2:
/* We already received the type-2 message, create a type-3 message */
- result = Curl_sasl_create_ntlm_type3_message(conn->data, userp, passwdp,
+ result = Curl_auth_create_ntlm_type3_message(conn->data, userp, passwdp,
ntlm, &base64, &len);
if(result)
return result;
void Curl_http_ntlm_cleanup(struct connectdata *conn)
{
- Curl_sasl_ntlm_cleanup(&conn->ntlm);
- Curl_sasl_ntlm_cleanup(&conn->proxyntlm);
+ Curl_auth_ntlm_cleanup(&conn->ntlm);
+ Curl_auth_ntlm_cleanup(&conn->proxyntlm);
#if defined(NTLM_WB_ENABLED)
Curl_ntlm_wb_cleanup(conn);
#if defined(USE_KERBEROS5)
/* Cleanup the gssapi structure */
if(authused == SASL_MECH_GSSAPI) {
- Curl_sasl_gssapi_cleanup(&conn->krb5);
+ Curl_auth_gssapi_cleanup(&conn->krb5);
}
#endif
#if defined(USE_NTLM)
/* Cleanup the NTLM structure */
if(authused == SASL_MECH_NTLM) {
- Curl_sasl_ntlm_cleanup(&conn->ntlm);
+ Curl_auth_ntlm_cleanup(&conn->ntlm);
}
#endif
sasl->authused = SASL_MECH_EXTERNAL;
if(force_ir || data->set.sasl_ir)
- result = sasl_create_external_message(data, conn->user, &resp, &len);
+ result = Curl_auth_create_external_message(data, conn->user, &resp,
+ &len);
}
else if(conn->bits.user_passwd) {
#if defined(USE_KERBEROS5)
sasl->authused = SASL_MECH_GSSAPI;
if(force_ir || data->set.sasl_ir)
- result = Curl_sasl_create_gssapi_user_message(data, conn->user,
+ result = Curl_auth_create_gssapi_user_message(data, conn->user,
conn->passwd,
sasl->params->service,
sasl->mutual_auth,
sasl->authused = SASL_MECH_NTLM;
if(force_ir || data->set.sasl_ir)
- result = Curl_sasl_create_ntlm_type1_message(conn->user, conn->passwd,
+ result = Curl_auth_create_ntlm_type1_message(conn->user, conn->passwd,
&conn->ntlm, &resp, &len);
}
else
sasl->authused = SASL_MECH_OAUTHBEARER;
if(force_ir || data->set.sasl_ir)
- result = sasl_create_oauth_bearer_message(data, conn->user,
- conn->host.name,
- conn->port,
- conn->oauth_bearer,
- &resp, &len);
+ result = Curl_auth_create_oauth_bearer_message(data, conn->user,
+ conn->host.name,
+ conn->port,
+ conn->oauth_bearer,
+ &resp, &len);
}
else if((enabledmechs & SASL_MECH_XOAUTH2) && conn->oauth_bearer) {
mech = SASL_MECH_STRING_XOAUTH2;
sasl->authused = SASL_MECH_XOAUTH2;
if(force_ir || data->set.sasl_ir)
- result = sasl_create_oauth_bearer_message(data, conn->user,
- NULL, 0,
- conn->oauth_bearer,
- &resp, &len);
+ result = Curl_auth_create_oauth_bearer_message(data, conn->user,
+ NULL, 0,
+ conn->oauth_bearer,
+ &resp, &len);
}
else if(enabledmechs & SASL_MECH_LOGIN) {
mech = SASL_MECH_STRING_LOGIN;
sasl->authused = SASL_MECH_LOGIN;
if(force_ir || data->set.sasl_ir)
- result = sasl_create_login_message(data, conn->user, &resp, &len);
+ result = Curl_auth_create_login_message(data, conn->user, &resp, &len);
}
else if(enabledmechs & SASL_MECH_PLAIN) {
mech = SASL_MECH_STRING_PLAIN;
sasl->authused = SASL_MECH_PLAIN;
if(force_ir || data->set.sasl_ir)
- result = sasl_create_plain_message(data, conn->user, conn->passwd,
- &resp, &len);
+ result = Curl_auth_create_plain_message(data, conn->user, conn->passwd,
+ &resp, &len);
}
}
*progress = SASL_DONE;
return result;
case SASL_PLAIN:
- result = sasl_create_plain_message(data, conn->user, conn->passwd, &resp,
- &len);
+ result = Curl_auth_create_plain_message(data, conn->user, conn->passwd,
+ &resp,
+ &len);
break;
case SASL_LOGIN:
- result = sasl_create_login_message(data, conn->user, &resp, &len);
+ result = Curl_auth_create_login_message(data, conn->user, &resp, &len);
newstate = SASL_LOGIN_PASSWD;
break;
case SASL_LOGIN_PASSWD:
- result = sasl_create_login_message(data, conn->passwd, &resp, &len);
+ result = Curl_auth_create_login_message(data, conn->passwd, &resp, &len);
break;
case SASL_EXTERNAL:
- result = sasl_create_external_message(data, conn->user, &resp, &len);
+ result = Curl_auth_create_external_message(data, conn->user, &resp, &len);
break;
#ifndef CURL_DISABLE_CRYPTO_AUTH
case SASL_CRAMMD5:
sasl->params->getmessage(data->state.buffer, &serverdata);
- result = sasl_decode_cram_md5_message(serverdata, &chlg, &chlglen);
+ result = Curl_auth_decode_cram_md5_message(serverdata, &chlg, &chlglen);
if(!result)
- result = sasl_create_cram_md5_message(data, chlg, conn->user,
- conn->passwd, &resp, &len);
+ result = Curl_auth_create_cram_md5_message(data, chlg, conn->user,
+ conn->passwd, &resp, &len);
free(chlg);
break;
case SASL_DIGESTMD5:
sasl->params->getmessage(data->state.buffer, &serverdata);
- result = Curl_sasl_create_digest_md5_message(data, serverdata,
+ result = Curl_auth_create_digest_md5_message(data, serverdata,
conn->user, conn->passwd,
sasl->params->service,
&resp, &len);
#ifdef USE_NTLM
case SASL_NTLM:
/* Create the type-1 message */
- result = Curl_sasl_create_ntlm_type1_message(conn->user, conn->passwd,
+ result = Curl_auth_create_ntlm_type1_message(conn->user, conn->passwd,
&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,
+ result = Curl_auth_decode_ntlm_type2_message(data, serverdata,
&conn->ntlm);
if(!result)
- result = Curl_sasl_create_ntlm_type3_message(data, conn->user,
+ result = Curl_auth_create_ntlm_type3_message(data, conn->user,
conn->passwd, &conn->ntlm,
&resp, &len);
break;
#if defined(USE_KERBEROS5)
case SASL_GSSAPI:
- result = Curl_sasl_create_gssapi_user_message(data, conn->user,
+ result = Curl_auth_create_gssapi_user_message(data, conn->user,
conn->passwd,
sasl->params->service,
sasl->mutual_auth, NULL,
if(sasl->mutual_auth) {
/* Decode the user token challenge and create the optional response
message */
- result = Curl_sasl_create_gssapi_user_message(data, NULL, NULL, NULL,
+ result = Curl_auth_create_gssapi_user_message(data, NULL, NULL, NULL,
sasl->mutual_auth,
serverdata, &conn->krb5,
&resp, &len);
}
else
/* Decode the security challenge and create the response message */
- result = Curl_sasl_create_gssapi_security_message(data, serverdata,
+ result = Curl_auth_create_gssapi_security_message(data, serverdata,
&conn->krb5,
&resp, &len);
break;
case SASL_GSSAPI_NO_DATA:
sasl->params->getmessage(data->state.buffer, &serverdata);
/* Decode the security challenge and create the response message */
- result = Curl_sasl_create_gssapi_security_message(data, serverdata,
+ result = Curl_auth_create_gssapi_security_message(data, serverdata,
&conn->krb5,
&resp, &len);
break;
case SASL_OAUTH2:
/* Create the authorisation message */
if(sasl->authused == SASL_MECH_OAUTHBEARER) {
- result = sasl_create_oauth_bearer_message(data, conn->user,
- conn->host.name,
- conn->port,
- conn->oauth_bearer,
- &resp, &len);
+ result = Curl_auth_create_oauth_bearer_message(data, conn->user,
+ conn->host.name,
+ conn->port,
+ conn->oauth_bearer,
+ &resp, &len);
/* Failures maybe sent by the server as continuations for OAUTHBEARER */
newstate = SASL_OAUTH2_RESP;
}
else
- result = sasl_create_oauth_bearer_message(data, conn->user,
- NULL, 0,
- conn->oauth_bearer,
- &resp, &len);
+ result = Curl_auth_create_oauth_bearer_message(data, conn->user,
+ NULL, 0,
+ conn->oauth_bearer,
+ &resp, &len);
break;
case SASL_OAUTH2_RESP:
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
while(*header && ISSPACE(*header))
header++;
- return Curl_sasl_decode_digest_http_message(header, digest);
+ return Curl_auth_decode_digest_http_message(header, digest);
}
CURLcode Curl_output_digest(struct connectdata *conn,
if(!path)
return CURLE_OUT_OF_MEMORY;
- result = Curl_sasl_create_digest_http_message(data, userp, passwdp, request,
+ result = Curl_auth_create_digest_http_message(data, userp, passwdp, request,
path, digest, &response, &len);
free(path);
if(result)
void Curl_digest_cleanup(struct SessionHandle *data)
{
- Curl_sasl_digest_cleanup(&data->state.digest);
- Curl_sasl_digest_cleanup(&data->state.proxydigest);
+ Curl_auth_digest_cleanup(&data->state.digest);
+ Curl_auth_digest_cleanup(&data->state.proxydigest);
}
#endif
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
if(!neg_ctx->server_name) {
/* Generate our SPN */
- char *spn = Curl_sasl_build_gssapi_spn(
+ char *spn = Curl_auth_build_gssapi_spn(
proxy ? data->set.str[STRING_PROXY_SERVICE_NAME] :
data->set.str[STRING_SERVICE_NAME],
proxy ? conn->proxy.name : conn->host.name);
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
return CURLE_BAD_FUNCTION_ARGUMENT;
/* Generate our SPN */
- neg_ctx->server_name = Curl_sasl_build_spn(
+ neg_ctx->server_name = Curl_auth_build_spn(
proxy ? data->set.str[STRING_PROXY_SERVICE_NAME] :
data->set.str[STRING_SERVICE_NAME],
proxy ? conn->proxy.name : conn->host.name);
#include "memdebug.h"
/*
- * sasl_create_plain_message()
+ * Curl_auth_create_plain_message()
*
* This is used to generate an already encoded PLAIN message ready
* for sending to the recipient.
*
* Returns CURLE_OK on success.
*/
-CURLcode sasl_create_plain_message(struct SessionHandle *data,
- const char *userp,
- const char *passwdp,
- char **outptr, size_t *outlen)
+CURLcode Curl_auth_create_plain_message(struct SessionHandle *data,
+ const char *userp,
+ const char *passwdp,
+ char **outptr, size_t *outlen)
{
CURLcode result;
char *plainauth;
}
/*
- * sasl_create_login_message()
+ * Curl_auth_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.
*
* Returns CURLE_OK on success.
*/
-CURLcode sasl_create_login_message(struct SessionHandle *data,
- const char *valuep, char **outptr,
- size_t *outlen)
+CURLcode Curl_auth_create_login_message(struct SessionHandle *data,
+ const char *valuep, char **outptr,
+ size_t *outlen)
{
size_t vlen = strlen(valuep);
}
/*
- * sasl_create_external_message()
+ * Curl_auth_create_external_message()
*
* This is used to generate an already encoded EXTERNAL message containing
* the user name ready for sending to the recipient.
*
* Returns CURLE_OK on success.
*/
-CURLcode sasl_create_external_message(struct SessionHandle *data,
- const char *user, char **outptr,
- size_t *outlen)
+CURLcode Curl_auth_create_external_message(struct SessionHandle *data,
+ const char *user, char **outptr,
+ size_t *outlen)
{
/* This is the same formatting as the login message */
- return sasl_create_login_message(data, user, outptr, outlen);
+ return Curl_auth_create_login_message(data, user, outptr, outlen);
}
#include "memdebug.h"
/*
- * sasl_decode_cram_md5_message()
+ * Curl_auth_decode_cram_md5_message()
*
* This is used to decode an already encoded CRAM-MD5 challenge message.
*
*
* Returns CURLE_OK on success.
*/
-CURLcode sasl_decode_cram_md5_message(const char *chlg64, char **outptr,
- size_t *outlen)
+CURLcode Curl_auth_decode_cram_md5_message(const char *chlg64, char **outptr,
+ size_t *outlen)
{
CURLcode result = CURLE_OK;
size_t chlg64len = strlen(chlg64);
}
/*
- * sasl_create_cram_md5_message()
+ * Curl_auth_create_cram_md5_message()
*
* This is used to generate an already encoded CRAM-MD5 response message ready
* for sending to the recipient.
*
* Returns CURLE_OK on success.
*/
-CURLcode sasl_create_cram_md5_message(struct SessionHandle *data,
- const char *chlg,
- const char *userp,
- const char *passwdp,
- char **outptr, size_t *outlen)
+CURLcode Curl_auth_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;
}
#endif /* !USE_WINDOWS_SSPI */
-bool Curl_sasl_digest_get_pair(const char *str, char *value, char *content,
+bool Curl_auth_digest_get_pair(const char *str, char *value, char *content,
const char **endptr)
{
int c;
#if !defined(USE_WINDOWS_SSPI)
/* Convert md5 chunk to RFC2617 (section 3.1.3) -suitable ascii string*/
-static void sasl_digest_md5_to_ascii(unsigned char *source, /* 16 bytes */
+static void auth_digest_md5_to_ascii(unsigned char *source, /* 16 bytes */
unsigned char *dest) /* 33 bytes */
{
int i;
}
/* Perform quoted-string escaping as described in RFC2616 and its errata */
-static char *sasl_digest_string_quoted(const char *source)
+static char *auth_digest_string_quoted(const char *source)
{
char *dest, *d;
const char *s = source;
/* Retrieves the value for a corresponding key from the challenge string
* returns TRUE if the key could be found, FALSE if it does not exists
*/
-static bool sasl_digest_get_key_value(const char *chlg,
+static bool auth_digest_get_key_value(const char *chlg,
const char *key,
char *value,
size_t max_val_len,
return TRUE;
}
-static CURLcode sasl_digest_get_qop_values(const char *options, int *value)
+static CURLcode auth_digest_get_qop_values(const char *options, int *value)
{
char *tmp;
char *token;
}
/*
- * sasl_decode_digest_md5_message()
+ * auth_decode_digest_md5_message()
*
* This is used internally to decode an already encoded DIGEST-MD5 challenge
* message into the seperate attributes.
*
* Returns CURLE_OK on success.
*/
-static CURLcode sasl_decode_digest_md5_message(const char *chlg64,
+static CURLcode auth_decode_digest_md5_message(const char *chlg64,
char *nonce, size_t nlen,
char *realm, size_t rlen,
char *alg, size_t alen,
return CURLE_BAD_CONTENT_ENCODING;
/* Retrieve nonce string from the challenge */
- if(!sasl_digest_get_key_value((char *) chlg, "nonce=\"", nonce, nlen,
+ if(!auth_digest_get_key_value((char *) chlg, "nonce=\"", nonce, nlen,
'\"')) {
free(chlg);
return CURLE_BAD_CONTENT_ENCODING;
}
/* Retrieve realm string from the challenge */
- if(!sasl_digest_get_key_value((char *) chlg, "realm=\"", realm, rlen,
+ if(!auth_digest_get_key_value((char *) chlg, "realm=\"", realm, rlen,
'\"')) {
/* Challenge does not have a realm, set empty string [RFC2831] page 6 */
strcpy(realm, "");
}
/* Retrieve algorithm string from the challenge */
- if(!sasl_digest_get_key_value((char *) chlg, "algorithm=", alg, alen, ',')) {
+ if(!auth_digest_get_key_value((char *) chlg, "algorithm=", alg, alen, ',')) {
free(chlg);
return CURLE_BAD_CONTENT_ENCODING;
}
/* Retrieve qop-options string from the challenge */
- if(!sasl_digest_get_key_value((char *) chlg, "qop=\"", qop, qlen, '\"')) {
+ if(!auth_digest_get_key_value((char *) chlg, "qop=\"", qop, qlen, '\"')) {
free(chlg);
return CURLE_BAD_CONTENT_ENCODING;
}
}
/*
- * Curl_sasl_create_digest_md5_message()
+ * Curl_auth_create_digest_md5_message()
*
* This is used to generate an already encoded DIGEST-MD5 response message
* ready for sending to the recipient.
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_digest_md5_message(struct SessionHandle *data,
const char *chlg64,
const char *userp,
const char *passwdp,
char *spn = NULL;
/* Decode the challange message */
- result = sasl_decode_digest_md5_message(chlg64, nonce, sizeof(nonce),
+ result = auth_decode_digest_md5_message(chlg64, nonce, sizeof(nonce),
realm, sizeof(realm),
algorithm, sizeof(algorithm),
qop_options, sizeof(qop_options));
return CURLE_BAD_CONTENT_ENCODING;
/* Get the qop-values from the qop-options */
- result = sasl_digest_get_qop_values(qop_options, &qop_values);
+ result = auth_digest_get_qop_values(qop_options, &qop_values);
if(result)
return result;
snprintf(&HA1_hex[2 * i], 3, "%02x", digest[i]);
/* Generate our SPN */
- spn = Curl_sasl_build_spn(service, realm);
+ spn = Curl_auth_build_spn(service, realm);
if(!spn)
return CURLE_OUT_OF_MEMORY;
}
/*
- * Curl_sasl_decode_digest_http_message()
+ * Curl_auth_decode_digest_http_message()
*
* This is used to decode a HTTP DIGEST challenge message into the seperate
* attributes.
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_sasl_decode_digest_http_message(const char *chlg,
+CURLcode Curl_auth_decode_digest_http_message(const char *chlg,
struct digestdata *digest)
{
bool before = FALSE; /* got a nonce before */
before = TRUE;
/* Clean up any former leftovers and initialise to defaults */
- Curl_sasl_digest_cleanup(digest);
+ Curl_auth_digest_cleanup(digest);
for(;;) {
char value[DIGEST_MAX_VALUE_LENGTH];
chlg++;
/* Extract a value=content pair */
- if(Curl_sasl_digest_get_pair(chlg, value, content, &chlg)) {
+ if(Curl_auth_digest_get_pair(chlg, value, content, &chlg)) {
if(Curl_raw_equal(value, "nonce")) {
free(digest->nonce);
digest->nonce = strdup(content);
}
/*
- * Curl_sasl_create_digest_http_message()
+ * Curl_auth_create_digest_http_message()
*
* This is used to generate a HTTP DIGEST response message ready for sending
* to the recipient.
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_digest_http_message(struct SessionHandle *data,
const char *userp,
const char *passwdp,
const unsigned char *request,
CURL_OUTPUT_DIGEST_CONV(data, md5this); /* convert on non-ASCII machines */
Curl_md5it(md5buf, md5this);
free(md5this);
- sasl_digest_md5_to_ascii(md5buf, ha1);
+ auth_digest_md5_to_ascii(md5buf, ha1);
if(digest->algo == CURLDIGESTALGO_MD5SESS) {
/* nonce and cnonce are OUTSIDE the hash */
CURL_OUTPUT_DIGEST_CONV(data, tmp); /* Convert on non-ASCII machines */
Curl_md5it(md5buf, (unsigned char *) tmp);
free(tmp);
- sasl_digest_md5_to_ascii(md5buf, ha1);
+ auth_digest_md5_to_ascii(md5buf, ha1);
}
/*
CURL_OUTPUT_DIGEST_CONV(data, md5this); /* convert on non-ASCII machines */
Curl_md5it(md5buf, md5this);
free(md5this);
- sasl_digest_md5_to_ascii(md5buf, ha2);
+ auth_digest_md5_to_ascii(md5buf, ha2);
if(digest->qop) {
md5this = (unsigned char *) aprintf("%s:%s:%08x:%s:%s:%s",
CURL_OUTPUT_DIGEST_CONV(data, md5this); /* convert on non-ASCII machines */
Curl_md5it(md5buf, md5this);
free(md5this);
- sasl_digest_md5_to_ascii(md5buf, request_digest);
+ auth_digest_md5_to_ascii(md5buf, request_digest);
/* For test case 64 (snooped from a Mozilla 1.3a request)
characters. algorithm and qop with standard values only contain web-safe
characters.
*/
- userp_quoted = sasl_digest_string_quoted(userp);
+ userp_quoted = auth_digest_string_quoted(userp);
if(!userp_quoted)
return CURLE_OUT_OF_MEMORY;
}
/*
- * Curl_sasl_digest_cleanup()
+ * Curl_auth_digest_cleanup()
*
* This is used to clean up the digest specific data.
*
* digest [in/out] - The digest data struct being cleaned up.
*
*/
-void Curl_sasl_digest_cleanup(struct digestdata *digest)
+void Curl_auth_digest_cleanup(struct digestdata *digest)
{
Curl_safefree(digest->nonce);
Curl_safefree(digest->cnonce);
};
/* This is used to extract the realm from a challenge message */
-bool Curl_sasl_digest_get_pair(const char *str, char *value, char *content,
+bool Curl_auth_digest_get_pair(const char *str, char *value, char *content,
const char **endptr);
#endif
#include "memdebug.h"
/*
- * Curl_sasl_create_digest_md5_message()
+ * Curl_auth_create_digest_md5_message()
*
* This is used to generate an already encoded DIGEST-MD5 response message
* ready for sending to the recipient.
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_digest_md5_message(struct SessionHandle *data,
const char *chlg64,
const char *userp,
const char *passwdp,
}
/* Generate our SPN */
- spn = Curl_sasl_build_spn(service, data->easy_conn->host.name);
+ spn = Curl_auth_build_spn(service, data->easy_conn->host.name);
if(!spn) {
free(output_token);
free(input_token);
chlg++;
/* Extract a value=content pair */
- if(Curl_sasl_digest_get_pair(chlg, value, content, &chlg)) {
+ if(Curl_auth_digest_get_pair(chlg, value, content, &chlg)) {
if(Curl_raw_equal(value, "realm")) {
/* Setup identity's domain and length */
}
/*
- * Curl_sasl_decode_digest_http_message()
+ * Curl_auth_decode_digest_http_message()
*
* This is used to decode a HTTP DIGEST challenge message into the seperate
* attributes.
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_sasl_decode_digest_http_message(const char *chlg,
+CURLcode Curl_auth_decode_digest_http_message(const char *chlg,
struct digestdata *digest)
{
size_t chlglen = strlen(chlg);
}
/*
- * Curl_sasl_create_digest_http_message()
+ * Curl_auth_create_digest_http_message()
*
* This is used to generate a HTTP DIGEST response message ready for sending
* to the recipient.
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_digest_http_message(struct SessionHandle *data,
const char *userp,
const char *passwdp,
const unsigned char *request,
}
/*
- * Curl_sasl_digest_cleanup()
+ * Curl_auth_digest_cleanup()
*
* This is used to clean up the digest specific data.
*
* digest [in/out] - The digest data struct being cleaned up.
*
*/
-void Curl_sasl_digest_cleanup(struct digestdata *digest)
+void Curl_auth_digest_cleanup(struct digestdata *digest)
{
/* Free the input token */
Curl_safefree(digest->input_token);
#include "memdebug.h"
/*
- * Curl_sasl_create_gssapi_user_message()
+ * Curl_auth_create_gssapi_user_message()
*
* This is used to generate an already encoded GSSAPI (Kerberos V5) user token
* message ready for sending to the recipient.
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_sasl_create_gssapi_user_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
const char *userp,
const char *passwdp,
const char *service,
if(krb5->context == GSS_C_NO_CONTEXT) {
/* Generate our SPN */
- char *spn = Curl_sasl_build_gssapi_spn(service,
+ char *spn = Curl_auth_build_gssapi_spn(service,
data->easy_conn->host.name);
if(!spn)
return CURLE_OUT_OF_MEMORY;
}
/*
- * Curl_sasl_create_gssapi_security_message()
+ * Curl_auth_create_gssapi_security_message()
*
* This is used to generate an already encoded GSSAPI (Kerberos V5) security
* token message ready for sending to the recipient.
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_sasl_create_gssapi_security_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_gssapi_security_message(struct SessionHandle *data,
const char *chlg64,
struct kerberos5data *krb5,
char **outptr,
}
/*
- * Curl_sasl_gssapi_cleanup()
+ * Curl_auth_gssapi_cleanup()
*
* This is used to clean up the GSSAPI (Kerberos V5) specific data.
*
* krb5 [in/out] - The Kerberos 5 data struct being cleaned up.
*
*/
-void Curl_sasl_gssapi_cleanup(struct kerberos5data *krb5)
+void Curl_auth_gssapi_cleanup(struct kerberos5data *krb5)
{
OM_uint32 minor_status;
#include "memdebug.h"
/*
- * Curl_sasl_create_gssapi_user_message()
+ * Curl_auth_create_gssapi_user_message()
*
* This is used to generate an already encoded GSSAPI (Kerberos V5) user token
* message ready for sending to the recipient.
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_sasl_create_gssapi_user_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
const char *userp,
const char *passwdp,
const char *service,
return CURLE_OUT_OF_MEMORY;
/* Generate our SPN */
- krb5->spn = Curl_sasl_build_spn(service, data->easy_conn->host.name);
+ krb5->spn = Curl_auth_build_spn(service, data->easy_conn->host.name);
if(!krb5->spn)
return CURLE_OUT_OF_MEMORY;
}
/*
- * Curl_sasl_create_gssapi_security_message()
+ * Curl_auth_create_gssapi_security_message()
*
* This is used to generate an already encoded GSSAPI (Kerberos V5) security
* token message ready for sending to the recipient.
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_sasl_create_gssapi_security_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_gssapi_security_message(struct SessionHandle *data,
const char *chlg64,
struct kerberos5data *krb5,
char **outptr,
}
/*
- * Curl_sasl_gssapi_cleanup()
+ * Curl_auth_gssapi_cleanup()
*
* This is used to clean up the GSSAPI (Kerberos V5) specific data.
*
* krb5 [in/out] - The Kerberos 5 data struct being cleaned up.
*
*/
-void Curl_sasl_gssapi_cleanup(struct kerberos5data *krb5)
+void Curl_auth_gssapi_cleanup(struct kerberos5data *krb5)
{
/* Free our security context */
if(krb5->context) {
*/
/*
- * Curl_sasl_decode_ntlm_type2_message()
+ * Curl_auth_decode_ntlm_type2_message()
*
* This is used to decode an already encoded NTLM type-2 message. The message
* is first decoded from a base64 string into a raw NTLM message and checked
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_sasl_decode_ntlm_type2_message(struct SessionHandle *data,
+CURLcode Curl_auth_decode_ntlm_type2_message(struct SessionHandle *data,
const char *type2msg,
struct ntlmdata *ntlm)
{
}
/*
- * Curl_sasl_create_ntlm_type1_message()
+ * Curl_auth_create_ntlm_type1_message()
*
* This is used to generate an already encoded NTLM type-1 message ready for
* sending to the recipient using the appropriate compile time crypto API.
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_sasl_create_ntlm_type1_message(const char *userp,
+CURLcode Curl_auth_create_ntlm_type1_message(const char *userp,
const char *passwdp,
struct ntlmdata *ntlm,
char **outptr, size_t *outlen)
(void)passwdp;
/* Clean up any former leftovers and initialise to defaults */
- Curl_sasl_ntlm_cleanup(ntlm);
+ Curl_auth_ntlm_cleanup(ntlm);
#if USE_NTRESPONSES && USE_NTLM2SESSION
#define NTLM2FLAG NTLMFLAG_NEGOTIATE_NTLM2_KEY
}
/*
- * Curl_sasl_create_ntlm_type3_message()
+ * Curl_auth_create_ntlm_type3_message()
*
* This is used to generate an already encoded NTLM type-3 message ready for
* sending to the recipient using the appropriate compile time crypto API.
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_sasl_create_ntlm_type3_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_ntlm_type3_message(struct SessionHandle *data,
const char *userp,
const char *passwdp,
struct ntlmdata *ntlm,
/* Return with binary blob encoded into base64 */
result = Curl_base64_encode(NULL, (char *)ntlmbuf, size, outptr, outlen);
- Curl_sasl_ntlm_cleanup(ntlm);
+ Curl_auth_ntlm_cleanup(ntlm);
return result;
}
/*
-* Curl_sasl_ntlm_cleanup()
+* Curl_auth_ntlm_cleanup()
*
* This is used to clean up the NTLM specific data.
*
* ntlm [in/out] - The NTLM data struct being cleaned up.
*
*/
-void Curl_sasl_ntlm_cleanup(struct ntlmdata *ntlm)
+void Curl_auth_ntlm_cleanup(struct ntlmdata *ntlm)
{
/* Free the target info */
Curl_safefree(ntlm->target_info);
#include "memdebug.h"
/*
- * Curl_sasl_create_ntlm_type1_message()
+ * Curl_auth_create_ntlm_type1_message()
*
* This is used to generate an already encoded NTLM type-1 message ready for
* sending to the recipient.
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_sasl_create_ntlm_type1_message(const char *userp,
+CURLcode Curl_auth_create_ntlm_type1_message(const char *userp,
const char *passwdp,
struct ntlmdata *ntlm,
char **outptr, size_t *outlen)
TimeStamp expiry; /* For Windows 9x compatibility of SSPI calls */
/* Clean up any former leftovers and initialise to defaults */
- Curl_sasl_ntlm_cleanup(ntlm);
+ Curl_auth_ntlm_cleanup(ntlm);
/* Query the security package for NTLM */
status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT(SP_NAME_NTLM),
}
/*
- * Curl_sasl_decode_ntlm_type2_message()
+ * Curl_auth_decode_ntlm_type2_message()
*
* This is used to decode an already encoded NTLM type-2 message.
*
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_sasl_decode_ntlm_type2_message(struct SessionHandle *data,
+CURLcode Curl_auth_decode_ntlm_type2_message(struct SessionHandle *data,
const char *type2msg,
struct ntlmdata *ntlm)
{
}
/*
- * Curl_sasl_create_ntlm_type3_message()
+* Curl_auth_create_ntlm_type3_message()
+ * Curl_auth_create_ntlm_type3_message()
*
* This is used to generate an already encoded NTLM type-3 message ready for
* sending to the recipient.
*
* Returns CURLE_OK on success.
*/
-CURLcode Curl_sasl_create_ntlm_type3_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_ntlm_type3_message(struct SessionHandle *data,
const char *userp,
const char *passwdp,
struct ntlmdata *ntlm,
result = Curl_base64_encode(data, (char *) ntlm->output_token,
type_3_buf.cbBuffer, outptr, outlen);
- Curl_sasl_ntlm_cleanup(ntlm);
+ Curl_auth_ntlm_cleanup(ntlm);
return result;
}
/*
- * Curl_sasl_ntlm_cleanup()
+ * Curl_auth_ntlm_cleanup()
*
* This is used to clean up the NTLM specific data.
*
* ntlm [in/out] - The NTLM data struct being cleaned up.
*
*/
-void Curl_sasl_ntlm_cleanup(struct ntlmdata *ntlm)
+void Curl_auth_ntlm_cleanup(struct ntlmdata *ntlm)
{
/* Free our security context */
if(ntlm->context) {
#include "memdebug.h"
/*
- * sasl_create_oauth_bearer_message()
+ * Curl_auth_create_oauth_bearer_message()
*
* This is used to generate an already encoded OAuth 2.0 message ready for
* sending to the recipient.
*
* Returns CURLE_OK on success.
*/
-CURLcode sasl_create_oauth_bearer_message(struct SessionHandle *data,
- const char *user,
- const char *host,
- const long port,
- const char *bearer,
- char **outptr, size_t *outlen)
+CURLcode Curl_auth_create_oauth_bearer_message(struct SessionHandle *data,
+ const char *user,
+ const char *host,
+ const long port,
+ const char *bearer,
+ char **outptr, size_t *outlen)
{
CURLcode result = CURLE_OK;
char *oauth = NULL;
#include "memdebug.h"
/*
- * Curl_sasl_build_spn()
+ * Curl_auth_build_spn()
*
* This is used to build a SPN string in the format service/instance.
*
* Returns a pointer to the newly allocated SPN.
*/
#if !defined(USE_WINDOWS_SSPI)
-char *Curl_sasl_build_spn(const char *service, const char *instance)
+char *Curl_auth_build_spn(const char *service, const char *instance)
{
/* Generate and return our SPN */
return aprintf("%s/%s", service, instance);
}
#else
-TCHAR *Curl_sasl_build_spn(const char *service, const char *instance)
+TCHAR *Curl_auth_build_spn(const char *service, const char *instance)
{
char *utf8_spn = NULL;
TCHAR *tchar_spn = NULL;
#if defined(HAVE_GSSAPI)
/*
- * Curl_sasl_build_gssapi_spn()
+ * Curl_auth_build_gssapi_spn()
*
* This is used to build a SPN string in the format service@instance.
*
*
* Returns a pointer to the newly allocated SPN.
*/
-char *Curl_sasl_build_gssapi_spn(const char *service, const char *instance)
+char *Curl_auth_build_gssapi_spn(const char *service, const char *instance)
{
/* Generate and return our SPN */
return aprintf("%s@%s", service, instance);
/* This is used to build a SPN string */
#if !defined(USE_WINDOWS_SSPI)
-char *Curl_sasl_build_spn(const char *service, const char *instance);
+char *Curl_auth_build_spn(const char *service, const char *instance);
#else
-TCHAR *Curl_sasl_build_spn(const char *service, const char *instance);
+TCHAR *Curl_auth_build_spn(const char *service, const char *instance);
#endif
#if defined(HAVE_GSSAPI)
-char *Curl_sasl_build_gssapi_spn(const char *service, const char *instance);
+char *Curl_auth_build_gssapi_spn(const char *service, const char *instance);
#endif
/* This is used to generate a base64 encoded PLAIN cleartext message */
-CURLcode sasl_create_plain_message(struct SessionHandle *data,
- const char *userp,
- const char *passwdp,
- char **outptr, size_t *outlen);
+CURLcode Curl_auth_create_plain_message(struct SessionHandle *data,
+ const char *userp,
+ const char *passwdp,
+ char **outptr, size_t *outlen);
/* This is used to generate a base64 encoded LOGIN cleartext message */
-CURLcode sasl_create_login_message(struct SessionHandle *data,
- const char *valuep, char **outptr,
- size_t *outlen);
+CURLcode Curl_auth_create_login_message(struct SessionHandle *data,
+ const char *valuep, char **outptr,
+ size_t *outlen);
/* This is used to generate a base64 encoded EXTERNAL cleartext message */
-CURLcode sasl_create_external_message(struct SessionHandle *data,
- const char *user, char **outptr,
- size_t *outlen);
+CURLcode Curl_auth_create_external_message(struct SessionHandle *data,
+ const char *user, char **outptr,
+ size_t *outlen);
#if !defined(CURL_DISABLE_CRYPTO_AUTH)
/* This is used to decode a CRAM-MD5 challenge message */
-CURLcode sasl_decode_cram_md5_message(const char *chlg64, char **outptr,
- size_t *outlen);
+CURLcode Curl_auth_decode_cram_md5_message(const char *chlg64, char **outptr,
+ size_t *outlen);
/* This is used to generate a CRAM-MD5 response message */
-CURLcode sasl_create_cram_md5_message(struct SessionHandle *data,
- const char *chlg,
- const char *userp,
- const char *passwdp,
- char **outptr, size_t *outlen);
+CURLcode Curl_auth_create_cram_md5_message(struct SessionHandle *data,
+ const char *chlg,
+ const char *userp,
+ const char *passwdp,
+ char **outptr, size_t *outlen);
/* This is used to generate a base64 encoded DIGEST-MD5 response message */
-CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_digest_md5_message(struct SessionHandle *data,
const char *chlg64,
const char *userp,
const char *passwdp,
char **outptr, size_t *outlen);
/* This is used to decode a HTTP DIGEST challenge message */
-CURLcode Curl_sasl_decode_digest_http_message(const char *chlg,
+CURLcode Curl_auth_decode_digest_http_message(const char *chlg,
struct digestdata *digest);
/* This is used to generate a HTTP DIGEST response message */
-CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_digest_http_message(struct SessionHandle *data,
const char *userp,
const char *passwdp,
const unsigned char *request,
char **outptr, size_t *outlen);
/* This is used to clean up the digest specific data */
-void Curl_sasl_digest_cleanup(struct digestdata *digest);
+void Curl_auth_digest_cleanup(struct digestdata *digest);
#endif /* !CURL_DISABLE_CRYPTO_AUTH */
#if defined(USE_NTLM)
/* This is used to generate a base64 encoded NTLM type-1 message */
-CURLcode Curl_sasl_create_ntlm_type1_message(const char *userp,
+CURLcode Curl_auth_create_ntlm_type1_message(const char *userp,
const char *passwdp,
struct ntlmdata *ntlm,
char **outptr,
size_t *outlen);
/* This is used to decode a base64 encoded NTLM type-2 message */
-CURLcode Curl_sasl_decode_ntlm_type2_message(struct SessionHandle *data,
+CURLcode Curl_auth_decode_ntlm_type2_message(struct SessionHandle *data,
const char *type2msg,
struct ntlmdata *ntlm);
/* This is used to generate a base64 encoded NTLM type-3 message */
-CURLcode Curl_sasl_create_ntlm_type3_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_ntlm_type3_message(struct SessionHandle *data,
const char *userp,
const char *passwdp,
struct ntlmdata *ntlm,
char **outptr, size_t *outlen);
/* This is used to clean up the NTLM specific data */
-void Curl_sasl_ntlm_cleanup(struct ntlmdata *ntlm);
+void Curl_auth_ntlm_cleanup(struct ntlmdata *ntlm);
#endif /* USE_NTLM */
/* This is used to generate a base64 encoded OAuth 2.0 message */
-CURLcode sasl_create_oauth_bearer_message(struct SessionHandle *data,
- const char *user,
- const char *host,
- const long port,
- const char *bearer,
- char **outptr, size_t *outlen);
+CURLcode Curl_auth_create_oauth_bearer_message(struct SessionHandle *data,
+ const char *user,
+ const char *host,
+ const long port,
+ const char *bearer,
+ char **outptr, size_t *outlen);
#if defined(USE_KERBEROS5)
/* This is used to generate a base64 encoded GSSAPI (Kerberos V5) user token
message */
-CURLcode Curl_sasl_create_gssapi_user_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_gssapi_user_message(struct SessionHandle *data,
const char *userp,
const char *passwdp,
const char *service,
/* This is used to generate a base64 encoded GSSAPI (Kerberos V5) security
token message */
-CURLcode Curl_sasl_create_gssapi_security_message(struct SessionHandle *data,
+CURLcode Curl_auth_create_gssapi_security_message(struct SessionHandle *data,
const char *input,
struct kerberos5data *krb5,
char **outptr,
size_t *outlen);
/* This is used to clean up the GSSAPI specific data */
-void Curl_sasl_gssapi_cleanup(struct kerberos5data *krb5);
+void Curl_auth_gssapi_cleanup(struct kerberos5data *krb5);
#endif /* USE_KERBEROS5 */
#endif /* HEADER_CURL_VAUTH_H */