vauth.h
Go to the documentation of this file.
00001 #ifndef HEADER_CURL_VAUTH_H
00002 #define HEADER_CURL_VAUTH_H
00003 /***************************************************************************
00004  *                                  _   _ ____  _
00005  *  Project                     ___| | | |  _ \| |
00006  *                             / __| | | | |_) | |
00007  *                            | (__| |_| |  _ <| |___
00008  *                             \___|\___/|_| \_\_____|
00009  *
00010  * Copyright (C) 2014 - 2016, Steve Holme, <steve_holme@hotmail.com>.
00011  *
00012  * This software is licensed as described in the file COPYING, which
00013  * you should have received as part of this distribution. The terms
00014  * are also available at https://curl.haxx.se/docs/copyright.html.
00015  *
00016  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
00017  * copies of the Software, and permit persons to whom the Software is
00018  * furnished to do so, under the terms of the COPYING file.
00019  *
00020  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
00021  * KIND, either express or implied.
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 /* This is used to build a SPN string */
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 /* This is used to test if the user contains a Windows domain name */
00059 bool Curl_auth_user_contains_domain(const char *user);
00060 
00061 /* This is used to generate a base64 encoded PLAIN cleartext message */
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 /* This is used to generate a base64 encoded LOGIN cleartext message */
00068 CURLcode Curl_auth_create_login_message(struct Curl_easy *data,
00069                                         const char *valuep, char **outptr,
00070                                         size_t *outlen);
00071 
00072 /* This is used to generate a base64 encoded EXTERNAL cleartext message */
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 /* This is used to decode a CRAM-MD5 challenge message */
00079 CURLcode Curl_auth_decode_cram_md5_message(const char *chlg64, char **outptr,
00080                                            size_t *outlen);
00081 
00082 /* This is used to generate a CRAM-MD5 response message */
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 /* This is used to evaluate if DIGEST is supported */
00090 bool Curl_auth_is_digest_supported(void);
00091 
00092 /* This is used to generate a base64 encoded DIGEST-MD5 response message */
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 /* This is used to decode a HTTP DIGEST challenge message */
00101 CURLcode Curl_auth_decode_digest_http_message(const char *chlg,
00102                                               struct digestdata *digest);
00103 
00104 /* This is used to generate a HTTP DIGEST response message */
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 /* This is used to clean up the digest specific data */
00114 void Curl_auth_digest_cleanup(struct digestdata *digest);
00115 #endif /* !CURL_DISABLE_CRYPTO_AUTH */
00116 
00117 #if defined(USE_NTLM)
00118 /* This is used to evaluate if NTLM is supported */
00119 bool Curl_auth_is_ntlm_supported(void);
00120 
00121 /* This is used to generate a base64 encoded NTLM type-1 message */
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 /* This is used to decode a base64 encoded NTLM type-2 message */
00129 CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data,
00130                                              const char *type2msg,
00131                                              struct ntlmdata *ntlm);
00132 
00133 /* This is used to generate a base64 encoded NTLM type-3 message */
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 /* This is used to clean up the NTLM specific data */
00141 void Curl_auth_ntlm_cleanup(struct ntlmdata *ntlm);
00142 #endif /* USE_NTLM */
00143 
00144 /* This is used to generate a base64 encoded OAuth 2.0 message */
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 /* This is used to evaluate if GSSAPI (Kerberos V5) is supported */
00153 bool Curl_auth_is_gssapi_supported(void);
00154 
00155 /* This is used to generate a base64 encoded GSSAPI (Kerberos V5) user token
00156    message */
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 /* This is used to generate a base64 encoded GSSAPI (Kerberos V5) security
00168    token message */
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 /* This is used to clean up the GSSAPI specific data */
00176 void Curl_auth_gssapi_cleanup(struct kerberos5data *krb5);
00177 #endif /* USE_KERBEROS5 */
00178 
00179 #if defined(USE_SPNEGO)
00180 /* This is used to evaluate if SPNEGO (Negotiate) is supported */
00181 bool Curl_auth_is_spnego_supported(void);
00182 
00183 /* This is used to decode a base64 encoded SPNEGO (Negotiate) challenge
00184    message */
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 /* This is used to generate a base64 encoded SPNEGO (Negotiate) response
00194    message */
00195 CURLcode Curl_auth_create_spnego_message(struct Curl_easy *data,
00196                                          struct negotiatedata *nego,
00197                                          char **outptr, size_t *outlen);
00198 
00199 /* This is used to clean up the SPNEGO specifiec data */
00200 void Curl_auth_spnego_cleanup(struct negotiatedata *nego);
00201 
00202 #endif /* USE_SPNEGO */
00203 
00204 #endif /* HEADER_CURL_VAUTH_H */


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:07