xref: /aosp_15_r20/external/curl/lib/vauth/ntlm.h (revision 6236dae45794135f37c4eb022389c904c8b0090d)
1*6236dae4SAndroid Build Coastguard Worker #ifndef HEADER_VAUTH_NTLM_H
2*6236dae4SAndroid Build Coastguard Worker #define HEADER_VAUTH_NTLM_H
3*6236dae4SAndroid Build Coastguard Worker /***************************************************************************
4*6236dae4SAndroid Build Coastguard Worker  *                                  _   _ ____  _
5*6236dae4SAndroid Build Coastguard Worker  *  Project                     ___| | | |  _ \| |
6*6236dae4SAndroid Build Coastguard Worker  *                             / __| | | | |_) | |
7*6236dae4SAndroid Build Coastguard Worker  *                            | (__| |_| |  _ <| |___
8*6236dae4SAndroid Build Coastguard Worker  *                             \___|\___/|_| \_\_____|
9*6236dae4SAndroid Build Coastguard Worker  *
10*6236dae4SAndroid Build Coastguard Worker  * Copyright (C) Daniel Stenberg, <[email protected]>, et al.
11*6236dae4SAndroid Build Coastguard Worker  *
12*6236dae4SAndroid Build Coastguard Worker  * This software is licensed as described in the file COPYING, which
13*6236dae4SAndroid Build Coastguard Worker  * you should have received as part of this distribution. The terms
14*6236dae4SAndroid Build Coastguard Worker  * are also available at https://curl.se/docs/copyright.html.
15*6236dae4SAndroid Build Coastguard Worker  *
16*6236dae4SAndroid Build Coastguard Worker  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17*6236dae4SAndroid Build Coastguard Worker  * copies of the Software, and permit persons to whom the Software is
18*6236dae4SAndroid Build Coastguard Worker  * furnished to do so, under the terms of the COPYING file.
19*6236dae4SAndroid Build Coastguard Worker  *
20*6236dae4SAndroid Build Coastguard Worker  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21*6236dae4SAndroid Build Coastguard Worker  * KIND, either express or implied.
22*6236dae4SAndroid Build Coastguard Worker  *
23*6236dae4SAndroid Build Coastguard Worker  * SPDX-License-Identifier: curl
24*6236dae4SAndroid Build Coastguard Worker  *
25*6236dae4SAndroid Build Coastguard Worker  ***************************************************************************/
26*6236dae4SAndroid Build Coastguard Worker 
27*6236dae4SAndroid Build Coastguard Worker #include "curl_setup.h"
28*6236dae4SAndroid Build Coastguard Worker 
29*6236dae4SAndroid Build Coastguard Worker #ifdef USE_NTLM
30*6236dae4SAndroid Build Coastguard Worker 
31*6236dae4SAndroid Build Coastguard Worker /* NTLM buffer fixed size, large enough for long user + host + domain */
32*6236dae4SAndroid Build Coastguard Worker #define NTLM_BUFSIZE 1024
33*6236dae4SAndroid Build Coastguard Worker 
34*6236dae4SAndroid Build Coastguard Worker /* Stuff only required for curl_ntlm_msgs.c */
35*6236dae4SAndroid Build Coastguard Worker #ifdef BUILDING_CURL_NTLM_MSGS_C
36*6236dae4SAndroid Build Coastguard Worker 
37*6236dae4SAndroid Build Coastguard Worker /* Flag bits definitions based on
38*6236dae4SAndroid Build Coastguard Worker    https://davenport.sourceforge.net/ntlm.html */
39*6236dae4SAndroid Build Coastguard Worker 
40*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_UNICODE               (1<<0)
41*6236dae4SAndroid Build Coastguard Worker /* Indicates that Unicode strings are supported for use in security buffer
42*6236dae4SAndroid Build Coastguard Worker    data. */
43*6236dae4SAndroid Build Coastguard Worker 
44*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_OEM                   (1<<1)
45*6236dae4SAndroid Build Coastguard Worker /* Indicates that OEM strings are supported for use in security buffer data. */
46*6236dae4SAndroid Build Coastguard Worker 
47*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_REQUEST_TARGET                  (1<<2)
48*6236dae4SAndroid Build Coastguard Worker /* Requests that the server's authentication realm be included in the Type 2
49*6236dae4SAndroid Build Coastguard Worker    message. */
50*6236dae4SAndroid Build Coastguard Worker 
51*6236dae4SAndroid Build Coastguard Worker /* unknown (1<<3) */
52*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_SIGN                  (1<<4)
53*6236dae4SAndroid Build Coastguard Worker /* Specifies that authenticated communication between the client and server
54*6236dae4SAndroid Build Coastguard Worker    should carry a digital signature (message integrity). */
55*6236dae4SAndroid Build Coastguard Worker 
56*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_SEAL                  (1<<5)
57*6236dae4SAndroid Build Coastguard Worker /* Specifies that authenticated communication between the client and server
58*6236dae4SAndroid Build Coastguard Worker    should be encrypted (message confidentiality). */
59*6236dae4SAndroid Build Coastguard Worker 
60*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE        (1<<6)
61*6236dae4SAndroid Build Coastguard Worker /* Indicates that datagram authentication is being used. */
62*6236dae4SAndroid Build Coastguard Worker 
63*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_LM_KEY                (1<<7)
64*6236dae4SAndroid Build Coastguard Worker /* Indicates that the LAN Manager session key should be used for signing and
65*6236dae4SAndroid Build Coastguard Worker    sealing authenticated communications. */
66*6236dae4SAndroid Build Coastguard Worker 
67*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_NTLM_KEY              (1<<9)
68*6236dae4SAndroid Build Coastguard Worker /* Indicates that NTLM authentication is being used. */
69*6236dae4SAndroid Build Coastguard Worker 
70*6236dae4SAndroid Build Coastguard Worker /* unknown (1<<10) */
71*6236dae4SAndroid Build Coastguard Worker 
72*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_ANONYMOUS             (1<<11)
73*6236dae4SAndroid Build Coastguard Worker /* Sent by the client in the Type 3 message to indicate that an anonymous
74*6236dae4SAndroid Build Coastguard Worker    context has been established. This also affects the response fields. */
75*6236dae4SAndroid Build Coastguard Worker 
76*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED       (1<<12)
77*6236dae4SAndroid Build Coastguard Worker /* Sent by the client in the Type 1 message to indicate that a desired
78*6236dae4SAndroid Build Coastguard Worker    authentication realm is included in the message. */
79*6236dae4SAndroid Build Coastguard Worker 
80*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED  (1<<13)
81*6236dae4SAndroid Build Coastguard Worker /* Sent by the client in the Type 1 message to indicate that the client
82*6236dae4SAndroid Build Coastguard Worker    workstation's name is included in the message. */
83*6236dae4SAndroid Build Coastguard Worker 
84*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_LOCAL_CALL            (1<<14)
85*6236dae4SAndroid Build Coastguard Worker /* Sent by the server to indicate that the server and client are on the same
86*6236dae4SAndroid Build Coastguard Worker    machine. Implies that the client may use a pre-established local security
87*6236dae4SAndroid Build Coastguard Worker    context rather than responding to the challenge. */
88*6236dae4SAndroid Build Coastguard Worker 
89*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_ALWAYS_SIGN           (1<<15)
90*6236dae4SAndroid Build Coastguard Worker /* Indicates that authenticated communication between the client and server
91*6236dae4SAndroid Build Coastguard Worker    should be signed with a "dummy" signature. */
92*6236dae4SAndroid Build Coastguard Worker 
93*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_TARGET_TYPE_DOMAIN              (1<<16)
94*6236dae4SAndroid Build Coastguard Worker /* Sent by the server in the Type 2 message to indicate that the target
95*6236dae4SAndroid Build Coastguard Worker    authentication realm is a domain. */
96*6236dae4SAndroid Build Coastguard Worker 
97*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_TARGET_TYPE_SERVER              (1<<17)
98*6236dae4SAndroid Build Coastguard Worker /* Sent by the server in the Type 2 message to indicate that the target
99*6236dae4SAndroid Build Coastguard Worker    authentication realm is a server. */
100*6236dae4SAndroid Build Coastguard Worker 
101*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_TARGET_TYPE_SHARE               (1<<18)
102*6236dae4SAndroid Build Coastguard Worker /* Sent by the server in the Type 2 message to indicate that the target
103*6236dae4SAndroid Build Coastguard Worker    authentication realm is a share. Presumably, this is for share-level
104*6236dae4SAndroid Build Coastguard Worker    authentication. Usage is unclear. */
105*6236dae4SAndroid Build Coastguard Worker 
106*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_NTLM2_KEY             (1<<19)
107*6236dae4SAndroid Build Coastguard Worker /* Indicates that the NTLM2 signing and sealing scheme should be used for
108*6236dae4SAndroid Build Coastguard Worker    protecting authenticated communications. */
109*6236dae4SAndroid Build Coastguard Worker 
110*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_REQUEST_INIT_RESPONSE           (1<<20)
111*6236dae4SAndroid Build Coastguard Worker /* unknown purpose */
112*6236dae4SAndroid Build Coastguard Worker 
113*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_REQUEST_ACCEPT_RESPONSE         (1<<21)
114*6236dae4SAndroid Build Coastguard Worker /* unknown purpose */
115*6236dae4SAndroid Build Coastguard Worker 
116*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_REQUEST_NONNT_SESSION_KEY       (1<<22)
117*6236dae4SAndroid Build Coastguard Worker /* unknown purpose */
118*6236dae4SAndroid Build Coastguard Worker 
119*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_TARGET_INFO           (1<<23)
120*6236dae4SAndroid Build Coastguard Worker /* Sent by the server in the Type 2 message to indicate that it is including a
121*6236dae4SAndroid Build Coastguard Worker    Target Information block in the message. */
122*6236dae4SAndroid Build Coastguard Worker 
123*6236dae4SAndroid Build Coastguard Worker /* unknown (1<24) */
124*6236dae4SAndroid Build Coastguard Worker /* unknown (1<25) */
125*6236dae4SAndroid Build Coastguard Worker /* unknown (1<26) */
126*6236dae4SAndroid Build Coastguard Worker /* unknown (1<27) */
127*6236dae4SAndroid Build Coastguard Worker /* unknown (1<28) */
128*6236dae4SAndroid Build Coastguard Worker 
129*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_128                   (1<<29)
130*6236dae4SAndroid Build Coastguard Worker /* Indicates that 128-bit encryption is supported. */
131*6236dae4SAndroid Build Coastguard Worker 
132*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_KEY_EXCHANGE          (1<<30)
133*6236dae4SAndroid Build Coastguard Worker /* Indicates that the client will provide an encrypted master key in
134*6236dae4SAndroid Build Coastguard Worker    the "Session Key" field of the Type 3 message. */
135*6236dae4SAndroid Build Coastguard Worker 
136*6236dae4SAndroid Build Coastguard Worker #define NTLMFLAG_NEGOTIATE_56                    (1<<31)
137*6236dae4SAndroid Build Coastguard Worker /* Indicates that 56-bit encryption is supported. */
138*6236dae4SAndroid Build Coastguard Worker 
139*6236dae4SAndroid Build Coastguard Worker #endif /* BUILDING_CURL_NTLM_MSGS_C */
140*6236dae4SAndroid Build Coastguard Worker 
141*6236dae4SAndroid Build Coastguard Worker #endif /* USE_NTLM */
142*6236dae4SAndroid Build Coastguard Worker 
143*6236dae4SAndroid Build Coastguard Worker #endif /* HEADER_VAUTH_NTLM_H */
144