00001 #ifndef HEADER_CURL_VAUTH_H
00002 #define HEADER_CURL_VAUTH_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <curl/curl.h>
00026
00027 struct Curl_easy;
00028
00029 #if !defined(CURL_DISABLE_CRYPTO_AUTH)
00030 struct digestdata;
00031 #endif
00032
00033 #if defined(USE_NTLM)
00034 struct ntlmdata;
00035 #endif
00036
00037 #if defined(USE_KERBEROS5)
00038 struct kerberos5data;
00039 #endif
00040
00041 #if (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)) && defined(USE_SPNEGO)
00042 struct negotiatedata;
00043 #endif
00044
00045 #if defined(USE_WINDOWS_SSPI)
00046 #define GSS_ERROR(status) (status & 0x80000000)
00047 #endif
00048
00049
00050 #if !defined(USE_WINDOWS_SSPI)
00051 char *Curl_auth_build_spn(const char *service, const char *host,
00052 const char *realm);
00053 #else
00054 TCHAR *Curl_auth_build_spn(const char *service, const char *host,
00055 const char *realm);
00056 #endif
00057
00058
00059 bool Curl_auth_user_contains_domain(const char *user);
00060
00061
00062 CURLcode Curl_auth_create_plain_message(struct Curl_easy *data,
00063 const char *userp,
00064 const char *passwdp,
00065 char **outptr, size_t *outlen);
00066
00067
00068 CURLcode Curl_auth_create_login_message(struct Curl_easy *data,
00069 const char *valuep, char **outptr,
00070 size_t *outlen);
00071
00072
00073 CURLcode Curl_auth_create_external_message(struct Curl_easy *data,
00074 const char *user, char **outptr,
00075 size_t *outlen);
00076
00077 #if !defined(CURL_DISABLE_CRYPTO_AUTH)
00078
00079 CURLcode Curl_auth_decode_cram_md5_message(const char *chlg64, char **outptr,
00080 size_t *outlen);
00081
00082
00083 CURLcode Curl_auth_create_cram_md5_message(struct Curl_easy *data,
00084 const char *chlg,
00085 const char *userp,
00086 const char *passwdp,
00087 char **outptr, size_t *outlen);
00088
00089
00090 bool Curl_auth_is_digest_supported(void);
00091
00092
00093 CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
00094 const char *chlg64,
00095 const char *userp,
00096 const char *passwdp,
00097 const char *service,
00098 char **outptr, size_t *outlen);
00099
00100
00101 CURLcode Curl_auth_decode_digest_http_message(const char *chlg,
00102 struct digestdata *digest);
00103
00104
00105 CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
00106 const char *userp,
00107 const char *passwdp,
00108 const unsigned char *request,
00109 const unsigned char *uri,
00110 struct digestdata *digest,
00111 char **outptr, size_t *outlen);
00112
00113
00114 void Curl_auth_digest_cleanup(struct digestdata *digest);
00115 #endif
00116
00117 #if defined(USE_NTLM)
00118
00119 bool Curl_auth_is_ntlm_supported(void);
00120
00121
00122 CURLcode Curl_auth_create_ntlm_type1_message(const char *userp,
00123 const char *passwdp,
00124 struct ntlmdata *ntlm,
00125 char **outptr,
00126 size_t *outlen);
00127
00128
00129 CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data,
00130 const char *type2msg,
00131 struct ntlmdata *ntlm);
00132
00133
00134 CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
00135 const char *userp,
00136 const char *passwdp,
00137 struct ntlmdata *ntlm,
00138 char **outptr, size_t *outlen);
00139
00140
00141 void Curl_auth_ntlm_cleanup(struct ntlmdata *ntlm);
00142 #endif
00143
00144
00145 CURLcode Curl_auth_create_oauth_bearer_message(struct Curl_easy *data,
00146 const char *user,
00147 const char *host,
00148 const long port,
00149 const char *bearer,
00150 char **outptr, size_t *outlen);
00151 #if defined(USE_KERBEROS5)
00152
00153 bool Curl_auth_is_gssapi_supported(void);
00154
00155
00156
00157 CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data,
00158 const char *userp,
00159 const char *passwdp,
00160 const char *service,
00161 const char *host,
00162 const bool mutual,
00163 const char *chlg64,
00164 struct kerberos5data *krb5,
00165 char **outptr, size_t *outlen);
00166
00167
00168
00169 CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data,
00170 const char *input,
00171 struct kerberos5data *krb5,
00172 char **outptr,
00173 size_t *outlen);
00174
00175
00176 void Curl_auth_gssapi_cleanup(struct kerberos5data *krb5);
00177 #endif
00178
00179 #if defined(USE_SPNEGO)
00180
00181 bool Curl_auth_is_spnego_supported(void);
00182
00183
00184
00185 CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
00186 const char *user,
00187 const char *passwood,
00188 const char *service,
00189 const char *host,
00190 const char *chlg64,
00191 struct negotiatedata *nego);
00192
00193
00194
00195 CURLcode Curl_auth_create_spnego_message(struct Curl_easy *data,
00196 struct negotiatedata *nego,
00197 char **outptr, size_t *outlen);
00198
00199
00200 void Curl_auth_spnego_cleanup(struct negotiatedata *nego);
00201
00202 #endif
00203
00204 #endif