summaryrefslogtreecommitdiff
path: root/librpc/gen_ndr/ntlmssp.h
blob: 5205dce57d3aea3f52b980f83a62e58ab6b26bda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
/* header auto-generated by pidl */

#include <stdint.h>

#include "libcli/util/ntstatus.h"

#ifndef _HEADER_ntlmssp
#define _HEADER_ntlmssp

#define NTLMSSP_NEGOTIATE_NTLM2	( NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY )
#define NTLMSSP_SIGN_VERSION	( 0x01 )
#define NTLMSSP_SIG_SIZE	( 16 )
enum ntlmssp_MessageType
#ifndef USE_UINT_ENUMS
 {
	NtLmNegotiate=0x00000001,
	NtLmChallenge=0x00000002,
	NtLmAuthenticate=0x00000003
}
#else
 { __donnot_use_enum_ntlmssp_MessageType=0x7FFFFFFF}
#define NtLmNegotiate ( 0x00000001 )
#define NtLmChallenge ( 0x00000002 )
#define NtLmAuthenticate ( 0x00000003 )
#endif
;

/* bitmap NEGOTIATE */
#define NTLMSSP_NEGOTIATE_UNICODE ( 0x00000001 )
#define NTLMSSP_NEGOTIATE_OEM ( 0x00000002 )
#define NTLMSSP_REQUEST_TARGET ( 0x00000004 )
#define NTLMSSP_NEGOTIATE_SIGN ( 0x00000010 )
#define NTLMSSP_NEGOTIATE_SEAL ( 0x00000020 )
#define NTLMSSP_NEGOTIATE_DATAGRAM ( 0x00000040 )
#define NTLMSSP_NEGOTIATE_LM_KEY ( 0x00000080 )
#define NTLMSSP_NEGOTIATE_NETWARE ( 0x00000100 )
#define NTLMSSP_NEGOTIATE_NTLM ( 0x00000200 )
#define NTLMSSP_NEGOTIATE_NT_ONLY ( 0x00000400 )
#define NTLMSSP_ANONYMOUS ( 0x00000800 )
#define NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED ( 0x00001000 )
#define NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED ( 0x00002000 )
#define NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL ( 0x00004000 )
#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN ( 0x00008000 )
#define NTLMSSP_TARGET_TYPE_DOMAIN ( 0x00010000 )
#define NTLMSSP_TARGET_TYPE_SERVER ( 0x00020000 )
#define NTLMSSP_TARGET_TYPE_SHARE ( 0x00040000 )
#define NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY ( 0x00080000 )
#define NTLMSSP_NEGOTIATE_IDENTIFY ( 0x00100000 )
#define NTLMSSP_REQUEST_NON_NT_SESSION_KEY ( 0x00400000 )
#define NTLMSSP_NEGOTIATE_TARGET_INFO ( 0x00800000 )
#define NTLMSSP_NEGOTIATE_VERSION ( 0x02000000 )
#define NTLMSSP_NEGOTIATE_128 ( 0x20000000 )
#define NTLMSSP_NEGOTIATE_KEY_EXCH ( 0x40000000 )
#define NTLMSSP_NEGOTIATE_56 ( 0x80000000 )

enum ntlmssp_WindowsMajorVersion
#ifndef USE_UINT_ENUMS
 {
	NTLMSSP_WINDOWS_MAJOR_VERSION_5=0x05,
	NTLMSSP_WINDOWS_MAJOR_VERSION_6=0x06
}
#else
 { __donnot_use_enum_ntlmssp_WindowsMajorVersion=0x7FFFFFFF}
#define NTLMSSP_WINDOWS_MAJOR_VERSION_5 ( 0x05 )
#define NTLMSSP_WINDOWS_MAJOR_VERSION_6 ( 0x06 )
#endif
;

enum ntlmssp_WindowsMinorVersion
#ifndef USE_UINT_ENUMS
 {
	NTLMSSP_WINDOWS_MINOR_VERSION_0=0x00,
	NTLMSSP_WINDOWS_MINOR_VERSION_1=0x01,
	NTLMSSP_WINDOWS_MINOR_VERSION_2=0x02
}
#else
 { __donnot_use_enum_ntlmssp_WindowsMinorVersion=0x7FFFFFFF}
#define NTLMSSP_WINDOWS_MINOR_VERSION_0 ( 0x00 )
#define NTLMSSP_WINDOWS_MINOR_VERSION_1 ( 0x01 )
#define NTLMSSP_WINDOWS_MINOR_VERSION_2 ( 0x02 )
#endif
;

enum ntlmssp_NTLMRevisionCurrent
#ifndef USE_UINT_ENUMS
 {
	NTLMSSP_REVISION_W2K3_RC1=0x0A,
	NTLMSSP_REVISION_W2K3=0x0F
}
#else
 { __donnot_use_enum_ntlmssp_NTLMRevisionCurrent=0x7FFFFFFF}
#define NTLMSSP_REVISION_W2K3_RC1 ( 0x0A )
#define NTLMSSP_REVISION_W2K3 ( 0x0F )
#endif
;

struct VERSION {
	enum ntlmssp_WindowsMajorVersion ProductMajorVersion;
	enum ntlmssp_WindowsMinorVersion ProductMinorVersion;
	uint16_t ProductBuild;
	uint8_t Reserved[3];
	enum ntlmssp_NTLMRevisionCurrent NTLMRevisionCurrent;
};

union ntlmssp_Version {
	struct VERSION version;/* [case(NTLMSSP_NEGOTIATE_VERSION)] */
}/* [noprint,nodiscriminant] */;

struct NEGOTIATE_MESSAGE {
	const char *Signature;/* [value("NTLMSSP"),charset(DOS)] */
	enum ntlmssp_MessageType MessageType;/* [value(NtLmNegotiate)] */
	uint32_t NegotiateFlags;
	uint16_t DomainNameLen;/* [value(strlen(DomainName))] */
	uint16_t DomainNameMaxLen;/* [value(DomainNameLen)] */
	const char * DomainName;/* [relative,subcontext_size(DomainNameLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM))] */
	uint16_t WorkstationLen;/* [value(strlen(Workstation))] */
	uint16_t WorkstationMaxLen;/* [value(WorkstationLen)] */
	const char * Workstation;/* [relative,subcontext_size(WorkstationLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM))] */
	union ntlmssp_Version Version;/* [switch_is(NegotiateFlags&NTLMSSP_NEGOTIATE_VERSION)] */
}/* [public] */;

enum ntlmssp_AvId
#ifndef USE_UINT_ENUMS
 {
	MsvAvEOL=0,
	MsvAvNbComputerName=1,
	MsvAvNbDomainName=2,
	MsvAvDnsComputerName=3,
	MsvAvDnsDomainName=4,
	MsvAvDnsTreeName=5,
	MsvAvFlags=6,
	MsvAvTimestamp=7,
	MsAvRestrictions=8,
	MsvAvTargetName=9,
	MsvChannelBindings=10
}
#else
 { __donnot_use_enum_ntlmssp_AvId=0x7FFFFFFF}
#define MsvAvEOL ( 0 )
#define MsvAvNbComputerName ( 1 )
#define MsvAvNbDomainName ( 2 )
#define MsvAvDnsComputerName ( 3 )
#define MsvAvDnsDomainName ( 4 )
#define MsvAvDnsTreeName ( 5 )
#define MsvAvFlags ( 6 )
#define MsvAvTimestamp ( 7 )
#define MsAvRestrictions ( 8 )
#define MsvAvTargetName ( 9 )
#define MsvChannelBindings ( 10 )
#endif
;

struct Restriction_Encoding {
	uint32_t Size;
	uint32_t Z4;/* [value(0)] */
	uint32_t IntegrityLevel;
	uint32_t SubjectIntegrityLevel;
	uint8_t MachineId[32];
};

/* bitmap ntlmssp_AvFlags */
#define NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT ( 0x00000001 )
#define NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE ( 0x00000002 )

union ntlmssp_AvValue {
	const char * AvNbComputerName;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvNbComputerName)] */
	const char * AvNbDomainName;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvNbDomainName)] */
	const char * AvDnsComputerName;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvDnsComputerName)] */
	const char * AvDnsDomainName;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvDnsDomainName)] */
	const char * AvDnsTreeName;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvDnsTreeName)] */
	uint32_t AvFlags;/* [case(MsvAvFlags)] */
	NTTIME AvTimestamp;/* [case(MsvAvTimestamp)] */
	struct Restriction_Encoding AvRestrictions;/* [case(MsAvRestrictions)] */
	const char * AvTargetName;/* [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE)),case(MsvAvTargetName)] */
	uint8_t ChannelBindings[16];/* [case(MsvChannelBindings)] */
	DATA_BLOB blob;/* [default,flag(LIBNDR_FLAG_REMAINING)] */
}/* [gensize,nodiscriminant,flag(LIBNDR_FLAG_NOALIGN)] */;

struct AV_PAIR {
	enum ntlmssp_AvId AvId;
	uint16_t AvLen;/* [value(ndr_size_ntlmssp_AvValue(&r->Value,r->AvId,ndr->iconv_convenience,0))] */
	union ntlmssp_AvValue Value;/* [subcontext_size(AvLen),subcontext(0),switch_is(AvId)] */
}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */;

struct AV_PAIR_LIST {
	uint32_t count;
	struct AV_PAIR *pair;
}/* [gensize,nopull,nopush,flag(LIBNDR_FLAG_NOALIGN)] */;

struct CHALLENGE_MESSAGE {
	const char *Signature;/* [value("NTLMSSP"),charset(DOS)] */
	enum ntlmssp_MessageType MessageType;/* [value(NtLmChallenge)] */
	uint16_t TargetNameLen;/* [value(ndr_ntlmssp_string_length(NegotiateFlags,TargetName))] */
	uint16_t TargetNameMaxLen;/* [value(TargetNameLen)] */
	const char * TargetName;/* [relative,subcontext_size(TargetNameLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] */
	uint32_t NegotiateFlags;
	uint8_t ServerChallenge[8];
	uint8_t Reserved[8];
	uint16_t TargetInfoLen;/* [value(ndr_size_AV_PAIR_LIST(TargetInfo,ndr->iconv_convenience,ndr->flags))] */
	uint16_t TargetNameInfoMaxLen;/* [value(TargetInfoLen)] */
	struct AV_PAIR_LIST *TargetInfo;/* [relative,subcontext_size(TargetInfoLen),subcontext(0)] */
	union ntlmssp_Version Version;/* [switch_is(NegotiateFlags&NTLMSSP_NEGOTIATE_VERSION)] */
}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;

struct LM_RESPONSE {
	uint8_t Response[24];
}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;

struct LMv2_RESPONSE {
	uint8_t Response[16];
	uint8_t ChallengeFromClient[8];
}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;

union ntlmssp_LM_RESPONSE {
	struct LM_RESPONSE v1;/* [case(24)] */
}/* [nodiscriminant] */;

struct NTLM_RESPONSE {
	uint8_t Response[24];
}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;

struct NTLMv2_CLIENT_CHALLENGE {
	uint8_t RespType;/* [value] */
	uint8_t HiRespType;/* [value] */
	uint16_t Reserved1;
	uint32_t Reserved2;
	NTTIME TimeStamp;
	uint8_t ChallengeFromClient[8];
	uint32_t Reserved3;
	struct AV_PAIR_LIST AvPairs;/* [subcontext(0),flag(LIBNDR_FLAG_REMAINING)] */
}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */;

struct NTLMv2_RESPONSE {
	uint8_t Response[16];
	struct NTLMv2_CLIENT_CHALLENGE Challenge;
}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;

union ntlmssp_NTLM_RESPONSE {
	struct NTLM_RESPONSE v1;/* [case(0x18)] */
	struct NTLMv2_RESPONSE v2;/* [default] */
}/* [public,nodiscriminant] */;

struct MIC {
	uint8_t MIC[16];
}/* [flag(LIBNDR_PRINT_ARRAY_HEX)] */;

struct AUTHENTICATE_MESSAGE {
	const char *Signature;/* [value("NTLMSSP"),charset(DOS)] */
	enum ntlmssp_MessageType MessageType;/* [value(NtLmAuthenticate)] */
	uint16_t LmChallengeResponseLen;
	uint16_t LmChallengeResponseMaxLen;/* [value(LmChallengeResponseLen)] */
	union ntlmssp_LM_RESPONSE *LmChallengeResponse;/* [relative,subcontext_size(LmChallengeResponseLen),subcontext(0),switch_is(LmChallengeResponseLen)] */
	uint16_t NtChallengeResponseLen;
	uint16_t NtChallengeResponseMaxLen;/* [value(NtChallengeResponseLen)] */
	union ntlmssp_NTLM_RESPONSE *NtChallengeResponse;/* [relative,subcontext_size(NtChallengeResponseMaxLen),subcontext(0),switch_is(NtChallengeResponseLen)] */
	uint16_t DomainNameLen;/* [value(ndr_ntlmssp_string_length(NegotiateFlags,DomainName))] */
	uint16_t DomainNameMaxLen;/* [value(DomainNameLen)] */
	const char * DomainName;/* [relative,subcontext_size(DomainNameLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] */
	uint16_t UserNameLen;/* [value(ndr_ntlmssp_string_length(NegotiateFlags,UserName))] */
	uint16_t UserNameMaxLen;/* [value(UserNameLen)] */
	const char * UserName;/* [relative,subcontext_size(UserNameLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] */
	uint16_t WorkstationLen;/* [value(ndr_ntlmssp_string_length(NegotiateFlags,Workstation))] */
	uint16_t WorkstationMaxLen;/* [value(WorkstationLen)] */
	const char * Workstation;/* [relative,subcontext_size(WorkstationLen),subcontext(0),flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] */
	uint16_t EncryptedRandomSessionKeyLen;/* [value(EncryptedRandomSessionKey->length)] */
	uint16_t EncryptedRandomSessionKeyMaxLen;/* [value(EncryptedRandomSessionKeyLen)] */
	DATA_BLOB *EncryptedRandomSessionKey;/* [relative,subcontext_size(EncryptedRandomSessionKeyLen),subcontext(0)] */
	uint32_t NegotiateFlags;
	union ntlmssp_Version Version;/* [switch_is(NegotiateFlags&NTLMSSP_NEGOTIATE_VERSION)] */
}/* [public,flag(LIBNDR_FLAG_REMAINING)] */;

struct NTLMSSP_MESSAGE_SIGNATURE {
	uint32_t Version;/* [value(NTLMSSP_SIGN_VERSION)] */
	uint32_t RandomPad;
	uint32_t Checksum;
	uint32_t SeqNum;
}/* [public] */;

struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 {
	uint32_t Version;/* [value(NTLMSSP_SIGN_VERSION)] */
	uint8_t Checksum[8];
	uint32_t SeqNum;
}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;


struct decode_NEGOTIATE_MESSAGE {
	struct {
		struct NEGOTIATE_MESSAGE negotiate;
	} in;

};


struct decode_CHALLENGE_MESSAGE {
	struct {
		struct CHALLENGE_MESSAGE challenge;
	} in;

};


struct decode_AUTHENTICATE_MESSAGE {
	struct {
		struct AUTHENTICATE_MESSAGE authenticate;
	} in;

};


struct decode_NTLMv2_CLIENT_CHALLENGE {
	struct {
		struct NTLMv2_CLIENT_CHALLENGE challenge;
	} in;

};

#endif /* _HEADER_ntlmssp */