ENH: typo
[cmake.git] / Utilities / cmcurl / http_ntlm.h
blob868569ad3a6289ccfdb5c82955f40c4363b4ad07
1 #ifndef __HTTP_NTLM_H
2 #define __HTTP_NTLM_H
3 /***************************************************************************
4 * _ _ ____ _
5 * Project ___| | | | _ \| |
6 * / __| | | | |_) | |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
12 * This software is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
14 * are also available at http://curl.haxx.se/docs/copyright.html.
16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 * copies of the Software, and permit persons to whom the Software is
18 * furnished to do so, under the terms of the COPYING file.
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
23 * $Id: http_ntlm.h,v 1.2 2007-03-15 19:22:13 andy Exp $
24 ***************************************************************************/
26 typedef enum {
27 CURLNTLM_NONE, /* not a ntlm */
28 CURLNTLM_BAD, /* an ntlm, but one we don't like */
29 CURLNTLM_FIRST, /* the first 401-reply we got with NTLM */
30 CURLNTLM_FINE, /* an ntlm we act on */
32 CURLNTLM_LAST /* last entry in this enum, don't use */
33 } CURLntlm;
35 /* this is for ntlm header input */
36 CURLntlm Curl_input_ntlm(struct connectdata *conn, bool proxy, char *header);
38 /* this is for creating ntlm header output */
39 CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy);
41 void Curl_ntlm_cleanup(struct connectdata *conn);
42 #ifndef USE_NTLM
43 #define Curl_ntlm_cleanup(x)
44 #endif
47 /* Flag bits definitions based on http://davenport.sourceforge.net/ntlm.html */
49 #define NTLMFLAG_NEGOTIATE_UNICODE (1<<0)
50 /* Indicates that Unicode strings are supported for use in security buffer
51 data. */
53 #define NTLMFLAG_NEGOTIATE_OEM (1<<1)
54 /* Indicates that OEM strings are supported for use in security buffer data. */
56 #define NTLMFLAG_REQUEST_TARGET (1<<2)
57 /* Requests that the server's authentication realm be included in the Type 2
58 message. */
60 /* unknown (1<<3) */
61 #define NTLMFLAG_NEGOTIATE_SIGN (1<<4)
62 /* Specifies that authenticated communication between the client and server
63 should carry a digital signature (message integrity). */
65 #define NTLMFLAG_NEGOTIATE_SEAL (1<<5)
66 /* Specifies that authenticated communication between the client and server
67 should be encrypted (message confidentiality). */
69 #define NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE (1<<6)
70 /* unknown purpose */
72 #define NTLMFLAG_NEGOTIATE_LM_KEY (1<<7)
73 /* Indicates that the LAN Manager session key should be used for signing and
74 sealing authenticated communications. */
76 #define NTLMFLAG_NEGOTIATE_NETWARE (1<<8)
77 /* unknown purpose */
79 #define NTLMFLAG_NEGOTIATE_NTLM_KEY (1<<9)
80 /* Indicates that NTLM authentication is being used. */
82 /* unknown (1<<10) */
83 /* unknown (1<<11) */
85 #define NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED (1<<12)
86 /* Sent by the client in the Type 1 message to indicate that a desired
87 authentication realm is included in the message. */
89 #define NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED (1<<13)
90 /* Sent by the client in the Type 1 message to indicate that the client
91 workstation's name is included in the message. */
93 #define NTLMFLAG_NEGOTIATE_LOCAL_CALL (1<<14)
94 /* Sent by the server to indicate that the server and client are on the same
95 machine. Implies that the client may use a pre-established local security
96 context rather than responding to the challenge. */
98 #define NTLMFLAG_NEGOTIATE_ALWAYS_SIGN (1<<15)
99 /* Indicates that authenticated communication between the client and server
100 should be signed with a "dummy" signature. */
102 #define NTLMFLAG_TARGET_TYPE_DOMAIN (1<<16)
103 /* Sent by the server in the Type 2 message to indicate that the target
104 authentication realm is a domain. */
106 #define NTLMFLAG_TARGET_TYPE_SERVER (1<<17)
107 /* Sent by the server in the Type 2 message to indicate that the target
108 authentication realm is a server. */
110 #define NTLMFLAG_TARGET_TYPE_SHARE (1<<18)
111 /* Sent by the server in the Type 2 message to indicate that the target
112 authentication realm is a share. Presumably, this is for share-level
113 authentication. Usage is unclear. */
115 #define NTLMFLAG_NEGOTIATE_NTLM2_KEY (1<<19)
116 /* Indicates that the NTLM2 signing and sealing scheme should be used for
117 protecting authenticated communications. */
119 #define NTLMFLAG_REQUEST_INIT_RESPONSE (1<<20)
120 /* unknown purpose */
122 #define NTLMFLAG_REQUEST_ACCEPT_RESPONSE (1<<21)
123 /* unknown purpose */
125 #define NTLMFLAG_REQUEST_NONNT_SESSION_KEY (1<<22)
126 /* unknown purpose */
128 #define NTLMFLAG_NEGOTIATE_TARGET_INFO (1<<23)
129 /* Sent by the server in the Type 2 message to indicate that it is including a
130 Target Information block in the message. */
132 /* unknown (1<24) */
133 /* unknown (1<25) */
134 /* unknown (1<26) */
135 /* unknown (1<27) */
136 /* unknown (1<28) */
138 #define NTLMFLAG_NEGOTIATE_128 (1<<29)
139 /* Indicates that 128-bit encryption is supported. */
141 #define NTLMFLAG_NEGOTIATE_KEY_EXCHANGE (1<<30)
142 /* unknown purpose */
144 #define NTLMFLAG_NEGOTIATE_56 (1<<31)
145 /* Indicates that 56-bit encryption is supported. */
146 #endif