00001 #ifndef HEADER_CURL_NTLM_H 00002 #define HEADER_CURL_NTLM_H 00003 /*************************************************************************** 00004 * _ _ ____ _ 00005 * Project ___| | | | _ \| | 00006 * / __| | | | |_) | | 00007 * | (__| |_| | _ <| |___ 00008 * \___|\___/|_| \_\_____| 00009 * 00010 * Copyright (C) 1998 - 2016, 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 #ifdef USE_NTLM 00028 00029 /* NTLM buffer fixed size, large enough for long user + host + domain */ 00030 #define NTLM_BUFSIZE 1024 00031 00032 /* Stuff only required for curl_ntlm_msgs.c */ 00033 #ifdef BUILDING_CURL_NTLM_MSGS_C 00034 00035 /* Flag bits definitions based on http://davenport.sourceforge.net/ntlm.html */ 00036 00037 #define NTLMFLAG_NEGOTIATE_UNICODE (1<<0) 00038 /* Indicates that Unicode strings are supported for use in security buffer 00039 data. */ 00040 00041 #define NTLMFLAG_NEGOTIATE_OEM (1<<1) 00042 /* Indicates that OEM strings are supported for use in security buffer data. */ 00043 00044 #define NTLMFLAG_REQUEST_TARGET (1<<2) 00045 /* Requests that the server's authentication realm be included in the Type 2 00046 message. */ 00047 00048 /* unknown (1<<3) */ 00049 #define NTLMFLAG_NEGOTIATE_SIGN (1<<4) 00050 /* Specifies that authenticated communication between the client and server 00051 should carry a digital signature (message integrity). */ 00052 00053 #define NTLMFLAG_NEGOTIATE_SEAL (1<<5) 00054 /* Specifies that authenticated communication between the client and server 00055 should be encrypted (message confidentiality). */ 00056 00057 #define NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE (1<<6) 00058 /* Indicates that datagram authentication is being used. */ 00059 00060 #define NTLMFLAG_NEGOTIATE_LM_KEY (1<<7) 00061 /* Indicates that the LAN Manager session key should be used for signing and 00062 sealing authenticated communications. */ 00063 00064 #define NTLMFLAG_NEGOTIATE_NETWARE (1<<8) 00065 /* unknown purpose */ 00066 00067 #define NTLMFLAG_NEGOTIATE_NTLM_KEY (1<<9) 00068 /* Indicates that NTLM authentication is being used. */ 00069 00070 /* unknown (1<<10) */ 00071 00072 #define NTLMFLAG_NEGOTIATE_ANONYMOUS (1<<11) 00073 /* Sent by the client in the Type 3 message to indicate that an anonymous 00074 context has been established. This also affects the response fields. */ 00075 00076 #define NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED (1<<12) 00077 /* Sent by the client in the Type 1 message to indicate that a desired 00078 authentication realm is included in the message. */ 00079 00080 #define NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED (1<<13) 00081 /* Sent by the client in the Type 1 message to indicate that the client 00082 workstation's name is included in the message. */ 00083 00084 #define NTLMFLAG_NEGOTIATE_LOCAL_CALL (1<<14) 00085 /* Sent by the server to indicate that the server and client are on the same 00086 machine. Implies that the client may use a pre-established local security 00087 context rather than responding to the challenge. */ 00088 00089 #define NTLMFLAG_NEGOTIATE_ALWAYS_SIGN (1<<15) 00090 /* Indicates that authenticated communication between the client and server 00091 should be signed with a "dummy" signature. */ 00092 00093 #define NTLMFLAG_TARGET_TYPE_DOMAIN (1<<16) 00094 /* Sent by the server in the Type 2 message to indicate that the target 00095 authentication realm is a domain. */ 00096 00097 #define NTLMFLAG_TARGET_TYPE_SERVER (1<<17) 00098 /* Sent by the server in the Type 2 message to indicate that the target 00099 authentication realm is a server. */ 00100 00101 #define NTLMFLAG_TARGET_TYPE_SHARE (1<<18) 00102 /* Sent by the server in the Type 2 message to indicate that the target 00103 authentication realm is a share. Presumably, this is for share-level 00104 authentication. Usage is unclear. */ 00105 00106 #define NTLMFLAG_NEGOTIATE_NTLM2_KEY (1<<19) 00107 /* Indicates that the NTLM2 signing and sealing scheme should be used for 00108 protecting authenticated communications. */ 00109 00110 #define NTLMFLAG_REQUEST_INIT_RESPONSE (1<<20) 00111 /* unknown purpose */ 00112 00113 #define NTLMFLAG_REQUEST_ACCEPT_RESPONSE (1<<21) 00114 /* unknown purpose */ 00115 00116 #define NTLMFLAG_REQUEST_NONNT_SESSION_KEY (1<<22) 00117 /* unknown purpose */ 00118 00119 #define NTLMFLAG_NEGOTIATE_TARGET_INFO (1<<23) 00120 /* Sent by the server in the Type 2 message to indicate that it is including a 00121 Target Information block in the message. */ 00122 00123 /* unknown (1<24) */ 00124 /* unknown (1<25) */ 00125 /* unknown (1<26) */ 00126 /* unknown (1<27) */ 00127 /* unknown (1<28) */ 00128 00129 #define NTLMFLAG_NEGOTIATE_128 (1<<29) 00130 /* Indicates that 128-bit encryption is supported. */ 00131 00132 #define NTLMFLAG_NEGOTIATE_KEY_EXCHANGE (1<<30) 00133 /* Indicates that the client will provide an encrypted master key in 00134 the "Session Key" field of the Type 3 message. */ 00135 00136 #define NTLMFLAG_NEGOTIATE_56 (1<<31) 00137 /* Indicates that 56-bit encryption is supported. */ 00138 00139 #endif /* BUILDING_CURL_NTLM_MSGS_C */ 00140 00141 #endif /* USE_NTLM */ 00142 00143 #endif /* HEADER_CURL_NTLM_H */