Go to the documentation of this file.00001 #ifndef HEADER_CURL_NTLM_CORE_H
00002 #define HEADER_CURL_NTLM_CORE_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 #if defined(USE_NTLM)
00028
00029 #if !defined(USE_WINDOWS_SSPI) || defined(USE_WIN32_CRYPTO)
00030
00031 #ifdef USE_OPENSSL
00032 # if !defined(OPENSSL_VERSION_NUMBER) && \
00033 !defined(HEADER_SSL_H) && !defined(HEADER_MD5_H)
00034 # error "curl_ntlm_core.h shall not be included before OpenSSL headers."
00035 # endif
00036 # ifdef OPENSSL_NO_MD4
00037 # define USE_NTRESPONSES 0
00038 # define USE_NTLM2SESSION 0
00039 # define USE_NTLM_V2 0
00040 # endif
00041 #endif
00042
00043
00044
00045 #ifndef USE_NTRESPONSES
00046 #define USE_NTRESPONSES 1
00047 #endif
00048
00049
00050
00051
00052 #if !defined(USE_NTLM2SESSION) && USE_NTRESPONSES && !defined(USE_WIN32_CRYPTO)
00053 #define USE_NTLM2SESSION 1
00054 #endif
00055
00056
00057
00058
00059 #if !defined(USE_NTLM_V2) && USE_NTRESPONSES && (CURL_SIZEOF_CURL_OFF_T > 4)
00060 #define USE_NTLM_V2 1
00061 #endif
00062
00063 void Curl_ntlm_core_lm_resp(const unsigned char *keys,
00064 const unsigned char *plaintext,
00065 unsigned char *results);
00066
00067 CURLcode Curl_ntlm_core_mk_lm_hash(struct Curl_easy *data,
00068 const char *password,
00069 unsigned char *lmbuffer );
00070
00071 #if USE_NTRESPONSES
00072 CURLcode Curl_ntlm_core_mk_nt_hash(struct Curl_easy *data,
00073 const char *password,
00074 unsigned char *ntbuffer );
00075
00076 #if USE_NTLM_V2 && !defined(USE_WINDOWS_SSPI)
00077
00078 CURLcode Curl_hmac_md5(const unsigned char *key, unsigned int keylen,
00079 const unsigned char *data, unsigned int datalen,
00080 unsigned char *output);
00081
00082 CURLcode Curl_ntlm_core_mk_ntlmv2_hash(const char *user, size_t userlen,
00083 const char *domain, size_t domlen,
00084 unsigned char *ntlmhash,
00085 unsigned char *ntlmv2hash);
00086
00087 CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash,
00088 unsigned char *challenge_client,
00089 struct ntlmdata *ntlm,
00090 unsigned char **ntresp,
00091 unsigned int *ntresp_len);
00092
00093 CURLcode Curl_ntlm_core_mk_lmv2_resp(unsigned char *ntlmv2hash,
00094 unsigned char *challenge_client,
00095 unsigned char *challenge_server,
00096 unsigned char *lmresp);
00097
00098 #endif
00099
00100 #endif
00101
00102 #endif
00103
00104 #endif
00105
00106 #endif