diff options
author | Steve Holme <steve_holme@hotmail.com> | 2016-03-13 11:28:42 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2016-03-25 17:40:12 +0000 |
commit | 58a7bc96eca33c4b6483ed25d0b1547ce8ec0d89 (patch) | |
tree | 838bce407fb6d98d8af66448f86b04c414eeb81b | |
parent | 7d2a5a05f64c51107b962ff19f85052ab251323a (diff) |
vauth: Refactored function names after move to new vauth directory
Renamed all the SASL functions that moved to the new vauth directory to
include the correct module name.
-rw-r--r-- | lib/curl_ntlm.c | 12 | ||||
-rw-r--r-- | lib/curl_sasl.c | 86 | ||||
-rw-r--r-- | lib/http_digest.c | 10 | ||||
-rw-r--r-- | lib/http_negotiate.c | 4 | ||||
-rw-r--r-- | lib/http_negotiate_sspi.c | 4 | ||||
-rw-r--r-- | lib/vauth/cleartext.c | 28 | ||||
-rw-r--r-- | lib/vauth/cram.c | 18 | ||||
-rw-r--r-- | lib/vauth/digest.c | 58 | ||||
-rw-r--r-- | lib/vauth/digest.h | 2 | ||||
-rw-r--r-- | lib/vauth/digest_sspi.c | 20 | ||||
-rw-r--r-- | lib/vauth/krb5_gssapi.c | 14 | ||||
-rw-r--r-- | lib/vauth/krb5_sspi.c | 14 | ||||
-rw-r--r-- | lib/vauth/ntlm.c | 20 | ||||
-rw-r--r-- | lib/vauth/ntlm_sspi.c | 21 | ||||
-rw-r--r-- | lib/vauth/oauth2.c | 14 | ||||
-rw-r--r-- | lib/vauth/vauth.c | 10 | ||||
-rw-r--r-- | lib/vauth/vauth.h | 74 |
17 files changed, 206 insertions, 203 deletions
diff --git a/lib/curl_ntlm.c b/lib/curl_ntlm.c index f3fac5bab..dbf567b4e 100644 --- a/lib/curl_ntlm.c +++ b/lib/curl_ntlm.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * 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 @@ -76,7 +76,7 @@ CURLcode Curl_input_ntlm(struct connectdata *conn, 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; @@ -170,7 +170,7 @@ CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy) 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; @@ -190,7 +190,7 @@ CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy) 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; @@ -227,8 +227,8 @@ CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy) 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); diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index e92eda5b5..32c8534e7 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -86,14 +86,14 @@ void Curl_sasl_cleanup(struct connectdata *conn, unsigned int authused) #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 @@ -279,7 +279,8 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn, 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) @@ -291,7 +292,7 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn, 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, @@ -321,7 +322,7 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn, 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 @@ -333,11 +334,11 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn, 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; @@ -345,10 +346,10 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn, 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; @@ -357,7 +358,7 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn, 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; @@ -365,8 +366,8 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn, 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); } } @@ -432,32 +433,33 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn, *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); @@ -473,17 +475,17 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn, #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; @@ -491,7 +493,7 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn, #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, @@ -504,7 +506,7 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn, 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); @@ -512,14 +514,14 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn, } 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; @@ -528,20 +530,20 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn, 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: diff --git a/lib/http_digest.c b/lib/http_digest.c index de7a92384..782a7a240 100644 --- a/lib/http_digest.c +++ b/lib/http_digest.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * 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 @@ -65,7 +65,7 @@ CURLcode Curl_input_digest(struct connectdata *conn, 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, @@ -152,7 +152,7 @@ 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) @@ -172,8 +172,8 @@ CURLcode Curl_output_digest(struct connectdata *conn, 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 diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c index a22b3a324..3f52bbcf3 100644 --- a/lib/http_negotiate.c +++ b/lib/http_negotiate.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * 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 @@ -62,7 +62,7 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy, 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); diff --git a/lib/http_negotiate_sspi.c b/lib/http_negotiate_sspi.c index f3c8c4d10..2d869ae88 100644 --- a/lib/http_negotiate_sspi.c +++ b/lib/http_negotiate_sspi.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * 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 @@ -94,7 +94,7 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy, 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); diff --git a/lib/vauth/cleartext.c b/lib/vauth/cleartext.c index 75a9463c9..71b0442dd 100644 --- a/lib/vauth/cleartext.c +++ b/lib/vauth/cleartext.c @@ -43,7 +43,7 @@ #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. @@ -59,10 +59,10 @@ * * 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; @@ -95,7 +95,7 @@ CURLcode sasl_create_plain_message(struct SessionHandle *data, } /* - * 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. @@ -110,9 +110,9 @@ CURLcode sasl_create_plain_message(struct SessionHandle *data, * * 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); @@ -133,7 +133,7 @@ CURLcode sasl_create_login_message(struct SessionHandle *data, } /* - * 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. @@ -148,10 +148,10 @@ CURLcode sasl_create_login_message(struct SessionHandle *data, * * 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); } diff --git a/lib/vauth/cram.c b/lib/vauth/cram.c index 846cb554d..6f69e2ae9 100644 --- a/lib/vauth/cram.c +++ b/lib/vauth/cram.c @@ -41,7 +41,7 @@ #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. * @@ -54,8 +54,8 @@ * * 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); @@ -71,7 +71,7 @@ CURLcode sasl_decode_cram_md5_message(const char *chlg64, char **outptr, } /* - * 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. @@ -88,11 +88,11 @@ CURLcode sasl_decode_cram_md5_message(const char *chlg64, char **outptr, * * 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; diff --git a/lib/vauth/digest.c b/lib/vauth/digest.c index 185bfa46f..4a5fc4c65 100644 --- a/lib/vauth/digest.c +++ b/lib/vauth/digest.c @@ -66,7 +66,7 @@ } #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; @@ -135,7 +135,7 @@ bool Curl_sasl_digest_get_pair(const char *str, char *value, char *content, #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; @@ -144,7 +144,7 @@ static void sasl_digest_md5_to_ascii(unsigned char *source, /* 16 bytes */ } /* 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; @@ -178,7 +178,7 @@ static char *sasl_digest_string_quoted(const char *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, @@ -200,7 +200,7 @@ static bool sasl_digest_get_key_value(const char *chlg, 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; @@ -233,7 +233,7 @@ static CURLcode sasl_digest_get_qop_values(const char *options, int *value) } /* - * 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. @@ -252,7 +252,7 @@ static CURLcode sasl_digest_get_qop_values(const char *options, int *value) * * 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, @@ -275,27 +275,27 @@ static CURLcode sasl_decode_digest_md5_message(const char *chlg64, 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; } @@ -306,7 +306,7 @@ static CURLcode sasl_decode_digest_md5_message(const char *chlg64, } /* - * 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. @@ -324,7 +324,7 @@ static CURLcode sasl_decode_digest_md5_message(const char *chlg64, * * 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, @@ -352,7 +352,7 @@ CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data, 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)); @@ -364,7 +364,7 @@ CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data, 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; @@ -415,7 +415,7 @@ CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data, 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; @@ -486,7 +486,7 @@ CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data, } /* - * 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. @@ -498,7 +498,7 @@ CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data, * * 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 */ @@ -512,7 +512,7 @@ CURLcode Curl_sasl_decode_digest_http_message(const char *chlg, 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]; @@ -523,7 +523,7 @@ CURLcode Curl_sasl_decode_digest_http_message(const char *chlg, 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); @@ -626,7 +626,7 @@ CURLcode Curl_sasl_decode_digest_http_message(const char *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. @@ -645,7 +645,7 @@ CURLcode Curl_sasl_decode_digest_http_message(const char *chlg, * * 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, @@ -701,7 +701,7 @@ CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data, 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 */ @@ -712,7 +712,7 @@ CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data, 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); } /* @@ -745,7 +745,7 @@ CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data, 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", @@ -769,7 +769,7 @@ CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data, 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) @@ -784,7 +784,7 @@ CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data, 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; @@ -856,7 +856,7 @@ CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data, } /* - * Curl_sasl_digest_cleanup() + * Curl_auth_digest_cleanup() * * This is used to clean up the digest specific data. * @@ -865,7 +865,7 @@ CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *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); diff --git a/lib/vauth/digest.h b/lib/vauth/digest.h index b6ff2fd05..d2c48687a 100644 --- a/lib/vauth/digest.h +++ b/lib/vauth/digest.h @@ -35,7 +35,7 @@ enum { }; /* 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 diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c index c161bdd4d..a882534f0 100644 --- a/lib/vauth/digest_sspi.c +++ b/lib/vauth/digest_sspi.c @@ -44,7 +44,7 @@ #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. @@ -62,7 +62,7 @@ * * 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, @@ -125,7 +125,7 @@ CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data, } /* 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); @@ -255,7 +255,7 @@ CURLcode Curl_override_sspi_http_realm(const char *chlg, 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 */ @@ -297,7 +297,7 @@ CURLcode Curl_override_sspi_http_realm(const char *chlg, } /* - * 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. @@ -309,7 +309,7 @@ CURLcode Curl_override_sspi_http_realm(const char *chlg, * * 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); @@ -330,7 +330,7 @@ CURLcode Curl_sasl_decode_digest_http_message(const char *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. @@ -349,7 +349,7 @@ CURLcode Curl_sasl_decode_digest_http_message(const char *chlg, * * 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, @@ -506,7 +506,7 @@ CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data, } /* - * Curl_sasl_digest_cleanup() + * Curl_auth_digest_cleanup() * * This is used to clean up the digest specific data. * @@ -515,7 +515,7 @@ CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *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); diff --git a/lib/vauth/krb5_gssapi.c b/lib/vauth/krb5_gssapi.c index 62a95a6c9..20274a02d 100644 --- a/lib/vauth/krb5_gssapi.c +++ b/lib/vauth/krb5_gssapi.c @@ -42,7 +42,7 @@ #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. @@ -64,7 +64,7 @@ * * 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, @@ -88,7 +88,7 @@ CURLcode Curl_sasl_create_gssapi_user_message(struct SessionHandle *data, 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; @@ -165,7 +165,7 @@ CURLcode Curl_sasl_create_gssapi_user_message(struct SessionHandle *data, } /* - * 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. @@ -181,7 +181,7 @@ CURLcode Curl_sasl_create_gssapi_user_message(struct SessionHandle *data, * * 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, @@ -346,7 +346,7 @@ CURLcode Curl_sasl_create_gssapi_security_message(struct SessionHandle *data, } /* - * Curl_sasl_gssapi_cleanup() + * Curl_auth_gssapi_cleanup() * * This is used to clean up the GSSAPI (Kerberos V5) specific data. * @@ -355,7 +355,7 @@ CURLcode Curl_sasl_create_gssapi_security_message(struct SessionHandle *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; diff --git a/lib/vauth/krb5_sspi.c b/lib/vauth/krb5_sspi.c index 284fd98dd..a1d438f50 100644 --- a/lib/vauth/krb5_sspi.c +++ b/lib/vauth/krb5_sspi.c @@ -40,7 +40,7 @@ #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. @@ -61,7 +61,7 @@ * * 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, @@ -103,7 +103,7 @@ CURLcode Curl_sasl_create_gssapi_user_message(struct SessionHandle *data, 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; @@ -213,7 +213,7 @@ CURLcode Curl_sasl_create_gssapi_user_message(struct SessionHandle *data, } /* - * 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. @@ -229,7 +229,7 @@ CURLcode Curl_sasl_create_gssapi_user_message(struct SessionHandle *data, * * 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, @@ -445,7 +445,7 @@ CURLcode Curl_sasl_create_gssapi_security_message(struct SessionHandle *data, } /* - * Curl_sasl_gssapi_cleanup() + * Curl_auth_gssapi_cleanup() * * This is used to clean up the GSSAPI (Kerberos V5) specific data. * @@ -454,7 +454,7 @@ CURLcode Curl_sasl_create_gssapi_security_message(struct SessionHandle *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) { diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c index aef29bdfb..e27ce59be 100644 --- a/lib/vauth/ntlm.c +++ b/lib/vauth/ntlm.c @@ -217,7 +217,7 @@ static CURLcode ntlm_decode_type2_target(struct SessionHandle *data, */ /* - * 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 @@ -232,7 +232,7 @@ static CURLcode ntlm_decode_type2_target(struct SessionHandle *data, * * 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) { @@ -329,7 +329,7 @@ static void unicodecpy(unsigned char *dest, const char *src, size_t length) } /* - * 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. @@ -345,7 +345,7 @@ static void unicodecpy(unsigned char *dest, const char *src, size_t length) * * 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) @@ -378,7 +378,7 @@ CURLcode Curl_sasl_create_ntlm_type1_message(const char *userp, (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 @@ -448,7 +448,7 @@ CURLcode Curl_sasl_create_ntlm_type1_message(const char *userp, } /* - * 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. @@ -465,7 +465,7 @@ CURLcode Curl_sasl_create_ntlm_type1_message(const char *userp, * * 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, @@ -815,13 +815,13 @@ CURLcode Curl_sasl_create_ntlm_type3_message(struct SessionHandle *data, /* 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. * @@ -830,7 +830,7 @@ CURLcode Curl_sasl_create_ntlm_type3_message(struct SessionHandle *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); diff --git a/lib/vauth/ntlm_sspi.c b/lib/vauth/ntlm_sspi.c index 3f48d5080..532e270fd 100644 --- a/lib/vauth/ntlm_sspi.c +++ b/lib/vauth/ntlm_sspi.c @@ -38,7 +38,7 @@ #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. @@ -54,7 +54,7 @@ * * 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) @@ -67,7 +67,7 @@ CURLcode Curl_sasl_create_ntlm_type1_message(const char *userp, 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), @@ -150,7 +150,7 @@ CURLcode Curl_sasl_create_ntlm_type1_message(const char *userp, } /* - * Curl_sasl_decode_ntlm_type2_message() + * Curl_auth_decode_ntlm_type2_message() * * This is used to decode an already encoded NTLM type-2 message. * @@ -162,7 +162,7 @@ CURLcode Curl_sasl_create_ntlm_type1_message(const char *userp, * * 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) { @@ -196,7 +196,8 @@ CURLcode Curl_sasl_decode_ntlm_type2_message(struct SessionHandle *data, } /* - * 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. @@ -213,7 +214,7 @@ CURLcode Curl_sasl_decode_ntlm_type2_message(struct SessionHandle *data, * * 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, @@ -267,13 +268,13 @@ CURLcode Curl_sasl_create_ntlm_type3_message(struct SessionHandle *data, 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. * @@ -282,7 +283,7 @@ CURLcode Curl_sasl_create_ntlm_type3_message(struct SessionHandle *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) { diff --git a/lib/vauth/oauth2.c b/lib/vauth/oauth2.c index dcee71b6a..0c80c8bb4 100644 --- a/lib/vauth/oauth2.c +++ b/lib/vauth/oauth2.c @@ -37,7 +37,7 @@ #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. @@ -55,12 +55,12 @@ * * 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; diff --git a/lib/vauth/vauth.c b/lib/vauth/vauth.c index b21caeafd..7ed60b11d 100644 --- a/lib/vauth/vauth.c +++ b/lib/vauth/vauth.c @@ -33,7 +33,7 @@ #include "memdebug.h" /* - * Curl_sasl_build_spn() + * Curl_auth_build_spn() * * This is used to build a SPN string in the format service/instance. * @@ -45,13 +45,13 @@ * 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; @@ -87,7 +87,7 @@ TCHAR *Curl_sasl_build_spn(const char *service, const char *instance) #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. * @@ -98,7 +98,7 @@ TCHAR *Curl_sasl_build_spn(const char *service, const char *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); diff --git a/lib/vauth/vauth.h b/lib/vauth/vauth.h index 674c4b1c7..7f2f48826 100644 --- a/lib/vauth/vauth.h +++ b/lib/vauth/vauth.h @@ -40,45 +40,45 @@ struct kerberos5data; /* 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, @@ -86,11 +86,11 @@ CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data, 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, @@ -99,44 +99,44 @@ CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data, 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, @@ -147,14 +147,14 @@ CURLcode Curl_sasl_create_gssapi_user_message(struct SessionHandle *data, /* 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 */ |