1 /* header auto-generated by pidl */
5 #include "libcli/util/ntstatus.h"
7 #ifndef _HEADER_ntlmssp
8 #define _HEADER_ntlmssp
10 #define NTLMSSP_NEGOTIATE_NTLM2 ( NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY )
11 #define NTLMSSP_SIGN_VERSION ( 0x01 )
12 #define NTLMSSP_SIG_SIZE ( 16 )
13 enum ntlmssp_MessageType
14 #ifndef USE_UINT_ENUMS
16 NtLmNegotiate
=(int)(0x00000001),
17 NtLmChallenge
=(int)(0x00000002),
18 NtLmAuthenticate
=(int)(0x00000003)
21 { __donnot_use_enum_ntlmssp_MessageType
=0x7FFFFFFF}
22 #define NtLmNegotiate ( 0x00000001 )
23 #define NtLmChallenge ( 0x00000002 )
24 #define NtLmAuthenticate ( 0x00000003 )
28 /* bitmap NEGOTIATE */
29 #define NTLMSSP_NEGOTIATE_UNICODE ( 0x00000001 )
30 #define NTLMSSP_NEGOTIATE_OEM ( 0x00000002 )
31 #define NTLMSSP_REQUEST_TARGET ( 0x00000004 )
32 #define NTLMSSP_NEGOTIATE_SIGN ( 0x00000010 )
33 #define NTLMSSP_NEGOTIATE_SEAL ( 0x00000020 )
34 #define NTLMSSP_NEGOTIATE_DATAGRAM ( 0x00000040 )
35 #define NTLMSSP_NEGOTIATE_LM_KEY ( 0x00000080 )
36 #define NTLMSSP_NEGOTIATE_NETWARE ( 0x00000100 )
37 #define NTLMSSP_NEGOTIATE_NTLM ( 0x00000200 )
38 #define NTLMSSP_NEGOTIATE_NT_ONLY ( 0x00000400 )
39 #define NTLMSSP_ANONYMOUS ( 0x00000800 )
40 #define NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED ( 0x00001000 )
41 #define NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED ( 0x00002000 )
42 #define NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL ( 0x00004000 )
43 #define NTLMSSP_NEGOTIATE_ALWAYS_SIGN ( 0x00008000 )
44 #define NTLMSSP_TARGET_TYPE_DOMAIN ( 0x00010000 )
45 #define NTLMSSP_TARGET_TYPE_SERVER ( 0x00020000 )
46 #define NTLMSSP_TARGET_TYPE_SHARE ( 0x00040000 )
47 #define NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY ( 0x00080000 )
48 #define NTLMSSP_NEGOTIATE_IDENTIFY ( 0x00100000 )
49 #define NTLMSSP_REQUEST_NON_NT_SESSION_KEY ( 0x00400000 )
50 #define NTLMSSP_NEGOTIATE_TARGET_INFO ( 0x00800000 )
51 #define NTLMSSP_NEGOTIATE_VERSION ( 0x02000000 )
52 #define NTLMSSP_NEGOTIATE_128 ( 0x20000000 )
53 #define NTLMSSP_NEGOTIATE_KEY_EXCH ( 0x40000000 )
54 #define NTLMSSP_NEGOTIATE_56 ( 0x80000000 )
56 enum ntlmssp_WindowsMajorVersion
57 #ifndef USE_UINT_ENUMS
59 NTLMSSP_WINDOWS_MAJOR_VERSION_5
=(int)(0x05),
60 NTLMSSP_WINDOWS_MAJOR_VERSION_6
=(int)(0x06)
63 { __donnot_use_enum_ntlmssp_WindowsMajorVersion
=0x7FFFFFFF}
64 #define NTLMSSP_WINDOWS_MAJOR_VERSION_5 ( 0x05 )
65 #define NTLMSSP_WINDOWS_MAJOR_VERSION_6 ( 0x06 )
69 enum ntlmssp_WindowsMinorVersion
70 #ifndef USE_UINT_ENUMS
72 NTLMSSP_WINDOWS_MINOR_VERSION_0
=(int)(0x00),
73 NTLMSSP_WINDOWS_MINOR_VERSION_1
=(int)(0x01),
74 NTLMSSP_WINDOWS_MINOR_VERSION_2
=(int)(0x02)
77 { __donnot_use_enum_ntlmssp_WindowsMinorVersion
=0x7FFFFFFF}
78 #define NTLMSSP_WINDOWS_MINOR_VERSION_0 ( 0x00 )
79 #define NTLMSSP_WINDOWS_MINOR_VERSION_1 ( 0x01 )
80 #define NTLMSSP_WINDOWS_MINOR_VERSION_2 ( 0x02 )
84 enum ntlmssp_NTLMRevisionCurrent
85 #ifndef USE_UINT_ENUMS
87 NTLMSSP_REVISION_W2K3_RC1
=(int)(0x0A),
88 NTLMSSP_REVISION_W2K3
=(int)(0x0F)
91 { __donnot_use_enum_ntlmssp_NTLMRevisionCurrent
=0x7FFFFFFF}
92 #define NTLMSSP_REVISION_W2K3_RC1 ( 0x0A )
93 #define NTLMSSP_REVISION_W2K3 ( 0x0F )
98 enum ntlmssp_WindowsMajorVersion ProductMajorVersion
;
99 enum ntlmssp_WindowsMinorVersion ProductMinorVersion
;
100 uint16_t ProductBuild
;
102 enum ntlmssp_NTLMRevisionCurrent NTLMRevisionCurrent
;
105 union ntlmssp_Version
{
106 struct VERSION version
;/* [case(NTLMSSP_NEGOTIATE_VERSION)] */
107 }/* [noprint,nodiscriminant] */;
109 struct NEGOTIATE_MESSAGE
{
110 const char *Signature
;/* [value("NTLMSSP"),charset(DOS)] */
111 enum ntlmssp_MessageType MessageType
;/* [value(NtLmNegotiate)] */
112 uint32_t NegotiateFlags
;
113 uint16_t DomainNameLen
;/* [value(strlen(DomainName))] */
114 uint16_t DomainNameMaxLen
;/* [value(DomainNameLen)] */
115 const char * DomainName
;/* [relative,subcontext_size(DomainNameLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM))] */
116 uint16_t WorkstationLen
;/* [value(strlen(Workstation))] */
117 uint16_t WorkstationMaxLen
;/* [value(WorkstationLen)] */
118 const char * Workstation
;/* [relative,subcontext_size(WorkstationLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM))] */
119 union ntlmssp_Version Version
;/* [switch_is(NegotiateFlags&NTLMSSP_NEGOTIATE_VERSION)] */
123 #ifndef USE_UINT_ENUMS
126 MsvAvNbComputerName
=(int)(1),
127 MsvAvNbDomainName
=(int)(2),
128 MsvAvDnsComputerName
=(int)(3),
129 MsvAvDnsDomainName
=(int)(4),
130 MsvAvDnsTreeName
=(int)(5),
132 MsvAvTimestamp
=(int)(7),
133 MsAvRestrictions
=(int)(8),
134 MsvAvTargetName
=(int)(9),
135 MsvChannelBindings
=(int)(10)
138 { __donnot_use_enum_ntlmssp_AvId
=0x7FFFFFFF}
139 #define MsvAvEOL ( 0 )
140 #define MsvAvNbComputerName ( 1 )
141 #define MsvAvNbDomainName ( 2 )
142 #define MsvAvDnsComputerName ( 3 )
143 #define MsvAvDnsDomainName ( 4 )
144 #define MsvAvDnsTreeName ( 5 )
145 #define MsvAvFlags ( 6 )
146 #define MsvAvTimestamp ( 7 )
147 #define MsAvRestrictions ( 8 )
148 #define MsvAvTargetName ( 9 )
149 #define MsvChannelBindings ( 10 )
153 struct Restriction_Encoding
{
155 uint32_t Z4
;/* [value(0)] */
156 uint32_t IntegrityLevel
;
157 uint32_t SubjectIntegrityLevel
;
158 uint8_t MachineId
[32];
161 /* bitmap ntlmssp_AvFlags */
162 #define NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT ( 0x00000001 )
163 #define NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE ( 0x00000002 )
165 union ntlmssp_AvValue
{
166 const char * AvNbComputerName
;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvNbComputerName)] */
167 const char * AvNbDomainName
;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvNbDomainName)] */
168 const char * AvDnsComputerName
;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvDnsComputerName)] */
169 const char * AvDnsDomainName
;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvDnsDomainName)] */
170 const char * AvDnsTreeName
;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvDnsTreeName)] */
171 uint32_t AvFlags
;/* [case(MsvAvFlags)] */
172 NTTIME AvTimestamp
;/* [case(MsvAvTimestamp)] */
173 struct Restriction_Encoding AvRestrictions
;/* [case(MsAvRestrictions)] */
174 const char * AvTargetName
;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvTargetName)] */
175 uint8_t ChannelBindings
[16];/* [case(MsvChannelBindings)] */
176 DATA_BLOB blob
;/* [default,flag(LIBNDR_FLAG_REMAINING)] */
177 }/* [gensize,nodiscriminant,flag(LIBNDR_FLAG_NOALIGN)] */;
180 enum ntlmssp_AvId AvId
;
181 uint16_t AvLen
;/* [value(ndr_size_ntlmssp_AvValue(&r->Value,r->AvId,ndr->iconv_convenience,0))] */
182 union ntlmssp_AvValue Value
;/* [subcontext_size(AvLen),subcontext(0),switch_is(AvId)] */
183 }/* [public,flag(LIBNDR_FLAG_NOALIGN)] */;
185 struct AV_PAIR_LIST
{
187 struct AV_PAIR
*pair
;
188 }/* [gensize,nopull,nopush,flag(LIBNDR_FLAG_NOALIGN)] */;
190 struct CHALLENGE_MESSAGE
{
191 const char *Signature
;/* [value("NTLMSSP"),charset(DOS)] */
192 enum ntlmssp_MessageType MessageType
;/* [value(NtLmChallenge)] */
193 uint16_t TargetNameLen
;/* [value(ndr_ntlmssp_string_length(NegotiateFlags,TargetName))] */
194 uint16_t TargetNameMaxLen
;/* [value(TargetNameLen)] */
195 const char * TargetName
;/* [relative,subcontext_size(TargetNameLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] */
196 uint32_t NegotiateFlags
;
197 uint8_t ServerChallenge
[8];
199 uint16_t TargetInfoLen
;/* [value(ndr_size_AV_PAIR_LIST(TargetInfo,ndr->iconv_convenience,ndr->flags))] */
200 uint16_t TargetNameInfoMaxLen
;/* [value(TargetInfoLen)] */
201 struct AV_PAIR_LIST
*TargetInfo
;/* [relative,subcontext_size(TargetInfoLen),subcontext(0)] */
202 union ntlmssp_Version Version
;/* [switch_is(NegotiateFlags&NTLMSSP_NEGOTIATE_VERSION)] */
203 }/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;
206 uint8_t Response
[24];
207 }/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;
209 struct LMv2_RESPONSE
{
210 uint8_t Response
[16];
211 uint8_t ChallengeFromClient
[8];
212 }/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;
214 union ntlmssp_LM_RESPONSE
{
215 struct LM_RESPONSE v1
;/* [case(24)] */
216 }/* [nodiscriminant] */;
218 struct NTLM_RESPONSE
{
219 uint8_t Response
[24];
220 }/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;
222 struct NTLMv2_CLIENT_CHALLENGE
{
223 uint8_t RespType
;/* [value] */
224 uint8_t HiRespType
;/* [value] */
228 uint8_t ChallengeFromClient
[8];
230 struct AV_PAIR_LIST AvPairs
;/* [subcontext(0),flag(LIBNDR_FLAG_REMAINING)] */
231 }/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */;
233 struct NTLMv2_RESPONSE
{
234 uint8_t Response
[16];
235 struct NTLMv2_CLIENT_CHALLENGE Challenge
;
236 }/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;
238 union ntlmssp_NTLM_RESPONSE
{
239 struct NTLM_RESPONSE v1
;/* [case(0x18)] */
240 struct NTLMv2_RESPONSE v2
;/* [default] */
241 }/* [public,nodiscriminant] */;
245 }/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */;
247 struct AUTHENTICATE_MESSAGE
{
248 const char *Signature
;/* [value("NTLMSSP"),charset(DOS)] */
249 enum ntlmssp_MessageType MessageType
;/* [value(NtLmAuthenticate)] */
250 uint16_t LmChallengeResponseLen
;
251 uint16_t LmChallengeResponseMaxLen
;/* [value(LmChallengeResponseLen)] */
252 union ntlmssp_LM_RESPONSE
*LmChallengeResponse
;/* [relative,subcontext_size(LmChallengeResponseLen),subcontext(0),switch_is(LmChallengeResponseLen)] */
253 uint16_t NtChallengeResponseLen
;
254 uint16_t NtChallengeResponseMaxLen
;/* [value(NtChallengeResponseLen)] */
255 union ntlmssp_NTLM_RESPONSE
*NtChallengeResponse
;/* [relative,subcontext_size(NtChallengeResponseMaxLen),subcontext(0),switch_is(NtChallengeResponseLen)] */
256 uint16_t DomainNameLen
;/* [value(ndr_ntlmssp_string_length(NegotiateFlags,DomainName))] */
257 uint16_t DomainNameMaxLen
;/* [value(DomainNameLen)] */
258 const char * DomainName
;/* [relative,subcontext_size(DomainNameLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] */
259 uint16_t UserNameLen
;/* [value(ndr_ntlmssp_string_length(NegotiateFlags,UserName))] */
260 uint16_t UserNameMaxLen
;/* [value(UserNameLen)] */
261 const char * UserName
;/* [relative,subcontext_size(UserNameLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] */
262 uint16_t WorkstationLen
;/* [value(ndr_ntlmssp_string_length(NegotiateFlags,Workstation))] */
263 uint16_t WorkstationMaxLen
;/* [value(WorkstationLen)] */
264 const char * Workstation
;/* [relative,subcontext_size(WorkstationLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] */
265 uint16_t EncryptedRandomSessionKeyLen
;/* [value(EncryptedRandomSessionKey->length)] */
266 uint16_t EncryptedRandomSessionKeyMaxLen
;/* [value(EncryptedRandomSessionKeyLen)] */
267 DATA_BLOB
*EncryptedRandomSessionKey
;/* [relative,subcontext_size(EncryptedRandomSessionKeyLen),subcontext(0)] */
268 uint32_t NegotiateFlags
;
269 union ntlmssp_Version Version
;/* [switch_is(NegotiateFlags&NTLMSSP_NEGOTIATE_VERSION)] */
270 }/* [public,flag(LIBNDR_FLAG_REMAINING)] */;
272 struct NTLMSSP_MESSAGE_SIGNATURE
{
273 uint32_t Version
;/* [value(NTLMSSP_SIGN_VERSION)] */
279 struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2
{
280 uint32_t Version
;/* [value(NTLMSSP_SIGN_VERSION)] */
283 }/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;
286 struct decode_NEGOTIATE_MESSAGE
{
288 struct NEGOTIATE_MESSAGE negotiate
;
294 struct decode_CHALLENGE_MESSAGE
{
296 struct CHALLENGE_MESSAGE challenge
;
302 struct decode_AUTHENTICATE_MESSAGE
{
304 struct AUTHENTICATE_MESSAGE authenticate
;
310 struct decode_NTLMv2_CLIENT_CHALLENGE
{
312 struct NTLMv2_CLIENT_CHALLENGE challenge
;
317 #endif /* _HEADER_ntlmssp */