curl_ntlm_core.h
Go to the documentation of this file.
00001 #ifndef HEADER_CURL_NTLM_CORE_H
00002 #define HEADER_CURL_NTLM_CORE_H
00003 /***************************************************************************
00004  *                                  _   _ ____  _
00005  *  Project                     ___| | | |  _ \| |
00006  *                             / __| | | | |_) | |
00007  *                            | (__| |_| |  _ <| |___
00008  *                             \___|\___/|_| \_\_____|
00009  *
00010  * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
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_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 /* Define USE_NTRESPONSES to 1 in order to make the type-3 message include
00044  * the NT response message. */
00045 #ifndef USE_NTRESPONSES
00046 #define USE_NTRESPONSES 1
00047 #endif
00048 
00049 /* Define USE_NTLM2SESSION to 1 in order to make the type-3 message include the
00050    NTLM2Session response message, requires USE_NTRESPONSES defined to 1 and a
00051    Crypto engine that we have curl_ssl_md5sum() for. */
00052 #if !defined(USE_NTLM2SESSION) && USE_NTRESPONSES && !defined(USE_WIN32_CRYPTO)
00053 #define USE_NTLM2SESSION 1
00054 #endif
00055 
00056 /* Define USE_NTLM_V2 to 1 in order to allow the type-3 message to include the
00057    LMv2 and NTLMv2 response messages, requires USE_NTRESPONSES defined to 1
00058    and support for 64-bit integers. */
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 /* 21 bytes */);
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 /* 21 bytes */);
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 /* USE_NTLM_V2 && !USE_WINDOWS_SSPI */
00099 
00100 #endif /* USE_NTRESPONSES */
00101 
00102 #endif /* !USE_WINDOWS_SSPI || USE_WIN32_CRYPTO */
00103 
00104 #endif /* USE_NTLM */
00105 
00106 #endif /* HEADER_CURL_NTLM_CORE_H */


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