Go to the documentation of this file.00001 #ifndef HEADER_CURL_SSPI_H
00002 #define HEADER_CURL_SSPI_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_setup.h"
00026
00027 #ifdef USE_WINDOWS_SSPI
00028
00029 #include <curl/curl.h>
00030
00031
00032
00033
00034
00035
00036 #undef SECURITY_WIN32
00037 #undef SECURITY_KERNEL
00038 #define SECURITY_WIN32 1
00039 #include <security.h>
00040 #include <sspi.h>
00041 #include <rpc.h>
00042
00043 CURLcode Curl_sspi_global_init(void);
00044 void Curl_sspi_global_cleanup(void);
00045
00046
00047 CURLcode Curl_override_sspi_http_realm(const char *chlg,
00048 SEC_WINNT_AUTH_IDENTITY *identity);
00049
00050
00051 CURLcode Curl_create_sspi_identity(const char *userp, const char *passwdp,
00052 SEC_WINNT_AUTH_IDENTITY *identity);
00053
00054
00055 void Curl_sspi_free_identity(SEC_WINNT_AUTH_IDENTITY *identity);
00056
00057
00058 extern HMODULE s_hSecDll;
00059 extern PSecurityFunctionTable s_pSecFn;
00060
00061
00062 #define SP_NAME_DIGEST "WDigest"
00063 #define SP_NAME_NTLM "NTLM"
00064 #define SP_NAME_NEGOTIATE "Negotiate"
00065 #define SP_NAME_KERBEROS "Kerberos"
00066
00067 #ifndef ISC_REQ_USE_HTTP_STYLE
00068 #define ISC_REQ_USE_HTTP_STYLE 0x01000000
00069 #endif
00070
00071 #ifndef ISC_RET_REPLAY_DETECT
00072 #define ISC_RET_REPLAY_DETECT 0x00000004
00073 #endif
00074
00075 #ifndef ISC_RET_SEQUENCE_DETECT
00076 #define ISC_RET_SEQUENCE_DETECT 0x00000008
00077 #endif
00078
00079 #ifndef ISC_RET_CONFIDENTIALITY
00080 #define ISC_RET_CONFIDENTIALITY 0x00000010
00081 #endif
00082
00083 #ifndef ISC_RET_ALLOCATED_MEMORY
00084 #define ISC_RET_ALLOCATED_MEMORY 0x00000100
00085 #endif
00086
00087 #ifndef ISC_RET_STREAM
00088 #define ISC_RET_STREAM 0x00008000
00089 #endif
00090
00091 #ifndef SEC_E_INSUFFICIENT_MEMORY
00092 # define SEC_E_INSUFFICIENT_MEMORY ((HRESULT)0x80090300L)
00093 #endif
00094 #ifndef SEC_E_INVALID_HANDLE
00095 # define SEC_E_INVALID_HANDLE ((HRESULT)0x80090301L)
00096 #endif
00097 #ifndef SEC_E_UNSUPPORTED_FUNCTION
00098 # define SEC_E_UNSUPPORTED_FUNCTION ((HRESULT)0x80090302L)
00099 #endif
00100 #ifndef SEC_E_TARGET_UNKNOWN
00101 # define SEC_E_TARGET_UNKNOWN ((HRESULT)0x80090303L)
00102 #endif
00103 #ifndef SEC_E_INTERNAL_ERROR
00104 # define SEC_E_INTERNAL_ERROR ((HRESULT)0x80090304L)
00105 #endif
00106 #ifndef SEC_E_SECPKG_NOT_FOUND
00107 # define SEC_E_SECPKG_NOT_FOUND ((HRESULT)0x80090305L)
00108 #endif
00109 #ifndef SEC_E_NOT_OWNER
00110 # define SEC_E_NOT_OWNER ((HRESULT)0x80090306L)
00111 #endif
00112 #ifndef SEC_E_CANNOT_INSTALL
00113 # define SEC_E_CANNOT_INSTALL ((HRESULT)0x80090307L)
00114 #endif
00115 #ifndef SEC_E_INVALID_TOKEN
00116 # define SEC_E_INVALID_TOKEN ((HRESULT)0x80090308L)
00117 #endif
00118 #ifndef SEC_E_CANNOT_PACK
00119 # define SEC_E_CANNOT_PACK ((HRESULT)0x80090309L)
00120 #endif
00121 #ifndef SEC_E_QOP_NOT_SUPPORTED
00122 # define SEC_E_QOP_NOT_SUPPORTED ((HRESULT)0x8009030AL)
00123 #endif
00124 #ifndef SEC_E_NO_IMPERSONATION
00125 # define SEC_E_NO_IMPERSONATION ((HRESULT)0x8009030BL)
00126 #endif
00127 #ifndef SEC_E_LOGON_DENIED
00128 # define SEC_E_LOGON_DENIED ((HRESULT)0x8009030CL)
00129 #endif
00130 #ifndef SEC_E_UNKNOWN_CREDENTIALS
00131 # define SEC_E_UNKNOWN_CREDENTIALS ((HRESULT)0x8009030DL)
00132 #endif
00133 #ifndef SEC_E_NO_CREDENTIALS
00134 # define SEC_E_NO_CREDENTIALS ((HRESULT)0x8009030EL)
00135 #endif
00136 #ifndef SEC_E_MESSAGE_ALTERED
00137 # define SEC_E_MESSAGE_ALTERED ((HRESULT)0x8009030FL)
00138 #endif
00139 #ifndef SEC_E_OUT_OF_SEQUENCE
00140 # define SEC_E_OUT_OF_SEQUENCE ((HRESULT)0x80090310L)
00141 #endif
00142 #ifndef SEC_E_NO_AUTHENTICATING_AUTHORITY
00143 # define SEC_E_NO_AUTHENTICATING_AUTHORITY ((HRESULT)0x80090311L)
00144 #endif
00145 #ifndef SEC_E_BAD_PKGID
00146 # define SEC_E_BAD_PKGID ((HRESULT)0x80090316L)
00147 #endif
00148 #ifndef SEC_E_CONTEXT_EXPIRED
00149 # define SEC_E_CONTEXT_EXPIRED ((HRESULT)0x80090317L)
00150 #endif
00151 #ifndef SEC_E_INCOMPLETE_MESSAGE
00152 # define SEC_E_INCOMPLETE_MESSAGE ((HRESULT)0x80090318L)
00153 #endif
00154 #ifndef SEC_E_INCOMPLETE_CREDENTIALS
00155 # define SEC_E_INCOMPLETE_CREDENTIALS ((HRESULT)0x80090320L)
00156 #endif
00157 #ifndef SEC_E_BUFFER_TOO_SMALL
00158 # define SEC_E_BUFFER_TOO_SMALL ((HRESULT)0x80090321L)
00159 #endif
00160 #ifndef SEC_E_WRONG_PRINCIPAL
00161 # define SEC_E_WRONG_PRINCIPAL ((HRESULT)0x80090322L)
00162 #endif
00163 #ifndef SEC_E_TIME_SKEW
00164 # define SEC_E_TIME_SKEW ((HRESULT)0x80090324L)
00165 #endif
00166 #ifndef SEC_E_UNTRUSTED_ROOT
00167 # define SEC_E_UNTRUSTED_ROOT ((HRESULT)0x80090325L)
00168 #endif
00169 #ifndef SEC_E_ILLEGAL_MESSAGE
00170 # define SEC_E_ILLEGAL_MESSAGE ((HRESULT)0x80090326L)
00171 #endif
00172 #ifndef SEC_E_CERT_UNKNOWN
00173 # define SEC_E_CERT_UNKNOWN ((HRESULT)0x80090327L)
00174 #endif
00175 #ifndef SEC_E_CERT_EXPIRED
00176 # define SEC_E_CERT_EXPIRED ((HRESULT)0x80090328L)
00177 #endif
00178 #ifndef SEC_E_ENCRYPT_FAILURE
00179 # define SEC_E_ENCRYPT_FAILURE ((HRESULT)0x80090329L)
00180 #endif
00181 #ifndef SEC_E_DECRYPT_FAILURE
00182 # define SEC_E_DECRYPT_FAILURE ((HRESULT)0x80090330L)
00183 #endif
00184 #ifndef SEC_E_ALGORITHM_MISMATCH
00185 # define SEC_E_ALGORITHM_MISMATCH ((HRESULT)0x80090331L)
00186 #endif
00187 #ifndef SEC_E_SECURITY_QOS_FAILED
00188 # define SEC_E_SECURITY_QOS_FAILED ((HRESULT)0x80090332L)
00189 #endif
00190 #ifndef SEC_E_UNFINISHED_CONTEXT_DELETED
00191 # define SEC_E_UNFINISHED_CONTEXT_DELETED ((HRESULT)0x80090333L)
00192 #endif
00193 #ifndef SEC_E_NO_TGT_REPLY
00194 # define SEC_E_NO_TGT_REPLY ((HRESULT)0x80090334L)
00195 #endif
00196 #ifndef SEC_E_NO_IP_ADDRESSES
00197 # define SEC_E_NO_IP_ADDRESSES ((HRESULT)0x80090335L)
00198 #endif
00199 #ifndef SEC_E_WRONG_CREDENTIAL_HANDLE
00200 # define SEC_E_WRONG_CREDENTIAL_HANDLE ((HRESULT)0x80090336L)
00201 #endif
00202 #ifndef SEC_E_CRYPTO_SYSTEM_INVALID
00203 # define SEC_E_CRYPTO_SYSTEM_INVALID ((HRESULT)0x80090337L)
00204 #endif
00205 #ifndef SEC_E_MAX_REFERRALS_EXCEEDED
00206 # define SEC_E_MAX_REFERRALS_EXCEEDED ((HRESULT)0x80090338L)
00207 #endif
00208 #ifndef SEC_E_MUST_BE_KDC
00209 # define SEC_E_MUST_BE_KDC ((HRESULT)0x80090339L)
00210 #endif
00211 #ifndef SEC_E_STRONG_CRYPTO_NOT_SUPPORTED
00212 # define SEC_E_STRONG_CRYPTO_NOT_SUPPORTED ((HRESULT)0x8009033AL)
00213 #endif
00214 #ifndef SEC_E_TOO_MANY_PRINCIPALS
00215 # define SEC_E_TOO_MANY_PRINCIPALS ((HRESULT)0x8009033BL)
00216 #endif
00217 #ifndef SEC_E_NO_PA_DATA
00218 # define SEC_E_NO_PA_DATA ((HRESULT)0x8009033CL)
00219 #endif
00220 #ifndef SEC_E_PKINIT_NAME_MISMATCH
00221 # define SEC_E_PKINIT_NAME_MISMATCH ((HRESULT)0x8009033DL)
00222 #endif
00223 #ifndef SEC_E_SMARTCARD_LOGON_REQUIRED
00224 # define SEC_E_SMARTCARD_LOGON_REQUIRED ((HRESULT)0x8009033EL)
00225 #endif
00226 #ifndef SEC_E_SHUTDOWN_IN_PROGRESS
00227 # define SEC_E_SHUTDOWN_IN_PROGRESS ((HRESULT)0x8009033FL)
00228 #endif
00229 #ifndef SEC_E_KDC_INVALID_REQUEST
00230 # define SEC_E_KDC_INVALID_REQUEST ((HRESULT)0x80090340L)
00231 #endif
00232 #ifndef SEC_E_KDC_UNABLE_TO_REFER
00233 # define SEC_E_KDC_UNABLE_TO_REFER ((HRESULT)0x80090341L)
00234 #endif
00235 #ifndef SEC_E_KDC_UNKNOWN_ETYPE
00236 # define SEC_E_KDC_UNKNOWN_ETYPE ((HRESULT)0x80090342L)
00237 #endif
00238 #ifndef SEC_E_UNSUPPORTED_PREAUTH
00239 # define SEC_E_UNSUPPORTED_PREAUTH ((HRESULT)0x80090343L)
00240 #endif
00241 #ifndef SEC_E_DELEGATION_REQUIRED
00242 # define SEC_E_DELEGATION_REQUIRED ((HRESULT)0x80090345L)
00243 #endif
00244 #ifndef SEC_E_BAD_BINDINGS
00245 # define SEC_E_BAD_BINDINGS ((HRESULT)0x80090346L)
00246 #endif
00247 #ifndef SEC_E_MULTIPLE_ACCOUNTS
00248 # define SEC_E_MULTIPLE_ACCOUNTS ((HRESULT)0x80090347L)
00249 #endif
00250 #ifndef SEC_E_NO_KERB_KEY
00251 # define SEC_E_NO_KERB_KEY ((HRESULT)0x80090348L)
00252 #endif
00253 #ifndef SEC_E_CERT_WRONG_USAGE
00254 # define SEC_E_CERT_WRONG_USAGE ((HRESULT)0x80090349L)
00255 #endif
00256 #ifndef SEC_E_DOWNGRADE_DETECTED
00257 # define SEC_E_DOWNGRADE_DETECTED ((HRESULT)0x80090350L)
00258 #endif
00259 #ifndef SEC_E_SMARTCARD_CERT_REVOKED
00260 # define SEC_E_SMARTCARD_CERT_REVOKED ((HRESULT)0x80090351L)
00261 #endif
00262 #ifndef SEC_E_ISSUING_CA_UNTRUSTED
00263 # define SEC_E_ISSUING_CA_UNTRUSTED ((HRESULT)0x80090352L)
00264 #endif
00265 #ifndef SEC_E_REVOCATION_OFFLINE_C
00266 # define SEC_E_REVOCATION_OFFLINE_C ((HRESULT)0x80090353L)
00267 #endif
00268 #ifndef SEC_E_PKINIT_CLIENT_FAILURE
00269 # define SEC_E_PKINIT_CLIENT_FAILURE ((HRESULT)0x80090354L)
00270 #endif
00271 #ifndef SEC_E_SMARTCARD_CERT_EXPIRED
00272 # define SEC_E_SMARTCARD_CERT_EXPIRED ((HRESULT)0x80090355L)
00273 #endif
00274 #ifndef SEC_E_NO_S4U_PROT_SUPPORT
00275 # define SEC_E_NO_S4U_PROT_SUPPORT ((HRESULT)0x80090356L)
00276 #endif
00277 #ifndef SEC_E_CROSSREALM_DELEGATION_FAILURE
00278 # define SEC_E_CROSSREALM_DELEGATION_FAILURE ((HRESULT)0x80090357L)
00279 #endif
00280 #ifndef SEC_E_REVOCATION_OFFLINE_KDC
00281 # define SEC_E_REVOCATION_OFFLINE_KDC ((HRESULT)0x80090358L)
00282 #endif
00283 #ifndef SEC_E_ISSUING_CA_UNTRUSTED_KDC
00284 # define SEC_E_ISSUING_CA_UNTRUSTED_KDC ((HRESULT)0x80090359L)
00285 #endif
00286 #ifndef SEC_E_KDC_CERT_EXPIRED
00287 # define SEC_E_KDC_CERT_EXPIRED ((HRESULT)0x8009035AL)
00288 #endif
00289 #ifndef SEC_E_KDC_CERT_REVOKED
00290 # define SEC_E_KDC_CERT_REVOKED ((HRESULT)0x8009035BL)
00291 #endif
00292 #ifndef SEC_E_INVALID_PARAMETER
00293 # define SEC_E_INVALID_PARAMETER ((HRESULT)0x8009035DL)
00294 #endif
00295 #ifndef SEC_E_DELEGATION_POLICY
00296 # define SEC_E_DELEGATION_POLICY ((HRESULT)0x8009035EL)
00297 #endif
00298 #ifndef SEC_E_POLICY_NLTM_ONLY
00299 # define SEC_E_POLICY_NLTM_ONLY ((HRESULT)0x8009035FL)
00300 #endif
00301
00302 #ifndef SEC_I_CONTINUE_NEEDED
00303 # define SEC_I_CONTINUE_NEEDED ((HRESULT)0x00090312L)
00304 #endif
00305 #ifndef SEC_I_COMPLETE_NEEDED
00306 # define SEC_I_COMPLETE_NEEDED ((HRESULT)0x00090313L)
00307 #endif
00308 #ifndef SEC_I_COMPLETE_AND_CONTINUE
00309 # define SEC_I_COMPLETE_AND_CONTINUE ((HRESULT)0x00090314L)
00310 #endif
00311 #ifndef SEC_I_LOCAL_LOGON
00312 # define SEC_I_LOCAL_LOGON ((HRESULT)0x00090315L)
00313 #endif
00314 #ifndef SEC_I_CONTEXT_EXPIRED
00315 # define SEC_I_CONTEXT_EXPIRED ((HRESULT)0x00090317L)
00316 #endif
00317 #ifndef SEC_I_INCOMPLETE_CREDENTIALS
00318 # define SEC_I_INCOMPLETE_CREDENTIALS ((HRESULT)0x00090320L)
00319 #endif
00320 #ifndef SEC_I_RENEGOTIATE
00321 # define SEC_I_RENEGOTIATE ((HRESULT)0x00090321L)
00322 #endif
00323 #ifndef SEC_I_NO_LSA_CONTEXT
00324 # define SEC_I_NO_LSA_CONTEXT ((HRESULT)0x00090323L)
00325 #endif
00326 #ifndef SEC_I_SIGNATURE_NEEDED
00327 # define SEC_I_SIGNATURE_NEEDED ((HRESULT)0x0009035CL)
00328 #endif
00329
00330 #ifndef CRYPT_E_REVOKED
00331 # define CRYPT_E_REVOKED ((HRESULT)0x80092010L)
00332 #endif
00333
00334 #ifdef UNICODE
00335 # define SECFLAG_WINNT_AUTH_IDENTITY \
00336 (unsigned long)SEC_WINNT_AUTH_IDENTITY_UNICODE
00337 #else
00338 # define SECFLAG_WINNT_AUTH_IDENTITY \
00339 (unsigned long)SEC_WINNT_AUTH_IDENTITY_ANSI
00340 #endif
00341
00342
00343
00344
00345
00346 #define KERB_WRAP_NO_ENCRYPT 0x80000001
00347
00348 #endif
00349
00350 #endif