Line data Source code
1 : /* parser auto-generated by pidl */
2 :
3 : #include "includes.h"
4 : #include "bin/default/librpc/gen_ndr/ndr_ntlmssp.h"
5 :
6 : #include "librpc/gen_ndr/ndr_security.h"
7 0 : static enum ndr_err_code ndr_push_ntlmssp_MessageType(struct ndr_push *ndr, int ndr_flags, enum ntlmssp_MessageType r)
8 : {
9 0 : NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
10 0 : return NDR_ERR_SUCCESS;
11 : }
12 :
13 0 : static enum ndr_err_code ndr_pull_ntlmssp_MessageType(struct ndr_pull *ndr, int ndr_flags, enum ntlmssp_MessageType *r)
14 : {
15 : uint32_t v;
16 0 : NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
17 0 : *r = v;
18 0 : return NDR_ERR_SUCCESS;
19 : }
20 :
21 0 : _PUBLIC_ void ndr_print_ntlmssp_MessageType(struct ndr_print *ndr, const char *name, enum ntlmssp_MessageType r)
22 : {
23 0 : const char *val = NULL;
24 :
25 0 : switch (r) {
26 0 : case NtLmNegotiate: val = "NtLmNegotiate"; break;
27 0 : case NtLmChallenge: val = "NtLmChallenge"; break;
28 0 : case NtLmAuthenticate: val = "NtLmAuthenticate"; break;
29 : }
30 0 : ndr_print_enum(ndr, name, "ENUM", val, r);
31 0 : }
32 :
33 0 : static enum ndr_err_code ndr_push_NEGOTIATE(struct ndr_push *ndr, int ndr_flags, uint32_t r)
34 : {
35 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
36 0 : return NDR_ERR_SUCCESS;
37 : }
38 :
39 0 : static enum ndr_err_code ndr_pull_NEGOTIATE(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
40 : {
41 : uint32_t v;
42 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
43 0 : *r = v;
44 0 : return NDR_ERR_SUCCESS;
45 : }
46 :
47 0 : _PUBLIC_ void ndr_print_NEGOTIATE(struct ndr_print *ndr, const char *name, uint32_t r)
48 : {
49 0 : ndr_print_uint32(ndr, name, r);
50 0 : ndr->depth++;
51 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_UNICODE", NTLMSSP_NEGOTIATE_UNICODE, r);
52 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_OEM", NTLMSSP_NEGOTIATE_OEM, r);
53 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_REQUEST_TARGET", NTLMSSP_REQUEST_TARGET, r);
54 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_SIGN", NTLMSSP_NEGOTIATE_SIGN, r);
55 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_SEAL", NTLMSSP_NEGOTIATE_SEAL, r);
56 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_DATAGRAM", NTLMSSP_NEGOTIATE_DATAGRAM, r);
57 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_LM_KEY", NTLMSSP_NEGOTIATE_LM_KEY, r);
58 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_NETWARE", NTLMSSP_NEGOTIATE_NETWARE, r);
59 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_NTLM", NTLMSSP_NEGOTIATE_NTLM, r);
60 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_NT_ONLY", NTLMSSP_NEGOTIATE_NT_ONLY, r);
61 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_ANONYMOUS", NTLMSSP_ANONYMOUS, r);
62 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED", NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED, r);
63 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED", NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED, r);
64 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL", NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL, r);
65 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_ALWAYS_SIGN", NTLMSSP_NEGOTIATE_ALWAYS_SIGN, r);
66 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_TARGET_TYPE_DOMAIN", NTLMSSP_TARGET_TYPE_DOMAIN, r);
67 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_TARGET_TYPE_SERVER", NTLMSSP_TARGET_TYPE_SERVER, r);
68 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_TARGET_TYPE_SHARE", NTLMSSP_TARGET_TYPE_SHARE, r);
69 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY", NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY, r);
70 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_IDENTIFY", NTLMSSP_NEGOTIATE_IDENTIFY, r);
71 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_REQUEST_NON_NT_SESSION_KEY", NTLMSSP_REQUEST_NON_NT_SESSION_KEY, r);
72 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_TARGET_INFO", NTLMSSP_NEGOTIATE_TARGET_INFO, r);
73 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_VERSION", NTLMSSP_NEGOTIATE_VERSION, r);
74 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_128", NTLMSSP_NEGOTIATE_128, r);
75 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_KEY_EXCH", NTLMSSP_NEGOTIATE_KEY_EXCH, r);
76 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_56", NTLMSSP_NEGOTIATE_56, r);
77 0 : ndr->depth--;
78 0 : }
79 :
80 0 : static enum ndr_err_code ndr_push_ntlmssp_WindowsMajorVersion(struct ndr_push *ndr, int ndr_flags, enum ntlmssp_WindowsMajorVersion r)
81 : {
82 0 : NDR_CHECK(ndr_push_enum_uint8(ndr, NDR_SCALARS, r));
83 0 : return NDR_ERR_SUCCESS;
84 : }
85 :
86 0 : static enum ndr_err_code ndr_pull_ntlmssp_WindowsMajorVersion(struct ndr_pull *ndr, int ndr_flags, enum ntlmssp_WindowsMajorVersion *r)
87 : {
88 : uint8_t v;
89 0 : NDR_CHECK(ndr_pull_enum_uint8(ndr, NDR_SCALARS, &v));
90 0 : *r = v;
91 0 : return NDR_ERR_SUCCESS;
92 : }
93 :
94 0 : _PUBLIC_ void ndr_print_ntlmssp_WindowsMajorVersion(struct ndr_print *ndr, const char *name, enum ntlmssp_WindowsMajorVersion r)
95 : {
96 0 : const char *val = NULL;
97 :
98 0 : switch (r) {
99 0 : case NTLMSSP_WINDOWS_MAJOR_VERSION_5: val = "NTLMSSP_WINDOWS_MAJOR_VERSION_5"; break;
100 0 : case NTLMSSP_WINDOWS_MAJOR_VERSION_6: val = "NTLMSSP_WINDOWS_MAJOR_VERSION_6"; break;
101 0 : case NTLMSSP_WINDOWS_MAJOR_VERSION_10: val = "NTLMSSP_WINDOWS_MAJOR_VERSION_10"; break;
102 : }
103 0 : ndr_print_enum(ndr, name, "ENUM", val, r);
104 0 : }
105 :
106 0 : static enum ndr_err_code ndr_push_ntlmssp_WindowsMinorVersion(struct ndr_push *ndr, int ndr_flags, enum ntlmssp_WindowsMinorVersion r)
107 : {
108 0 : NDR_CHECK(ndr_push_enum_uint8(ndr, NDR_SCALARS, r));
109 0 : return NDR_ERR_SUCCESS;
110 : }
111 :
112 0 : static enum ndr_err_code ndr_pull_ntlmssp_WindowsMinorVersion(struct ndr_pull *ndr, int ndr_flags, enum ntlmssp_WindowsMinorVersion *r)
113 : {
114 : uint8_t v;
115 0 : NDR_CHECK(ndr_pull_enum_uint8(ndr, NDR_SCALARS, &v));
116 0 : *r = v;
117 0 : return NDR_ERR_SUCCESS;
118 : }
119 :
120 0 : _PUBLIC_ void ndr_print_ntlmssp_WindowsMinorVersion(struct ndr_print *ndr, const char *name, enum ntlmssp_WindowsMinorVersion r)
121 : {
122 0 : const char *val = NULL;
123 :
124 0 : switch (r) {
125 0 : case NTLMSSP_WINDOWS_MINOR_VERSION_0: val = "NTLMSSP_WINDOWS_MINOR_VERSION_0"; break;
126 0 : case NTLMSSP_WINDOWS_MINOR_VERSION_1: val = "NTLMSSP_WINDOWS_MINOR_VERSION_1"; break;
127 0 : case NTLMSSP_WINDOWS_MINOR_VERSION_2: val = "NTLMSSP_WINDOWS_MINOR_VERSION_2"; break;
128 0 : case NTLMSSP_WINDOWS_MINOR_VERSION_3: val = "NTLMSSP_WINDOWS_MINOR_VERSION_3"; break;
129 : }
130 0 : ndr_print_enum(ndr, name, "ENUM", val, r);
131 0 : }
132 :
133 0 : static enum ndr_err_code ndr_push_ntlmssp_NTLMRevisionCurrent(struct ndr_push *ndr, int ndr_flags, enum ntlmssp_NTLMRevisionCurrent r)
134 : {
135 0 : NDR_CHECK(ndr_push_enum_uint8(ndr, NDR_SCALARS, r));
136 0 : return NDR_ERR_SUCCESS;
137 : }
138 :
139 0 : static enum ndr_err_code ndr_pull_ntlmssp_NTLMRevisionCurrent(struct ndr_pull *ndr, int ndr_flags, enum ntlmssp_NTLMRevisionCurrent *r)
140 : {
141 : uint8_t v;
142 0 : NDR_CHECK(ndr_pull_enum_uint8(ndr, NDR_SCALARS, &v));
143 0 : *r = v;
144 0 : return NDR_ERR_SUCCESS;
145 : }
146 :
147 0 : _PUBLIC_ void ndr_print_ntlmssp_NTLMRevisionCurrent(struct ndr_print *ndr, const char *name, enum ntlmssp_NTLMRevisionCurrent r)
148 : {
149 0 : const char *val = NULL;
150 :
151 0 : switch (r) {
152 0 : case NTLMSSP_REVISION_W2K3_RC1: val = "NTLMSSP_REVISION_W2K3_RC1"; break;
153 0 : case NTLMSSP_REVISION_W2K3: val = "NTLMSSP_REVISION_W2K3"; break;
154 : }
155 0 : ndr_print_enum(ndr, name, "ENUM", val, r);
156 0 : }
157 :
158 0 : _PUBLIC_ enum ndr_err_code ndr_push_ntlmssp_VERSION(struct ndr_push *ndr, int ndr_flags, const struct ntlmssp_VERSION *r)
159 : {
160 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
161 0 : if (ndr_flags & NDR_SCALARS) {
162 0 : NDR_CHECK(ndr_push_align(ndr, 2));
163 0 : NDR_CHECK(ndr_push_ntlmssp_WindowsMajorVersion(ndr, NDR_SCALARS, r->ProductMajorVersion));
164 0 : NDR_CHECK(ndr_push_ntlmssp_WindowsMinorVersion(ndr, NDR_SCALARS, r->ProductMinorVersion));
165 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ProductBuild));
166 0 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Reserved, 3));
167 0 : NDR_CHECK(ndr_push_ntlmssp_NTLMRevisionCurrent(ndr, NDR_SCALARS, r->NTLMRevisionCurrent));
168 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 2));
169 : }
170 0 : if (ndr_flags & NDR_BUFFERS) {
171 : }
172 0 : return NDR_ERR_SUCCESS;
173 : }
174 :
175 0 : _PUBLIC_ enum ndr_err_code ndr_pull_ntlmssp_VERSION(struct ndr_pull *ndr, int ndr_flags, struct ntlmssp_VERSION *r)
176 : {
177 0 : uint32_t size_Reserved_0 = 0;
178 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
179 0 : if (ndr_flags & NDR_SCALARS) {
180 0 : NDR_CHECK(ndr_pull_align(ndr, 2));
181 0 : NDR_CHECK(ndr_pull_ntlmssp_WindowsMajorVersion(ndr, NDR_SCALARS, &r->ProductMajorVersion));
182 0 : NDR_CHECK(ndr_pull_ntlmssp_WindowsMinorVersion(ndr, NDR_SCALARS, &r->ProductMinorVersion));
183 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ProductBuild));
184 0 : size_Reserved_0 = 3;
185 0 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Reserved, size_Reserved_0));
186 0 : NDR_CHECK(ndr_pull_ntlmssp_NTLMRevisionCurrent(ndr, NDR_SCALARS, &r->NTLMRevisionCurrent));
187 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 2));
188 : }
189 0 : if (ndr_flags & NDR_BUFFERS) {
190 : }
191 0 : return NDR_ERR_SUCCESS;
192 : }
193 :
194 0 : static void ndr_print_flags_ntlmssp_VERSION(struct ndr_print *ndr, const char *name, int unused, const struct ntlmssp_VERSION *r)
195 : {
196 0 : ndr_print_ntlmssp_VERSION(ndr, name, r);
197 0 : }
198 :
199 0 : _PUBLIC_ void ndr_print_ntlmssp_VERSION(struct ndr_print *ndr, const char *name, const struct ntlmssp_VERSION *r)
200 : {
201 0 : ndr_print_struct(ndr, name, "ntlmssp_VERSION");
202 0 : if (r == NULL) { ndr_print_null(ndr); return; }
203 0 : ndr->depth++;
204 0 : ndr_print_ntlmssp_WindowsMajorVersion(ndr, "ProductMajorVersion", r->ProductMajorVersion);
205 0 : ndr_print_ntlmssp_WindowsMinorVersion(ndr, "ProductMinorVersion", r->ProductMinorVersion);
206 0 : ndr_print_uint16(ndr, "ProductBuild", r->ProductBuild);
207 0 : ndr_print_array_uint8(ndr, "Reserved", r->Reserved, 3);
208 0 : ndr_print_ntlmssp_NTLMRevisionCurrent(ndr, "NTLMRevisionCurrent", r->NTLMRevisionCurrent);
209 0 : ndr->depth--;
210 : }
211 :
212 0 : static enum ndr_err_code ndr_push_ntlmssp_Version(struct ndr_push *ndr, int ndr_flags, const union ntlmssp_Version *r)
213 : {
214 : uint32_t level;
215 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
216 0 : if (ndr_flags & NDR_SCALARS) {
217 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
218 0 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
219 0 : NDR_CHECK(ndr_push_union_align(ndr, 2));
220 0 : switch (level) {
221 0 : case NTLMSSP_NEGOTIATE_VERSION: {
222 0 : NDR_CHECK(ndr_push_ntlmssp_VERSION(ndr, NDR_SCALARS, &r->version));
223 0 : break; }
224 :
225 0 : default: {
226 0 : break; }
227 :
228 : }
229 0 : }
230 0 : return NDR_ERR_SUCCESS;
231 : }
232 :
233 0 : static enum ndr_err_code ndr_pull_ntlmssp_Version(struct ndr_pull *ndr, int ndr_flags, union ntlmssp_Version *r)
234 : {
235 : uint32_t level;
236 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
237 0 : if (ndr_flags & NDR_SCALARS) {
238 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
239 0 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
240 0 : NDR_CHECK(ndr_pull_union_align(ndr, 2));
241 0 : switch (level) {
242 0 : case NTLMSSP_NEGOTIATE_VERSION: {
243 0 : NDR_CHECK(ndr_pull_ntlmssp_VERSION(ndr, NDR_SCALARS, &r->version));
244 0 : break; }
245 :
246 0 : default: {
247 0 : break; }
248 :
249 : }
250 0 : }
251 0 : return NDR_ERR_SUCCESS;
252 : }
253 :
254 0 : _PUBLIC_ enum ndr_err_code ndr_push_NEGOTIATE_MESSAGE(struct ndr_push *ndr, int ndr_flags, const struct NEGOTIATE_MESSAGE *r)
255 : {
256 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
257 0 : if (ndr_flags & NDR_SCALARS) {
258 0 : NDR_CHECK(ndr_push_align(ndr, 5));
259 0 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "NTLMSSP", 8, sizeof(uint8_t), CH_DOS));
260 0 : NDR_CHECK(ndr_push_ntlmssp_MessageType(ndr, NDR_SCALARS, NtLmNegotiate));
261 0 : NDR_CHECK(ndr_push_NEGOTIATE(ndr, NDR_SCALARS, r->NegotiateFlags));
262 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->DomainName?strlen(r->DomainName):0));
263 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->DomainName?strlen(r->DomainName):0));
264 : {
265 0 : uint32_t _flags_save_string = ndr->flags;
266 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM));
267 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->DomainName));
268 0 : ndr->flags = _flags_save_string;
269 : }
270 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Workstation?strlen(r->Workstation):0));
271 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Workstation?strlen(r->Workstation):0));
272 : {
273 0 : uint32_t _flags_save_string = ndr->flags;
274 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM));
275 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->Workstation));
276 0 : ndr->flags = _flags_save_string;
277 : }
278 0 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION));
279 0 : NDR_CHECK(ndr_push_ntlmssp_Version(ndr, NDR_SCALARS, &r->Version));
280 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
281 : }
282 0 : if (ndr_flags & NDR_BUFFERS) {
283 : {
284 0 : uint32_t _flags_save_string = ndr->flags;
285 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM));
286 0 : if (r->DomainName) {
287 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->DomainName));
288 : {
289 : struct ndr_push *_ndr_DomainName;
290 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_DomainName, 0, r->DomainName?strlen(r->DomainName):0));
291 0 : NDR_CHECK(ndr_push_string(_ndr_DomainName, NDR_SCALARS, r->DomainName));
292 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_DomainName, 0, r->DomainName?strlen(r->DomainName):0));
293 : }
294 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->DomainName));
295 : }
296 0 : ndr->flags = _flags_save_string;
297 : }
298 : {
299 0 : uint32_t _flags_save_string = ndr->flags;
300 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM));
301 0 : if (r->Workstation) {
302 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->Workstation));
303 : {
304 : struct ndr_push *_ndr_Workstation;
305 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_Workstation, 0, r->Workstation?strlen(r->Workstation):0));
306 0 : NDR_CHECK(ndr_push_string(_ndr_Workstation, NDR_SCALARS, r->Workstation));
307 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_Workstation, 0, r->Workstation?strlen(r->Workstation):0));
308 : }
309 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->Workstation));
310 : }
311 0 : ndr->flags = _flags_save_string;
312 : }
313 0 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION));
314 0 : NDR_CHECK(ndr_push_ntlmssp_Version(ndr, NDR_BUFFERS, &r->Version));
315 : }
316 0 : return NDR_ERR_SUCCESS;
317 : }
318 :
319 0 : _PUBLIC_ enum ndr_err_code ndr_pull_NEGOTIATE_MESSAGE(struct ndr_pull *ndr, int ndr_flags, struct NEGOTIATE_MESSAGE *r)
320 : {
321 0 : uint32_t size_Signature_0 = 0;
322 : uint32_t _ptr_DomainName;
323 0 : TALLOC_CTX *_mem_save_DomainName_0 = NULL;
324 : uint32_t _ptr_Workstation;
325 0 : TALLOC_CTX *_mem_save_Workstation_0 = NULL;
326 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
327 0 : if (ndr_flags & NDR_SCALARS) {
328 0 : NDR_CHECK(ndr_pull_align(ndr, 5));
329 0 : size_Signature_0 = 8;
330 0 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->Signature, size_Signature_0, sizeof(uint8_t), CH_DOS));
331 0 : NDR_CHECK(ndr_pull_ntlmssp_MessageType(ndr, NDR_SCALARS, &r->MessageType));
332 0 : NDR_CHECK(ndr_pull_NEGOTIATE(ndr, NDR_SCALARS, &r->NegotiateFlags));
333 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->DomainNameLen));
334 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->DomainNameMaxLen));
335 : {
336 0 : uint32_t _flags_save_string = ndr->flags;
337 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM));
338 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DomainName));
339 0 : if (_ptr_DomainName) {
340 0 : NDR_PULL_ALLOC(ndr, r->DomainName);
341 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->DomainName, _ptr_DomainName));
342 : } else {
343 0 : r->DomainName = NULL;
344 : }
345 0 : ndr->flags = _flags_save_string;
346 : }
347 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->WorkstationLen));
348 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->WorkstationMaxLen));
349 : {
350 0 : uint32_t _flags_save_string = ndr->flags;
351 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM));
352 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Workstation));
353 0 : if (_ptr_Workstation) {
354 0 : NDR_PULL_ALLOC(ndr, r->Workstation);
355 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->Workstation, _ptr_Workstation));
356 : } else {
357 0 : r->Workstation = NULL;
358 : }
359 0 : ndr->flags = _flags_save_string;
360 : }
361 0 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION));
362 0 : NDR_CHECK(ndr_pull_ntlmssp_Version(ndr, NDR_SCALARS, &r->Version));
363 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
364 : }
365 0 : if (ndr_flags & NDR_BUFFERS) {
366 : {
367 0 : uint32_t _flags_save_string = ndr->flags;
368 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM));
369 0 : if (r->DomainName) {
370 : uint32_t _relative_save_offset;
371 0 : _relative_save_offset = ndr->offset;
372 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->DomainName));
373 0 : _mem_save_DomainName_0 = NDR_PULL_GET_MEM_CTX(ndr);
374 0 : NDR_PULL_SET_MEM_CTX(ndr, r->DomainName, 0);
375 : {
376 : struct ndr_pull *_ndr_DomainName;
377 0 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_DomainName, 0, r->DomainNameLen));
378 0 : NDR_CHECK(ndr_pull_string(_ndr_DomainName, NDR_SCALARS, &r->DomainName));
379 0 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_DomainName, 0, r->DomainNameLen));
380 : }
381 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DomainName_0, 0);
382 0 : if (ndr->offset > ndr->relative_highest_offset) {
383 0 : ndr->relative_highest_offset = ndr->offset;
384 : }
385 0 : ndr->offset = _relative_save_offset;
386 : }
387 0 : ndr->flags = _flags_save_string;
388 : }
389 : {
390 0 : uint32_t _flags_save_string = ndr->flags;
391 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM));
392 0 : if (r->Workstation) {
393 : uint32_t _relative_save_offset;
394 0 : _relative_save_offset = ndr->offset;
395 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->Workstation));
396 0 : _mem_save_Workstation_0 = NDR_PULL_GET_MEM_CTX(ndr);
397 0 : NDR_PULL_SET_MEM_CTX(ndr, r->Workstation, 0);
398 : {
399 : struct ndr_pull *_ndr_Workstation;
400 0 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_Workstation, 0, r->WorkstationLen));
401 0 : NDR_CHECK(ndr_pull_string(_ndr_Workstation, NDR_SCALARS, &r->Workstation));
402 0 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_Workstation, 0, r->WorkstationLen));
403 : }
404 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Workstation_0, 0);
405 0 : if (ndr->offset > ndr->relative_highest_offset) {
406 0 : ndr->relative_highest_offset = ndr->offset;
407 : }
408 0 : ndr->offset = _relative_save_offset;
409 : }
410 0 : ndr->flags = _flags_save_string;
411 : }
412 0 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION));
413 0 : NDR_CHECK(ndr_pull_ntlmssp_Version(ndr, NDR_BUFFERS, &r->Version));
414 : }
415 0 : return NDR_ERR_SUCCESS;
416 : }
417 :
418 0 : static void ndr_print_flags_NEGOTIATE_MESSAGE(struct ndr_print *ndr, const char *name, int unused, const struct NEGOTIATE_MESSAGE *r)
419 : {
420 0 : ndr_print_NEGOTIATE_MESSAGE(ndr, name, r);
421 0 : }
422 :
423 0 : _PUBLIC_ void ndr_print_NEGOTIATE_MESSAGE(struct ndr_print *ndr, const char *name, const struct NEGOTIATE_MESSAGE *r)
424 : {
425 0 : ndr_print_struct(ndr, name, "NEGOTIATE_MESSAGE");
426 0 : if (r == NULL) { ndr_print_null(ndr); return; }
427 0 : ndr->depth++;
428 0 : ndr_print_string(ndr, "Signature", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?"NTLMSSP":r->Signature);
429 0 : ndr_print_ntlmssp_MessageType(ndr, "MessageType", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NtLmNegotiate:r->MessageType);
430 0 : ndr_print_NEGOTIATE(ndr, "NegotiateFlags", r->NegotiateFlags);
431 0 : ndr_print_uint16(ndr, "DomainNameLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->DomainName?strlen(r->DomainName):0:r->DomainNameLen);
432 0 : ndr_print_uint16(ndr, "DomainNameMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->DomainNameLen:r->DomainNameMaxLen);
433 : {
434 0 : uint32_t _flags_save_string = ndr->flags;
435 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM));
436 0 : ndr_print_ptr(ndr, "DomainName", r->DomainName);
437 0 : ndr->depth++;
438 0 : if (r->DomainName) {
439 0 : ndr_print_string(ndr, "DomainName", r->DomainName);
440 : }
441 0 : ndr->depth--;
442 0 : ndr->flags = _flags_save_string;
443 : }
444 0 : ndr_print_uint16(ndr, "WorkstationLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->Workstation?strlen(r->Workstation):0:r->WorkstationLen);
445 0 : ndr_print_uint16(ndr, "WorkstationMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->WorkstationLen:r->WorkstationMaxLen);
446 : {
447 0 : uint32_t _flags_save_string = ndr->flags;
448 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM));
449 0 : ndr_print_ptr(ndr, "Workstation", r->Workstation);
450 0 : ndr->depth++;
451 0 : if (r->Workstation) {
452 0 : ndr_print_string(ndr, "Workstation", r->Workstation);
453 : }
454 0 : ndr->depth--;
455 0 : ndr->flags = _flags_save_string;
456 : }
457 0 : ndr_print_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION);
458 0 : ndr_print_ntlmssp_Version(ndr, "Version", &r->Version);
459 0 : ndr->depth--;
460 : }
461 :
462 154457 : static enum ndr_err_code ndr_push_ntlmssp_AvId(struct ndr_push *ndr, int ndr_flags, enum ntlmssp_AvId r)
463 : {
464 154457 : NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
465 154457 : return NDR_ERR_SUCCESS;
466 : }
467 :
468 167718 : static enum ndr_err_code ndr_pull_ntlmssp_AvId(struct ndr_pull *ndr, int ndr_flags, enum ntlmssp_AvId *r)
469 : {
470 : uint16_t v;
471 167718 : NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
472 167718 : *r = v;
473 167718 : return NDR_ERR_SUCCESS;
474 : }
475 :
476 0 : _PUBLIC_ void ndr_print_ntlmssp_AvId(struct ndr_print *ndr, const char *name, enum ntlmssp_AvId r)
477 : {
478 0 : const char *val = NULL;
479 :
480 0 : switch (r) {
481 0 : case MsvAvEOL: val = "MsvAvEOL"; break;
482 0 : case MsvAvNbComputerName: val = "MsvAvNbComputerName"; break;
483 0 : case MsvAvNbDomainName: val = "MsvAvNbDomainName"; break;
484 0 : case MsvAvDnsComputerName: val = "MsvAvDnsComputerName"; break;
485 0 : case MsvAvDnsDomainName: val = "MsvAvDnsDomainName"; break;
486 0 : case MsvAvDnsTreeName: val = "MsvAvDnsTreeName"; break;
487 0 : case MsvAvFlags: val = "MsvAvFlags"; break;
488 0 : case MsvAvTimestamp: val = "MsvAvTimestamp"; break;
489 0 : case MsvAvSingleHost: val = "MsvAvSingleHost"; break;
490 0 : case MsvAvTargetName: val = "MsvAvTargetName"; break;
491 0 : case MsvChannelBindings: val = "MsvChannelBindings"; break;
492 : }
493 0 : ndr_print_enum(ndr, name, "ENUM", val, r);
494 0 : }
495 :
496 38732 : static enum ndr_err_code ndr_push_ntlmssp_SingleHostData(struct ndr_push *ndr, int ndr_flags, const struct ntlmssp_SingleHostData *r)
497 : {
498 : {
499 38732 : uint32_t _flags_save_STRUCT = ndr->flags;
500 38732 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
501 38732 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
502 38732 : if (ndr_flags & NDR_SCALARS) {
503 38732 : NDR_CHECK(ndr_push_align(ndr, 4));
504 38732 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 8 + ndr_size_LSAP_TOKEN_INFO_INTEGRITY(&r->token_info, 0) + r->remaining.length));
505 38732 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
506 38732 : NDR_CHECK(ndr_push_LSAP_TOKEN_INFO_INTEGRITY(ndr, NDR_SCALARS, &r->token_info));
507 : {
508 38732 : uint32_t _flags_save_DATA_BLOB = ndr->flags;
509 38732 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
510 38732 : NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->remaining));
511 38732 : ndr->flags = _flags_save_DATA_BLOB;
512 : }
513 38732 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
514 : }
515 38732 : if (ndr_flags & NDR_BUFFERS) {
516 : }
517 38732 : ndr->flags = _flags_save_STRUCT;
518 : }
519 38732 : return NDR_ERR_SUCCESS;
520 : }
521 :
522 9871 : static enum ndr_err_code ndr_pull_ntlmssp_SingleHostData(struct ndr_pull *ndr, int ndr_flags, struct ntlmssp_SingleHostData *r)
523 : {
524 : {
525 9871 : uint32_t _flags_save_STRUCT = ndr->flags;
526 9871 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
527 9871 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
528 9871 : if (ndr_flags & NDR_SCALARS) {
529 9871 : NDR_CHECK(ndr_pull_align(ndr, 4));
530 9871 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Size));
531 9871 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Z4));
532 9871 : NDR_CHECK(ndr_pull_LSAP_TOKEN_INFO_INTEGRITY(ndr, NDR_SCALARS, &r->token_info));
533 : {
534 9871 : uint32_t _flags_save_DATA_BLOB = ndr->flags;
535 9871 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
536 9871 : NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->remaining));
537 9871 : ndr->flags = _flags_save_DATA_BLOB;
538 : }
539 9871 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
540 : }
541 9871 : if (ndr_flags & NDR_BUFFERS) {
542 : }
543 9871 : ndr->flags = _flags_save_STRUCT;
544 : }
545 9871 : return NDR_ERR_SUCCESS;
546 : }
547 :
548 0 : _PUBLIC_ void ndr_print_ntlmssp_SingleHostData(struct ndr_print *ndr, const char *name, const struct ntlmssp_SingleHostData *r)
549 : {
550 0 : ndr_print_struct(ndr, name, "ntlmssp_SingleHostData");
551 0 : if (r == NULL) { ndr_print_null(ndr); return; }
552 : {
553 0 : uint32_t _flags_save_STRUCT = ndr->flags;
554 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
555 0 : ndr->depth++;
556 0 : ndr_print_uint32(ndr, "Size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?8 + ndr_size_LSAP_TOKEN_INFO_INTEGRITY(&r->token_info, 0) + r->remaining.length:r->Size);
557 0 : ndr_print_uint32(ndr, "Z4", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->Z4);
558 0 : ndr_print_LSAP_TOKEN_INFO_INTEGRITY(ndr, "token_info", &r->token_info);
559 : {
560 0 : uint32_t _flags_save_DATA_BLOB = ndr->flags;
561 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
562 0 : ndr_print_DATA_BLOB(ndr, "remaining", r->remaining);
563 0 : ndr->flags = _flags_save_DATA_BLOB;
564 : }
565 0 : ndr->depth--;
566 0 : ndr->flags = _flags_save_STRUCT;
567 : }
568 : }
569 :
570 33996 : static enum ndr_err_code ndr_push_ntlmssp_AvFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r)
571 : {
572 33996 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
573 33996 : return NDR_ERR_SUCCESS;
574 : }
575 :
576 8640 : static enum ndr_err_code ndr_pull_ntlmssp_AvFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r)
577 : {
578 : uint32_t v;
579 8640 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
580 8640 : *r = v;
581 8640 : return NDR_ERR_SUCCESS;
582 : }
583 :
584 0 : _PUBLIC_ void ndr_print_ntlmssp_AvFlags(struct ndr_print *ndr, const char *name, uint32_t r)
585 : {
586 0 : ndr_print_uint32(ndr, name, r);
587 0 : ndr->depth++;
588 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT", NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT, r);
589 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE", NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE, r);
590 0 : ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "NTLMSSP_AVFLAG_TARGET_SPN_FROM_UNTRUSTED_SOURCE", NTLMSSP_AVFLAG_TARGET_SPN_FROM_UNTRUSTED_SOURCE, r);
591 0 : ndr->depth--;
592 0 : }
593 :
594 617828 : static enum ndr_err_code ndr_push_ntlmssp_AvValue(struct ndr_push *ndr, int ndr_flags, const union ntlmssp_AvValue *r)
595 : {
596 : uint32_t level;
597 : {
598 617828 : uint32_t _flags_save_UNION = ndr->flags;
599 617828 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
600 617828 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
601 617828 : if (ndr_flags & NDR_SCALARS) {
602 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
603 617828 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
604 617828 : NDR_CHECK(ndr_push_union_align(ndr, 4));
605 617828 : switch (level) {
606 79564 : case MsvAvEOL: {
607 79564 : break; }
608 :
609 79564 : case MsvAvNbComputerName: {
610 : {
611 79564 : uint32_t _flags_save_string = ndr->flags;
612 79564 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
613 79564 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->AvNbComputerName));
614 79564 : ndr->flags = _flags_save_string;
615 : }
616 79564 : break; }
617 :
618 79564 : case MsvAvNbDomainName: {
619 : {
620 79564 : uint32_t _flags_save_string = ndr->flags;
621 79564 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
622 79564 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->AvNbDomainName));
623 79564 : ndr->flags = _flags_save_string;
624 : }
625 79564 : break; }
626 :
627 79492 : case MsvAvDnsComputerName: {
628 : {
629 79492 : uint32_t _flags_save_string = ndr->flags;
630 79492 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
631 79492 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->AvDnsComputerName));
632 79492 : ndr->flags = _flags_save_string;
633 : }
634 79492 : break; }
635 :
636 79492 : case MsvAvDnsDomainName: {
637 : {
638 79492 : uint32_t _flags_save_string = ndr->flags;
639 79492 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
640 79492 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->AvDnsDomainName));
641 79492 : ndr->flags = _flags_save_string;
642 : }
643 79492 : break; }
644 :
645 0 : case MsvAvDnsTreeName: {
646 : {
647 0 : uint32_t _flags_save_string = ndr->flags;
648 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
649 0 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->AvDnsTreeName));
650 0 : ndr->flags = _flags_save_string;
651 : }
652 0 : break; }
653 :
654 33996 : case MsvAvFlags: {
655 33996 : NDR_CHECK(ndr_push_ntlmssp_AvFlags(ndr, NDR_SCALARS, r->AvFlags));
656 33996 : break; }
657 :
658 71244 : case MsvAvTimestamp: {
659 71244 : NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->AvTimestamp));
660 71244 : break; }
661 :
662 38732 : case MsvAvSingleHost: {
663 38732 : NDR_CHECK(ndr_push_ntlmssp_SingleHostData(ndr, NDR_SCALARS, &r->AvSingleHost));
664 38732 : break; }
665 :
666 37448 : case MsvAvTargetName: {
667 : {
668 37448 : uint32_t _flags_save_string = ndr->flags;
669 37448 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
670 37448 : NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->AvTargetName));
671 37448 : ndr->flags = _flags_save_string;
672 : }
673 37448 : break; }
674 :
675 38732 : case MsvChannelBindings: {
676 38732 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->ChannelBindings, 16));
677 38732 : break; }
678 :
679 0 : default: {
680 : {
681 0 : uint32_t _flags_save_DATA_BLOB = ndr->flags;
682 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
683 0 : NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->blob));
684 0 : ndr->flags = _flags_save_DATA_BLOB;
685 : }
686 0 : break; }
687 :
688 : }
689 0 : }
690 617828 : ndr->flags = _flags_save_UNION;
691 : }
692 617828 : return NDR_ERR_SUCCESS;
693 : }
694 :
695 167716 : static enum ndr_err_code ndr_pull_ntlmssp_AvValue(struct ndr_pull *ndr, int ndr_flags, union ntlmssp_AvValue *r)
696 : {
697 : uint32_t level;
698 167716 : uint32_t size_ChannelBindings_0 = 0;
699 : {
700 167716 : uint32_t _flags_save_UNION = ndr->flags;
701 167716 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
702 167716 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
703 167716 : if (ndr_flags & NDR_SCALARS) {
704 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
705 167716 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
706 167716 : NDR_CHECK(ndr_pull_union_align(ndr, 4));
707 167716 : switch (level) {
708 24397 : case MsvAvEOL: {
709 24397 : break; }
710 :
711 24397 : case MsvAvNbComputerName: {
712 : {
713 24397 : uint32_t _flags_save_string = ndr->flags;
714 24397 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
715 24397 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->AvNbComputerName));
716 24397 : ndr->flags = _flags_save_string;
717 : }
718 24397 : break; }
719 :
720 24397 : case MsvAvNbDomainName: {
721 : {
722 24397 : uint32_t _flags_save_string = ndr->flags;
723 24397 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
724 24397 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->AvNbDomainName));
725 24397 : ndr->flags = _flags_save_string;
726 : }
727 24397 : break; }
728 :
729 19566 : case MsvAvDnsComputerName: {
730 : {
731 19566 : uint32_t _flags_save_string = ndr->flags;
732 19566 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
733 19566 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->AvDnsComputerName));
734 19566 : ndr->flags = _flags_save_string;
735 : }
736 19566 : break; }
737 :
738 19566 : case MsvAvDnsDomainName: {
739 : {
740 19566 : uint32_t _flags_save_string = ndr->flags;
741 19566 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
742 19566 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->AvDnsDomainName));
743 19566 : ndr->flags = _flags_save_string;
744 : }
745 19566 : break; }
746 :
747 0 : case MsvAvDnsTreeName: {
748 : {
749 0 : uint32_t _flags_save_string = ndr->flags;
750 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
751 0 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->AvDnsTreeName));
752 0 : ndr->flags = _flags_save_string;
753 : }
754 0 : break; }
755 :
756 8640 : case MsvAvFlags: {
757 8640 : NDR_CHECK(ndr_pull_ntlmssp_AvFlags(ndr, NDR_SCALARS, &r->AvFlags));
758 8640 : break; }
759 :
760 17482 : case MsvAvTimestamp: {
761 17482 : NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->AvTimestamp));
762 17482 : break; }
763 :
764 9871 : case MsvAvSingleHost: {
765 9871 : NDR_CHECK(ndr_pull_ntlmssp_SingleHostData(ndr, NDR_SCALARS, &r->AvSingleHost));
766 9871 : break; }
767 :
768 9529 : case MsvAvTargetName: {
769 : {
770 9529 : uint32_t _flags_save_string = ndr->flags;
771 9529 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
772 9529 : NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->AvTargetName));
773 9529 : ndr->flags = _flags_save_string;
774 : }
775 9529 : break; }
776 :
777 9871 : case MsvChannelBindings: {
778 9871 : size_ChannelBindings_0 = 16;
779 9871 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->ChannelBindings, size_ChannelBindings_0));
780 9871 : break; }
781 :
782 0 : default: {
783 : {
784 0 : uint32_t _flags_save_DATA_BLOB = ndr->flags;
785 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
786 0 : NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->blob));
787 0 : ndr->flags = _flags_save_DATA_BLOB;
788 : }
789 0 : break; }
790 :
791 : }
792 0 : }
793 167716 : ndr->flags = _flags_save_UNION;
794 : }
795 167716 : return NDR_ERR_SUCCESS;
796 : }
797 :
798 0 : _PUBLIC_ void ndr_print_ntlmssp_AvValue(struct ndr_print *ndr, const char *name, const union ntlmssp_AvValue *r)
799 : {
800 : uint32_t level;
801 : {
802 0 : uint32_t _flags_save_UNION = ndr->flags;
803 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
804 0 : level = ndr_print_steal_switch_value(ndr, r);
805 0 : ndr_print_union(ndr, name, level, "ntlmssp_AvValue");
806 0 : switch (level) {
807 0 : case MsvAvEOL:
808 0 : break;
809 :
810 0 : case MsvAvNbComputerName:
811 : {
812 0 : uint32_t _flags_save_string = ndr->flags;
813 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
814 0 : ndr_print_string(ndr, "AvNbComputerName", r->AvNbComputerName);
815 0 : ndr->flags = _flags_save_string;
816 : }
817 0 : break;
818 :
819 0 : case MsvAvNbDomainName:
820 : {
821 0 : uint32_t _flags_save_string = ndr->flags;
822 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
823 0 : ndr_print_string(ndr, "AvNbDomainName", r->AvNbDomainName);
824 0 : ndr->flags = _flags_save_string;
825 : }
826 0 : break;
827 :
828 0 : case MsvAvDnsComputerName:
829 : {
830 0 : uint32_t _flags_save_string = ndr->flags;
831 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
832 0 : ndr_print_string(ndr, "AvDnsComputerName", r->AvDnsComputerName);
833 0 : ndr->flags = _flags_save_string;
834 : }
835 0 : break;
836 :
837 0 : case MsvAvDnsDomainName:
838 : {
839 0 : uint32_t _flags_save_string = ndr->flags;
840 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
841 0 : ndr_print_string(ndr, "AvDnsDomainName", r->AvDnsDomainName);
842 0 : ndr->flags = _flags_save_string;
843 : }
844 0 : break;
845 :
846 0 : case MsvAvDnsTreeName:
847 : {
848 0 : uint32_t _flags_save_string = ndr->flags;
849 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
850 0 : ndr_print_string(ndr, "AvDnsTreeName", r->AvDnsTreeName);
851 0 : ndr->flags = _flags_save_string;
852 : }
853 0 : break;
854 :
855 0 : case MsvAvFlags:
856 0 : ndr_print_ntlmssp_AvFlags(ndr, "AvFlags", r->AvFlags);
857 0 : break;
858 :
859 0 : case MsvAvTimestamp:
860 0 : ndr_print_NTTIME(ndr, "AvTimestamp", r->AvTimestamp);
861 0 : break;
862 :
863 0 : case MsvAvSingleHost:
864 0 : ndr_print_ntlmssp_SingleHostData(ndr, "AvSingleHost", &r->AvSingleHost);
865 0 : break;
866 :
867 0 : case MsvAvTargetName:
868 : {
869 0 : uint32_t _flags_save_string = ndr->flags;
870 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE));
871 0 : ndr_print_string(ndr, "AvTargetName", r->AvTargetName);
872 0 : ndr->flags = _flags_save_string;
873 : }
874 0 : break;
875 :
876 0 : case MsvChannelBindings:
877 0 : ndr_print_array_uint8(ndr, "ChannelBindings", r->ChannelBindings, 16);
878 0 : break;
879 :
880 0 : default:
881 : {
882 0 : uint32_t _flags_save_DATA_BLOB = ndr->flags;
883 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
884 0 : ndr_print_DATA_BLOB(ndr, "blob", r->blob);
885 0 : ndr->flags = _flags_save_DATA_BLOB;
886 : }
887 0 : break;
888 :
889 : }
890 0 : ndr->flags = _flags_save_UNION;
891 : }
892 0 : }
893 :
894 463371 : static size_t ndr_size_ntlmssp_AvValue(const union ntlmssp_AvValue *r, uint32_t level, int flags)
895 : {
896 463371 : flags |= LIBNDR_FLAG_NOALIGN;
897 463371 : return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_ntlmssp_AvValue);
898 : }
899 :
900 308914 : _PUBLIC_ enum ndr_err_code ndr_push_AV_PAIR(struct ndr_push *ndr, int ndr_flags, const struct AV_PAIR *r)
901 : {
902 : {
903 308914 : uint32_t _flags_save_STRUCT = ndr->flags;
904 308914 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
905 308914 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
906 308914 : if (ndr_flags & NDR_SCALARS) {
907 154457 : NDR_CHECK(ndr_push_align(ndr, 4));
908 154457 : NDR_CHECK(ndr_push_ntlmssp_AvId(ndr, NDR_SCALARS, r->AvId));
909 154457 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_size_ntlmssp_AvValue(&r->Value, r->AvId, 0)));
910 : {
911 : struct ndr_push *_ndr_Value;
912 154457 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_Value, 0, ndr_size_ntlmssp_AvValue(&r->Value, r->AvId, 0)));
913 154457 : NDR_CHECK(ndr_push_set_switch_value(_ndr_Value, &r->Value, r->AvId));
914 154457 : NDR_CHECK(ndr_push_ntlmssp_AvValue(_ndr_Value, NDR_SCALARS|NDR_BUFFERS, &r->Value));
915 154457 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_Value, 0, ndr_size_ntlmssp_AvValue(&r->Value, r->AvId, 0)));
916 : }
917 154457 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
918 : }
919 308914 : if (ndr_flags & NDR_BUFFERS) {
920 : }
921 308914 : ndr->flags = _flags_save_STRUCT;
922 : }
923 308914 : return NDR_ERR_SUCCESS;
924 : }
925 :
926 335434 : _PUBLIC_ enum ndr_err_code ndr_pull_AV_PAIR(struct ndr_pull *ndr, int ndr_flags, struct AV_PAIR *r)
927 : {
928 : {
929 335434 : uint32_t _flags_save_STRUCT = ndr->flags;
930 335434 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
931 335434 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
932 335434 : if (ndr_flags & NDR_SCALARS) {
933 167718 : NDR_CHECK(ndr_pull_align(ndr, 4));
934 167718 : NDR_CHECK(ndr_pull_ntlmssp_AvId(ndr, NDR_SCALARS, &r->AvId));
935 167718 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->AvLen));
936 : {
937 : struct ndr_pull *_ndr_Value;
938 167719 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_Value, 0, r->AvLen));
939 167716 : NDR_CHECK(ndr_pull_set_switch_value(_ndr_Value, &r->Value, r->AvId));
940 167716 : NDR_CHECK(ndr_pull_ntlmssp_AvValue(_ndr_Value, NDR_SCALARS|NDR_BUFFERS, &r->Value));
941 167716 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_Value, 0, r->AvLen));
942 : }
943 167716 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
944 : }
945 335432 : if (ndr_flags & NDR_BUFFERS) {
946 : }
947 335432 : ndr->flags = _flags_save_STRUCT;
948 : }
949 335432 : return NDR_ERR_SUCCESS;
950 : }
951 :
952 0 : static void ndr_print_flags_AV_PAIR(struct ndr_print *ndr, const char *name, int unused, const struct AV_PAIR *r)
953 : {
954 0 : ndr_print_AV_PAIR(ndr, name, r);
955 0 : }
956 :
957 0 : _PUBLIC_ void ndr_print_AV_PAIR(struct ndr_print *ndr, const char *name, const struct AV_PAIR *r)
958 : {
959 0 : ndr_print_struct(ndr, name, "AV_PAIR");
960 0 : if (r == NULL) { ndr_print_null(ndr); return; }
961 : {
962 0 : uint32_t _flags_save_STRUCT = ndr->flags;
963 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
964 0 : ndr->depth++;
965 0 : ndr_print_ntlmssp_AvId(ndr, "AvId", r->AvId);
966 0 : ndr_print_uint16(ndr, "AvLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_ntlmssp_AvValue(&r->Value, r->AvId, 0):r->AvLen);
967 0 : ndr_print_set_switch_value(ndr, &r->Value, r->AvId);
968 0 : ndr_print_ntlmssp_AvValue(ndr, "Value", &r->Value);
969 0 : ndr->depth--;
970 0 : ndr->flags = _flags_save_STRUCT;
971 : }
972 : }
973 :
974 0 : static void ndr_print_flags_AV_PAIR_LIST(struct ndr_print *ndr, const char *name, int unused, const struct AV_PAIR_LIST *r)
975 : {
976 0 : ndr_print_AV_PAIR_LIST(ndr, name, r);
977 0 : }
978 :
979 0 : _PUBLIC_ void ndr_print_AV_PAIR_LIST(struct ndr_print *ndr, const char *name, const struct AV_PAIR_LIST *r)
980 : {
981 : uint32_t cntr_pair_0;
982 0 : ndr_print_struct(ndr, name, "AV_PAIR_LIST");
983 0 : if (r == NULL) { ndr_print_null(ndr); return; }
984 : {
985 0 : uint32_t _flags_save_STRUCT = ndr->flags;
986 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
987 0 : ndr->depth++;
988 0 : ndr_print_uint32(ndr, "count", r->count);
989 0 : ndr->print(ndr, "%s: ARRAY(%d)", "pair", (int)r->count);
990 0 : ndr->depth++;
991 0 : for (cntr_pair_0 = 0; cntr_pair_0 < (r->count); cntr_pair_0++) {
992 0 : ndr_print_AV_PAIR(ndr, "pair", &r->pair[cntr_pair_0]);
993 : }
994 0 : ndr->depth--;
995 0 : ndr->depth--;
996 0 : ndr->flags = _flags_save_STRUCT;
997 : }
998 : }
999 :
1000 0 : _PUBLIC_ size_t ndr_size_AV_PAIR_LIST(const struct AV_PAIR_LIST *r, int flags)
1001 : {
1002 0 : flags |= LIBNDR_FLAG_NOALIGN;
1003 0 : return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_AV_PAIR_LIST);
1004 : }
1005 :
1006 0 : _PUBLIC_ enum ndr_err_code ndr_push_CHALLENGE_MESSAGE(struct ndr_push *ndr, int ndr_flags, const struct CHALLENGE_MESSAGE *r)
1007 : {
1008 : {
1009 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1010 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1011 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1012 0 : if (ndr_flags & NDR_SCALARS) {
1013 0 : NDR_CHECK(ndr_push_align(ndr, 5));
1014 0 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "NTLMSSP", 8, sizeof(uint8_t), CH_DOS));
1015 0 : NDR_CHECK(ndr_push_ntlmssp_MessageType(ndr, NDR_SCALARS, NtLmChallenge));
1016 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_ntlmssp_string_length(r->NegotiateFlags, r->TargetName)));
1017 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_ntlmssp_string_length(r->NegotiateFlags, r->TargetName)));
1018 : {
1019 0 : uint32_t _flags_save_string = ndr->flags;
1020 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
1021 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->TargetName));
1022 0 : ndr->flags = _flags_save_string;
1023 : }
1024 0 : NDR_CHECK(ndr_push_NEGOTIATE(ndr, NDR_SCALARS, r->NegotiateFlags));
1025 0 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->ServerChallenge, 8));
1026 0 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Reserved, 8));
1027 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_size_AV_PAIR_LIST(r->TargetInfo, ndr->flags)));
1028 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_size_AV_PAIR_LIST(r->TargetInfo, ndr->flags)));
1029 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->TargetInfo));
1030 0 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION));
1031 0 : NDR_CHECK(ndr_push_ntlmssp_Version(ndr, NDR_SCALARS, &r->Version));
1032 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1033 : }
1034 0 : if (ndr_flags & NDR_BUFFERS) {
1035 : {
1036 0 : uint32_t _flags_save_string = ndr->flags;
1037 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
1038 0 : if (r->TargetName) {
1039 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->TargetName));
1040 : {
1041 : struct ndr_push *_ndr_TargetName;
1042 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_TargetName, 0, ndr_ntlmssp_string_length(r->NegotiateFlags, r->TargetName)));
1043 0 : NDR_CHECK(ndr_push_string(_ndr_TargetName, NDR_SCALARS, r->TargetName));
1044 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_TargetName, 0, ndr_ntlmssp_string_length(r->NegotiateFlags, r->TargetName)));
1045 : }
1046 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->TargetName));
1047 : }
1048 0 : ndr->flags = _flags_save_string;
1049 : }
1050 0 : if (r->TargetInfo) {
1051 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->TargetInfo));
1052 : {
1053 : struct ndr_push *_ndr_TargetInfo;
1054 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_TargetInfo, 0, ndr_size_AV_PAIR_LIST(r->TargetInfo, ndr->flags)));
1055 0 : NDR_CHECK(ndr_push_AV_PAIR_LIST(_ndr_TargetInfo, NDR_SCALARS|NDR_BUFFERS, r->TargetInfo));
1056 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_TargetInfo, 0, ndr_size_AV_PAIR_LIST(r->TargetInfo, ndr->flags)));
1057 : }
1058 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->TargetInfo));
1059 : }
1060 0 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION));
1061 0 : NDR_CHECK(ndr_push_ntlmssp_Version(ndr, NDR_BUFFERS, &r->Version));
1062 : }
1063 0 : ndr->flags = _flags_save_STRUCT;
1064 : }
1065 0 : return NDR_ERR_SUCCESS;
1066 : }
1067 :
1068 0 : _PUBLIC_ enum ndr_err_code ndr_pull_CHALLENGE_MESSAGE(struct ndr_pull *ndr, int ndr_flags, struct CHALLENGE_MESSAGE *r)
1069 : {
1070 0 : uint32_t size_Signature_0 = 0;
1071 : uint32_t _ptr_TargetName;
1072 0 : TALLOC_CTX *_mem_save_TargetName_0 = NULL;
1073 0 : uint32_t size_ServerChallenge_0 = 0;
1074 0 : uint32_t size_Reserved_0 = 0;
1075 : uint32_t _ptr_TargetInfo;
1076 0 : TALLOC_CTX *_mem_save_TargetInfo_0 = NULL;
1077 : {
1078 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1079 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1080 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1081 0 : if (ndr_flags & NDR_SCALARS) {
1082 0 : NDR_CHECK(ndr_pull_align(ndr, 5));
1083 0 : size_Signature_0 = 8;
1084 0 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->Signature, size_Signature_0, sizeof(uint8_t), CH_DOS));
1085 0 : NDR_CHECK(ndr_pull_ntlmssp_MessageType(ndr, NDR_SCALARS, &r->MessageType));
1086 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->TargetNameLen));
1087 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->TargetNameMaxLen));
1088 : {
1089 0 : uint32_t _flags_save_string = ndr->flags;
1090 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
1091 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_TargetName));
1092 0 : if (_ptr_TargetName) {
1093 0 : NDR_PULL_ALLOC(ndr, r->TargetName);
1094 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->TargetName, _ptr_TargetName));
1095 : } else {
1096 0 : r->TargetName = NULL;
1097 : }
1098 0 : ndr->flags = _flags_save_string;
1099 : }
1100 0 : NDR_CHECK(ndr_pull_NEGOTIATE(ndr, NDR_SCALARS, &r->NegotiateFlags));
1101 0 : size_ServerChallenge_0 = 8;
1102 0 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->ServerChallenge, size_ServerChallenge_0));
1103 0 : size_Reserved_0 = 8;
1104 0 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Reserved, size_Reserved_0));
1105 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->TargetInfoLen));
1106 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->TargetInfoMaxLen));
1107 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_TargetInfo));
1108 0 : if (_ptr_TargetInfo) {
1109 0 : NDR_PULL_ALLOC(ndr, r->TargetInfo);
1110 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->TargetInfo, _ptr_TargetInfo));
1111 : } else {
1112 0 : r->TargetInfo = NULL;
1113 : }
1114 0 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION));
1115 0 : NDR_CHECK(ndr_pull_ntlmssp_Version(ndr, NDR_SCALARS, &r->Version));
1116 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1117 : }
1118 0 : if (ndr_flags & NDR_BUFFERS) {
1119 : {
1120 0 : uint32_t _flags_save_string = ndr->flags;
1121 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
1122 0 : if (r->TargetName) {
1123 : uint32_t _relative_save_offset;
1124 0 : _relative_save_offset = ndr->offset;
1125 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->TargetName));
1126 0 : _mem_save_TargetName_0 = NDR_PULL_GET_MEM_CTX(ndr);
1127 0 : NDR_PULL_SET_MEM_CTX(ndr, r->TargetName, 0);
1128 : {
1129 : struct ndr_pull *_ndr_TargetName;
1130 0 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_TargetName, 0, r->TargetNameLen));
1131 0 : NDR_CHECK(ndr_pull_string(_ndr_TargetName, NDR_SCALARS, &r->TargetName));
1132 0 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_TargetName, 0, r->TargetNameLen));
1133 : }
1134 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_TargetName_0, 0);
1135 0 : if (ndr->offset > ndr->relative_highest_offset) {
1136 0 : ndr->relative_highest_offset = ndr->offset;
1137 : }
1138 0 : ndr->offset = _relative_save_offset;
1139 : }
1140 0 : ndr->flags = _flags_save_string;
1141 : }
1142 0 : if (r->TargetInfo) {
1143 : uint32_t _relative_save_offset;
1144 0 : _relative_save_offset = ndr->offset;
1145 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->TargetInfo));
1146 0 : _mem_save_TargetInfo_0 = NDR_PULL_GET_MEM_CTX(ndr);
1147 0 : NDR_PULL_SET_MEM_CTX(ndr, r->TargetInfo, 0);
1148 : {
1149 : struct ndr_pull *_ndr_TargetInfo;
1150 0 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_TargetInfo, 0, r->TargetInfoLen));
1151 0 : NDR_CHECK(ndr_pull_AV_PAIR_LIST(_ndr_TargetInfo, NDR_SCALARS|NDR_BUFFERS, r->TargetInfo));
1152 0 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_TargetInfo, 0, r->TargetInfoLen));
1153 : }
1154 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_TargetInfo_0, 0);
1155 0 : if (ndr->offset > ndr->relative_highest_offset) {
1156 0 : ndr->relative_highest_offset = ndr->offset;
1157 : }
1158 0 : ndr->offset = _relative_save_offset;
1159 : }
1160 0 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION));
1161 0 : NDR_CHECK(ndr_pull_ntlmssp_Version(ndr, NDR_BUFFERS, &r->Version));
1162 : }
1163 0 : ndr->flags = _flags_save_STRUCT;
1164 : }
1165 0 : return NDR_ERR_SUCCESS;
1166 : }
1167 :
1168 0 : static void ndr_print_flags_CHALLENGE_MESSAGE(struct ndr_print *ndr, const char *name, int unused, const struct CHALLENGE_MESSAGE *r)
1169 : {
1170 0 : ndr_print_CHALLENGE_MESSAGE(ndr, name, r);
1171 0 : }
1172 :
1173 0 : _PUBLIC_ void ndr_print_CHALLENGE_MESSAGE(struct ndr_print *ndr, const char *name, const struct CHALLENGE_MESSAGE *r)
1174 : {
1175 0 : ndr_print_struct(ndr, name, "CHALLENGE_MESSAGE");
1176 0 : if (r == NULL) { ndr_print_null(ndr); return; }
1177 : {
1178 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1179 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1180 0 : ndr->depth++;
1181 0 : ndr_print_string(ndr, "Signature", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?"NTLMSSP":r->Signature);
1182 0 : ndr_print_ntlmssp_MessageType(ndr, "MessageType", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NtLmChallenge:r->MessageType);
1183 0 : ndr_print_uint16(ndr, "TargetNameLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_ntlmssp_string_length(r->NegotiateFlags, r->TargetName):r->TargetNameLen);
1184 0 : ndr_print_uint16(ndr, "TargetNameMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->TargetNameLen:r->TargetNameMaxLen);
1185 : {
1186 0 : uint32_t _flags_save_string = ndr->flags;
1187 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
1188 0 : ndr_print_ptr(ndr, "TargetName", r->TargetName);
1189 0 : ndr->depth++;
1190 0 : if (r->TargetName) {
1191 0 : ndr_print_string(ndr, "TargetName", r->TargetName);
1192 : }
1193 0 : ndr->depth--;
1194 0 : ndr->flags = _flags_save_string;
1195 : }
1196 0 : ndr_print_NEGOTIATE(ndr, "NegotiateFlags", r->NegotiateFlags);
1197 0 : ndr_print_array_uint8(ndr, "ServerChallenge", r->ServerChallenge, 8);
1198 0 : ndr_print_array_uint8(ndr, "Reserved", r->Reserved, 8);
1199 0 : ndr_print_uint16(ndr, "TargetInfoLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_AV_PAIR_LIST(r->TargetInfo, ndr->flags):r->TargetInfoLen);
1200 0 : ndr_print_uint16(ndr, "TargetInfoMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->TargetInfoLen:r->TargetInfoMaxLen);
1201 0 : ndr_print_ptr(ndr, "TargetInfo", r->TargetInfo);
1202 0 : ndr->depth++;
1203 0 : if (r->TargetInfo) {
1204 0 : ndr_print_AV_PAIR_LIST(ndr, "TargetInfo", r->TargetInfo);
1205 : }
1206 0 : ndr->depth--;
1207 0 : ndr_print_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION);
1208 0 : ndr_print_ntlmssp_Version(ndr, "Version", &r->Version);
1209 0 : ndr->depth--;
1210 0 : ndr->flags = _flags_save_STRUCT;
1211 : }
1212 : }
1213 :
1214 0 : _PUBLIC_ enum ndr_err_code ndr_push_LM_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct LM_RESPONSE *r)
1215 : {
1216 : {
1217 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1218 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1219 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1220 0 : if (ndr_flags & NDR_SCALARS) {
1221 0 : NDR_CHECK(ndr_push_align(ndr, 1));
1222 0 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Response, 24));
1223 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 1));
1224 : }
1225 0 : if (ndr_flags & NDR_BUFFERS) {
1226 : }
1227 0 : ndr->flags = _flags_save_STRUCT;
1228 : }
1229 0 : return NDR_ERR_SUCCESS;
1230 : }
1231 :
1232 0 : _PUBLIC_ enum ndr_err_code ndr_pull_LM_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct LM_RESPONSE *r)
1233 : {
1234 0 : uint32_t size_Response_0 = 0;
1235 : {
1236 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1237 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1238 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1239 0 : if (ndr_flags & NDR_SCALARS) {
1240 0 : NDR_CHECK(ndr_pull_align(ndr, 1));
1241 0 : size_Response_0 = 24;
1242 0 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Response, size_Response_0));
1243 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
1244 : }
1245 0 : if (ndr_flags & NDR_BUFFERS) {
1246 : }
1247 0 : ndr->flags = _flags_save_STRUCT;
1248 : }
1249 0 : return NDR_ERR_SUCCESS;
1250 : }
1251 :
1252 0 : static void ndr_print_flags_LM_RESPONSE(struct ndr_print *ndr, const char *name, int unused, const struct LM_RESPONSE *r)
1253 : {
1254 0 : ndr_print_LM_RESPONSE(ndr, name, r);
1255 0 : }
1256 :
1257 0 : _PUBLIC_ void ndr_print_LM_RESPONSE(struct ndr_print *ndr, const char *name, const struct LM_RESPONSE *r)
1258 : {
1259 0 : ndr_print_struct(ndr, name, "LM_RESPONSE");
1260 0 : if (r == NULL) { ndr_print_null(ndr); return; }
1261 : {
1262 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1263 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1264 0 : ndr->depth++;
1265 0 : ndr_print_array_uint8(ndr, "Response", r->Response, 24);
1266 0 : ndr->depth--;
1267 0 : ndr->flags = _flags_save_STRUCT;
1268 : }
1269 : }
1270 :
1271 0 : _PUBLIC_ enum ndr_err_code ndr_push_LMv2_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct LMv2_RESPONSE *r)
1272 : {
1273 : {
1274 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1275 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1276 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1277 0 : if (ndr_flags & NDR_SCALARS) {
1278 0 : NDR_CHECK(ndr_push_align(ndr, 1));
1279 0 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Response, 16));
1280 0 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->ChallengeFromClient, 8));
1281 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 1));
1282 : }
1283 0 : if (ndr_flags & NDR_BUFFERS) {
1284 : }
1285 0 : ndr->flags = _flags_save_STRUCT;
1286 : }
1287 0 : return NDR_ERR_SUCCESS;
1288 : }
1289 :
1290 0 : _PUBLIC_ enum ndr_err_code ndr_pull_LMv2_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct LMv2_RESPONSE *r)
1291 : {
1292 0 : uint32_t size_Response_0 = 0;
1293 0 : uint32_t size_ChallengeFromClient_0 = 0;
1294 : {
1295 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1296 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1297 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1298 0 : if (ndr_flags & NDR_SCALARS) {
1299 0 : NDR_CHECK(ndr_pull_align(ndr, 1));
1300 0 : size_Response_0 = 16;
1301 0 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Response, size_Response_0));
1302 0 : size_ChallengeFromClient_0 = 8;
1303 0 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->ChallengeFromClient, size_ChallengeFromClient_0));
1304 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
1305 : }
1306 0 : if (ndr_flags & NDR_BUFFERS) {
1307 : }
1308 0 : ndr->flags = _flags_save_STRUCT;
1309 : }
1310 0 : return NDR_ERR_SUCCESS;
1311 : }
1312 :
1313 0 : static void ndr_print_flags_LMv2_RESPONSE(struct ndr_print *ndr, const char *name, int unused, const struct LMv2_RESPONSE *r)
1314 : {
1315 0 : ndr_print_LMv2_RESPONSE(ndr, name, r);
1316 0 : }
1317 :
1318 0 : _PUBLIC_ void ndr_print_LMv2_RESPONSE(struct ndr_print *ndr, const char *name, const struct LMv2_RESPONSE *r)
1319 : {
1320 0 : ndr_print_struct(ndr, name, "LMv2_RESPONSE");
1321 0 : if (r == NULL) { ndr_print_null(ndr); return; }
1322 : {
1323 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1324 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1325 0 : ndr->depth++;
1326 0 : ndr_print_array_uint8(ndr, "Response", r->Response, 16);
1327 0 : ndr_print_array_uint8(ndr, "ChallengeFromClient", r->ChallengeFromClient, 8);
1328 0 : ndr->depth--;
1329 0 : ndr->flags = _flags_save_STRUCT;
1330 : }
1331 : }
1332 :
1333 0 : static enum ndr_err_code ndr_push_ntlmssp_LM_RESPONSE_with_len(struct ndr_push *ndr, int ndr_flags, const union ntlmssp_LM_RESPONSE_with_len *r)
1334 : {
1335 : uint32_t level;
1336 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1337 0 : if (ndr_flags & NDR_SCALARS) {
1338 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
1339 0 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
1340 0 : NDR_CHECK(ndr_push_union_align(ndr, 1));
1341 0 : switch (level) {
1342 0 : case 24: {
1343 0 : NDR_CHECK(ndr_push_LM_RESPONSE(ndr, NDR_SCALARS, &r->v1));
1344 0 : break; }
1345 :
1346 0 : default: {
1347 0 : break; }
1348 :
1349 : }
1350 0 : }
1351 0 : return NDR_ERR_SUCCESS;
1352 : }
1353 :
1354 0 : static enum ndr_err_code ndr_pull_ntlmssp_LM_RESPONSE_with_len(struct ndr_pull *ndr, int ndr_flags, union ntlmssp_LM_RESPONSE_with_len *r)
1355 : {
1356 : uint32_t level;
1357 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1358 0 : if (ndr_flags & NDR_SCALARS) {
1359 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
1360 0 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
1361 0 : NDR_CHECK(ndr_pull_union_align(ndr, 1));
1362 0 : switch (level) {
1363 0 : case 24: {
1364 0 : NDR_CHECK(ndr_pull_LM_RESPONSE(ndr, NDR_SCALARS, &r->v1));
1365 0 : break; }
1366 :
1367 0 : default: {
1368 0 : break; }
1369 :
1370 : }
1371 0 : }
1372 0 : return NDR_ERR_SUCCESS;
1373 : }
1374 :
1375 0 : _PUBLIC_ void ndr_print_ntlmssp_LM_RESPONSE_with_len(struct ndr_print *ndr, const char *name, const union ntlmssp_LM_RESPONSE_with_len *r)
1376 : {
1377 : uint32_t level;
1378 0 : level = ndr_print_steal_switch_value(ndr, r);
1379 0 : ndr_print_union(ndr, name, level, "ntlmssp_LM_RESPONSE_with_len");
1380 0 : switch (level) {
1381 0 : case 24:
1382 0 : ndr_print_LM_RESPONSE(ndr, "v1", &r->v1);
1383 0 : break;
1384 :
1385 0 : default:
1386 0 : break;
1387 :
1388 : }
1389 0 : }
1390 :
1391 0 : _PUBLIC_ enum ndr_err_code ndr_push_NTLM_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct NTLM_RESPONSE *r)
1392 : {
1393 : {
1394 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1395 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1396 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1397 0 : if (ndr_flags & NDR_SCALARS) {
1398 0 : NDR_CHECK(ndr_push_align(ndr, 1));
1399 0 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Response, 24));
1400 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 1));
1401 : }
1402 0 : if (ndr_flags & NDR_BUFFERS) {
1403 : }
1404 0 : ndr->flags = _flags_save_STRUCT;
1405 : }
1406 0 : return NDR_ERR_SUCCESS;
1407 : }
1408 :
1409 0 : _PUBLIC_ enum ndr_err_code ndr_pull_NTLM_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct NTLM_RESPONSE *r)
1410 : {
1411 0 : uint32_t size_Response_0 = 0;
1412 : {
1413 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1414 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1415 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1416 0 : if (ndr_flags & NDR_SCALARS) {
1417 0 : NDR_CHECK(ndr_pull_align(ndr, 1));
1418 0 : size_Response_0 = 24;
1419 0 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Response, size_Response_0));
1420 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 1));
1421 : }
1422 0 : if (ndr_flags & NDR_BUFFERS) {
1423 : }
1424 0 : ndr->flags = _flags_save_STRUCT;
1425 : }
1426 0 : return NDR_ERR_SUCCESS;
1427 : }
1428 :
1429 0 : static void ndr_print_flags_NTLM_RESPONSE(struct ndr_print *ndr, const char *name, int unused, const struct NTLM_RESPONSE *r)
1430 : {
1431 0 : ndr_print_NTLM_RESPONSE(ndr, name, r);
1432 0 : }
1433 :
1434 0 : _PUBLIC_ void ndr_print_NTLM_RESPONSE(struct ndr_print *ndr, const char *name, const struct NTLM_RESPONSE *r)
1435 : {
1436 0 : ndr_print_struct(ndr, name, "NTLM_RESPONSE");
1437 0 : if (r == NULL) { ndr_print_null(ndr); return; }
1438 : {
1439 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1440 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1441 0 : ndr->depth++;
1442 0 : ndr_print_array_uint8(ndr, "Response", r->Response, 24);
1443 0 : ndr->depth--;
1444 0 : ndr->flags = _flags_save_STRUCT;
1445 : }
1446 : }
1447 :
1448 0 : static enum ndr_err_code ndr_push_NTLMv2_CLIENT_CHALLENGE(struct ndr_push *ndr, int ndr_flags, const struct NTLMv2_CLIENT_CHALLENGE *r)
1449 : {
1450 : {
1451 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1452 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1453 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1454 0 : if (ndr_flags & NDR_SCALARS) {
1455 0 : NDR_CHECK(ndr_push_align(ndr, 4));
1456 0 : NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 1));
1457 0 : NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, 1));
1458 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->Reserved1));
1459 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Reserved2));
1460 0 : NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->TimeStamp));
1461 0 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->ChallengeFromClient, 8));
1462 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Reserved3));
1463 : {
1464 0 : uint32_t _flags_save_AV_PAIR_LIST = ndr->flags;
1465 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1466 : {
1467 : struct ndr_push *_ndr_AvPairs;
1468 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_AvPairs, 0, -1));
1469 0 : NDR_CHECK(ndr_push_AV_PAIR_LIST(_ndr_AvPairs, NDR_SCALARS|NDR_BUFFERS, &r->AvPairs));
1470 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_AvPairs, 0, -1));
1471 : }
1472 0 : ndr->flags = _flags_save_AV_PAIR_LIST;
1473 : }
1474 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1475 : }
1476 0 : if (ndr_flags & NDR_BUFFERS) {
1477 : {
1478 0 : uint32_t _flags_save_AV_PAIR_LIST = ndr->flags;
1479 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1480 0 : ndr->flags = _flags_save_AV_PAIR_LIST;
1481 : }
1482 : }
1483 0 : ndr->flags = _flags_save_STRUCT;
1484 : }
1485 0 : return NDR_ERR_SUCCESS;
1486 : }
1487 :
1488 29430 : static enum ndr_err_code ndr_pull_NTLMv2_CLIENT_CHALLENGE(struct ndr_pull *ndr, int ndr_flags, struct NTLMv2_CLIENT_CHALLENGE *r)
1489 : {
1490 29430 : uint32_t size_ChallengeFromClient_0 = 0;
1491 : {
1492 29430 : uint32_t _flags_save_STRUCT = ndr->flags;
1493 29430 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1494 29430 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1495 29430 : if (ndr_flags & NDR_SCALARS) {
1496 14716 : NDR_CHECK(ndr_pull_align(ndr, 4));
1497 14716 : NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->RespType));
1498 14716 : NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->HiRespType));
1499 14716 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Reserved1));
1500 14716 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Reserved2));
1501 14716 : NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->TimeStamp));
1502 14716 : size_ChallengeFromClient_0 = 8;
1503 14716 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->ChallengeFromClient, size_ChallengeFromClient_0));
1504 14716 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Reserved3));
1505 : {
1506 14716 : uint32_t _flags_save_AV_PAIR_LIST = ndr->flags;
1507 14716 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1508 : {
1509 : struct ndr_pull *_ndr_AvPairs;
1510 14718 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_AvPairs, 0, -1));
1511 14716 : NDR_CHECK(ndr_pull_AV_PAIR_LIST(_ndr_AvPairs, NDR_SCALARS|NDR_BUFFERS, &r->AvPairs));
1512 14714 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_AvPairs, 0, -1));
1513 : }
1514 14714 : ndr->flags = _flags_save_AV_PAIR_LIST;
1515 : }
1516 14714 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1517 : }
1518 29428 : if (ndr_flags & NDR_BUFFERS) {
1519 : {
1520 14714 : uint32_t _flags_save_AV_PAIR_LIST = ndr->flags;
1521 14714 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1522 14714 : ndr->flags = _flags_save_AV_PAIR_LIST;
1523 : }
1524 : }
1525 29428 : ndr->flags = _flags_save_STRUCT;
1526 : }
1527 29428 : return NDR_ERR_SUCCESS;
1528 : }
1529 :
1530 0 : _PUBLIC_ void ndr_print_NTLMv2_CLIENT_CHALLENGE(struct ndr_print *ndr, const char *name, const struct NTLMv2_CLIENT_CHALLENGE *r)
1531 : {
1532 0 : ndr_print_struct(ndr, name, "NTLMv2_CLIENT_CHALLENGE");
1533 0 : if (r == NULL) { ndr_print_null(ndr); return; }
1534 : {
1535 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1536 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1537 0 : ndr->depth++;
1538 0 : ndr_print_uint8(ndr, "RespType", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->RespType);
1539 0 : ndr_print_uint8(ndr, "HiRespType", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->HiRespType);
1540 0 : ndr_print_uint16(ndr, "Reserved1", r->Reserved1);
1541 0 : ndr_print_uint32(ndr, "Reserved2", r->Reserved2);
1542 0 : ndr_print_NTTIME(ndr, "TimeStamp", r->TimeStamp);
1543 0 : ndr_print_array_uint8(ndr, "ChallengeFromClient", r->ChallengeFromClient, 8);
1544 0 : ndr_print_uint32(ndr, "Reserved3", r->Reserved3);
1545 : {
1546 0 : uint32_t _flags_save_AV_PAIR_LIST = ndr->flags;
1547 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1548 0 : ndr_print_AV_PAIR_LIST(ndr, "AvPairs", &r->AvPairs);
1549 0 : ndr->flags = _flags_save_AV_PAIR_LIST;
1550 : }
1551 0 : ndr->depth--;
1552 0 : ndr->flags = _flags_save_STRUCT;
1553 : }
1554 : }
1555 :
1556 0 : _PUBLIC_ enum ndr_err_code ndr_push_NTLMv2_RESPONSE(struct ndr_push *ndr, int ndr_flags, const struct NTLMv2_RESPONSE *r)
1557 : {
1558 : {
1559 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1560 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1561 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1562 0 : if (ndr_flags & NDR_SCALARS) {
1563 0 : NDR_CHECK(ndr_push_align(ndr, 4));
1564 0 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Response, 16));
1565 0 : NDR_CHECK(ndr_push_NTLMv2_CLIENT_CHALLENGE(ndr, NDR_SCALARS, &r->Challenge));
1566 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
1567 : }
1568 0 : if (ndr_flags & NDR_BUFFERS) {
1569 0 : NDR_CHECK(ndr_push_NTLMv2_CLIENT_CHALLENGE(ndr, NDR_BUFFERS, &r->Challenge));
1570 : }
1571 0 : ndr->flags = _flags_save_STRUCT;
1572 : }
1573 0 : return NDR_ERR_SUCCESS;
1574 : }
1575 :
1576 14716 : _PUBLIC_ enum ndr_err_code ndr_pull_NTLMv2_RESPONSE(struct ndr_pull *ndr, int ndr_flags, struct NTLMv2_RESPONSE *r)
1577 : {
1578 14716 : uint32_t size_Response_0 = 0;
1579 : {
1580 14716 : uint32_t _flags_save_STRUCT = ndr->flags;
1581 14716 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1582 14716 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1583 14716 : if (ndr_flags & NDR_SCALARS) {
1584 14716 : NDR_CHECK(ndr_pull_align(ndr, 4));
1585 14716 : size_Response_0 = 16;
1586 14716 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Response, size_Response_0));
1587 14716 : NDR_CHECK(ndr_pull_NTLMv2_CLIENT_CHALLENGE(ndr, NDR_SCALARS, &r->Challenge));
1588 14714 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
1589 : }
1590 14714 : if (ndr_flags & NDR_BUFFERS) {
1591 14714 : NDR_CHECK(ndr_pull_NTLMv2_CLIENT_CHALLENGE(ndr, NDR_BUFFERS, &r->Challenge));
1592 : }
1593 14714 : ndr->flags = _flags_save_STRUCT;
1594 : }
1595 14714 : return NDR_ERR_SUCCESS;
1596 : }
1597 :
1598 0 : static void ndr_print_flags_NTLMv2_RESPONSE(struct ndr_print *ndr, const char *name, int unused, const struct NTLMv2_RESPONSE *r)
1599 : {
1600 0 : ndr_print_NTLMv2_RESPONSE(ndr, name, r);
1601 0 : }
1602 :
1603 0 : _PUBLIC_ void ndr_print_NTLMv2_RESPONSE(struct ndr_print *ndr, const char *name, const struct NTLMv2_RESPONSE *r)
1604 : {
1605 0 : ndr_print_struct(ndr, name, "NTLMv2_RESPONSE");
1606 0 : if (r == NULL) { ndr_print_null(ndr); return; }
1607 : {
1608 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1609 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
1610 0 : ndr->depth++;
1611 0 : ndr_print_array_uint8(ndr, "Response", r->Response, 16);
1612 0 : ndr_print_NTLMv2_CLIENT_CHALLENGE(ndr, "Challenge", &r->Challenge);
1613 0 : ndr->depth--;
1614 0 : ndr->flags = _flags_save_STRUCT;
1615 : }
1616 : }
1617 :
1618 0 : _PUBLIC_ enum ndr_err_code ndr_push_ntlmssp_NTLM_RESPONSE_with_len(struct ndr_push *ndr, int ndr_flags, const union ntlmssp_NTLM_RESPONSE_with_len *r)
1619 : {
1620 : uint32_t level;
1621 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1622 0 : if (ndr_flags & NDR_SCALARS) {
1623 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
1624 0 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
1625 0 : NDR_CHECK(ndr_push_union_align(ndr, 4));
1626 0 : switch (level) {
1627 0 : case 0: {
1628 0 : break; }
1629 :
1630 0 : case 0x18: {
1631 0 : NDR_CHECK(ndr_push_NTLM_RESPONSE(ndr, NDR_SCALARS, &r->v1));
1632 0 : break; }
1633 :
1634 0 : default: {
1635 0 : NDR_CHECK(ndr_push_NTLMv2_RESPONSE(ndr, NDR_SCALARS, &r->v2));
1636 0 : break; }
1637 :
1638 : }
1639 0 : }
1640 0 : if (ndr_flags & NDR_BUFFERS) {
1641 0 : if (!(ndr_flags & NDR_SCALARS)) {
1642 : /* We didn't get it above, and the token is not needed after this. */
1643 0 : NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
1644 : }
1645 0 : switch (level) {
1646 0 : case 0:
1647 0 : break;
1648 :
1649 0 : case 0x18:
1650 0 : break;
1651 :
1652 0 : default:
1653 0 : NDR_CHECK(ndr_push_NTLMv2_RESPONSE(ndr, NDR_BUFFERS, &r->v2));
1654 0 : break;
1655 :
1656 : }
1657 0 : }
1658 0 : return NDR_ERR_SUCCESS;
1659 : }
1660 :
1661 0 : _PUBLIC_ enum ndr_err_code ndr_pull_ntlmssp_NTLM_RESPONSE_with_len(struct ndr_pull *ndr, int ndr_flags, union ntlmssp_NTLM_RESPONSE_with_len *r)
1662 : {
1663 : uint32_t level;
1664 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1665 0 : if (ndr_flags & NDR_SCALARS) {
1666 : /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
1667 0 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
1668 0 : NDR_CHECK(ndr_pull_union_align(ndr, 4));
1669 0 : switch (level) {
1670 0 : case 0: {
1671 0 : break; }
1672 :
1673 0 : case 0x18: {
1674 0 : NDR_CHECK(ndr_pull_NTLM_RESPONSE(ndr, NDR_SCALARS, &r->v1));
1675 0 : break; }
1676 :
1677 0 : default: {
1678 0 : NDR_CHECK(ndr_pull_NTLMv2_RESPONSE(ndr, NDR_SCALARS, &r->v2));
1679 0 : break; }
1680 :
1681 : }
1682 0 : }
1683 0 : if (ndr_flags & NDR_BUFFERS) {
1684 0 : if (!(ndr_flags & NDR_SCALARS)) {
1685 : /* We didn't get it above, and the token is not needed after this. */
1686 0 : NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
1687 : }
1688 0 : switch (level) {
1689 0 : case 0:
1690 0 : break;
1691 :
1692 0 : case 0x18:
1693 0 : break;
1694 :
1695 0 : default:
1696 0 : NDR_CHECK(ndr_pull_NTLMv2_RESPONSE(ndr, NDR_BUFFERS, &r->v2));
1697 0 : break;
1698 :
1699 : }
1700 0 : }
1701 0 : return NDR_ERR_SUCCESS;
1702 : }
1703 :
1704 0 : _PUBLIC_ void ndr_print_ntlmssp_NTLM_RESPONSE_with_len(struct ndr_print *ndr, const char *name, const union ntlmssp_NTLM_RESPONSE_with_len *r)
1705 : {
1706 : uint32_t level;
1707 0 : level = ndr_print_steal_switch_value(ndr, r);
1708 0 : ndr_print_union(ndr, name, level, "ntlmssp_NTLM_RESPONSE_with_len");
1709 0 : switch (level) {
1710 0 : case 0:
1711 0 : break;
1712 :
1713 0 : case 0x18:
1714 0 : ndr_print_NTLM_RESPONSE(ndr, "v1", &r->v1);
1715 0 : break;
1716 :
1717 0 : default:
1718 0 : ndr_print_NTLMv2_RESPONSE(ndr, "v2", &r->v2);
1719 0 : break;
1720 :
1721 : }
1722 0 : }
1723 :
1724 0 : _PUBLIC_ enum ndr_err_code ndr_push_AUTHENTICATE_MESSAGE(struct ndr_push *ndr, int ndr_flags, const struct AUTHENTICATE_MESSAGE *r)
1725 : {
1726 : {
1727 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1728 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1729 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
1730 0 : if (ndr_flags & NDR_SCALARS) {
1731 0 : NDR_CHECK(ndr_push_align(ndr, 5));
1732 0 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "NTLMSSP", 8, sizeof(uint8_t), CH_DOS));
1733 0 : NDR_CHECK(ndr_push_ntlmssp_MessageType(ndr, NDR_SCALARS, NtLmAuthenticate));
1734 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->LmChallengeResponseLen));
1735 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->LmChallengeResponseLen));
1736 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->LmChallengeResponse));
1737 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->NtChallengeResponseLen));
1738 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->NtChallengeResponseLen));
1739 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->NtChallengeResponse));
1740 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_ntlmssp_string_length(r->NegotiateFlags, r->DomainName)));
1741 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_ntlmssp_string_length(r->NegotiateFlags, r->DomainName)));
1742 : {
1743 0 : uint32_t _flags_save_string = ndr->flags;
1744 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
1745 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->DomainName));
1746 0 : ndr->flags = _flags_save_string;
1747 : }
1748 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_ntlmssp_string_length(r->NegotiateFlags, r->UserName)));
1749 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_ntlmssp_string_length(r->NegotiateFlags, r->UserName)));
1750 : {
1751 0 : uint32_t _flags_save_string = ndr->flags;
1752 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
1753 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->UserName));
1754 0 : ndr->flags = _flags_save_string;
1755 : }
1756 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_ntlmssp_string_length(r->NegotiateFlags, r->Workstation)));
1757 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ndr_ntlmssp_string_length(r->NegotiateFlags, r->Workstation)));
1758 : {
1759 0 : uint32_t _flags_save_string = ndr->flags;
1760 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
1761 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->Workstation));
1762 0 : ndr->flags = _flags_save_string;
1763 : }
1764 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->EncryptedRandomSessionKey == NULL?0:r->EncryptedRandomSessionKey->length));
1765 0 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->EncryptedRandomSessionKey == NULL?0:r->EncryptedRandomSessionKey->length));
1766 0 : NDR_CHECK(ndr_push_relative_ptr1(ndr, r->EncryptedRandomSessionKey));
1767 0 : NDR_CHECK(ndr_push_NEGOTIATE(ndr, NDR_SCALARS, r->NegotiateFlags));
1768 0 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION));
1769 0 : NDR_CHECK(ndr_push_ntlmssp_Version(ndr, NDR_SCALARS, &r->Version));
1770 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
1771 : }
1772 0 : if (ndr_flags & NDR_BUFFERS) {
1773 0 : if (r->LmChallengeResponse) {
1774 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->LmChallengeResponse));
1775 : {
1776 : struct ndr_push *_ndr_LmChallengeResponse;
1777 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_LmChallengeResponse, 0, r->LmChallengeResponseLen));
1778 0 : NDR_CHECK(ndr_push_set_switch_value(_ndr_LmChallengeResponse, r->LmChallengeResponse, r->LmChallengeResponseLen));
1779 0 : NDR_CHECK(ndr_push_ntlmssp_LM_RESPONSE_with_len(_ndr_LmChallengeResponse, NDR_SCALARS|NDR_BUFFERS, r->LmChallengeResponse));
1780 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_LmChallengeResponse, 0, r->LmChallengeResponseLen));
1781 : }
1782 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->LmChallengeResponse));
1783 : }
1784 0 : if (r->NtChallengeResponse) {
1785 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->NtChallengeResponse));
1786 : {
1787 : struct ndr_push *_ndr_NtChallengeResponse;
1788 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_NtChallengeResponse, 0, r->NtChallengeResponseLen));
1789 0 : NDR_CHECK(ndr_push_set_switch_value(_ndr_NtChallengeResponse, r->NtChallengeResponse, r->NtChallengeResponseLen));
1790 0 : NDR_CHECK(ndr_push_ntlmssp_NTLM_RESPONSE_with_len(_ndr_NtChallengeResponse, NDR_SCALARS|NDR_BUFFERS, r->NtChallengeResponse));
1791 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_NtChallengeResponse, 0, r->NtChallengeResponseLen));
1792 : }
1793 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->NtChallengeResponse));
1794 : }
1795 : {
1796 0 : uint32_t _flags_save_string = ndr->flags;
1797 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
1798 0 : if (r->DomainName) {
1799 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->DomainName));
1800 : {
1801 : struct ndr_push *_ndr_DomainName;
1802 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_DomainName, 0, ndr_ntlmssp_string_length(r->NegotiateFlags, r->DomainName)));
1803 0 : NDR_CHECK(ndr_push_string(_ndr_DomainName, NDR_SCALARS, r->DomainName));
1804 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_DomainName, 0, ndr_ntlmssp_string_length(r->NegotiateFlags, r->DomainName)));
1805 : }
1806 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->DomainName));
1807 : }
1808 0 : ndr->flags = _flags_save_string;
1809 : }
1810 : {
1811 0 : uint32_t _flags_save_string = ndr->flags;
1812 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
1813 0 : if (r->UserName) {
1814 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->UserName));
1815 : {
1816 : struct ndr_push *_ndr_UserName;
1817 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_UserName, 0, ndr_ntlmssp_string_length(r->NegotiateFlags, r->UserName)));
1818 0 : NDR_CHECK(ndr_push_string(_ndr_UserName, NDR_SCALARS, r->UserName));
1819 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_UserName, 0, ndr_ntlmssp_string_length(r->NegotiateFlags, r->UserName)));
1820 : }
1821 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->UserName));
1822 : }
1823 0 : ndr->flags = _flags_save_string;
1824 : }
1825 : {
1826 0 : uint32_t _flags_save_string = ndr->flags;
1827 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
1828 0 : if (r->Workstation) {
1829 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->Workstation));
1830 : {
1831 : struct ndr_push *_ndr_Workstation;
1832 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_Workstation, 0, ndr_ntlmssp_string_length(r->NegotiateFlags, r->Workstation)));
1833 0 : NDR_CHECK(ndr_push_string(_ndr_Workstation, NDR_SCALARS, r->Workstation));
1834 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_Workstation, 0, ndr_ntlmssp_string_length(r->NegotiateFlags, r->Workstation)));
1835 : }
1836 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->Workstation));
1837 : }
1838 0 : ndr->flags = _flags_save_string;
1839 : }
1840 0 : if (r->EncryptedRandomSessionKey) {
1841 0 : NDR_CHECK(ndr_push_relative_ptr2_start(ndr, r->EncryptedRandomSessionKey));
1842 : {
1843 : struct ndr_push *_ndr_EncryptedRandomSessionKey;
1844 0 : NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_EncryptedRandomSessionKey, 0, r->EncryptedRandomSessionKey == NULL?0:r->EncryptedRandomSessionKey->length));
1845 0 : NDR_CHECK(ndr_push_DATA_BLOB(_ndr_EncryptedRandomSessionKey, NDR_SCALARS, *r->EncryptedRandomSessionKey));
1846 0 : NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_EncryptedRandomSessionKey, 0, r->EncryptedRandomSessionKey == NULL?0:r->EncryptedRandomSessionKey->length));
1847 : }
1848 0 : NDR_CHECK(ndr_push_relative_ptr2_end(ndr, r->EncryptedRandomSessionKey));
1849 : }
1850 0 : NDR_CHECK(ndr_push_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION));
1851 0 : NDR_CHECK(ndr_push_ntlmssp_Version(ndr, NDR_BUFFERS, &r->Version));
1852 : }
1853 0 : ndr->flags = _flags_save_STRUCT;
1854 : }
1855 0 : return NDR_ERR_SUCCESS;
1856 : }
1857 :
1858 0 : _PUBLIC_ enum ndr_err_code ndr_pull_AUTHENTICATE_MESSAGE(struct ndr_pull *ndr, int ndr_flags, struct AUTHENTICATE_MESSAGE *r)
1859 : {
1860 0 : uint32_t size_Signature_0 = 0;
1861 : uint32_t _ptr_LmChallengeResponse;
1862 0 : TALLOC_CTX *_mem_save_LmChallengeResponse_0 = NULL;
1863 : uint32_t _ptr_NtChallengeResponse;
1864 0 : TALLOC_CTX *_mem_save_NtChallengeResponse_0 = NULL;
1865 : uint32_t _ptr_DomainName;
1866 0 : TALLOC_CTX *_mem_save_DomainName_0 = NULL;
1867 : uint32_t _ptr_UserName;
1868 0 : TALLOC_CTX *_mem_save_UserName_0 = NULL;
1869 : uint32_t _ptr_Workstation;
1870 0 : TALLOC_CTX *_mem_save_Workstation_0 = NULL;
1871 : uint32_t _ptr_EncryptedRandomSessionKey;
1872 0 : TALLOC_CTX *_mem_save_EncryptedRandomSessionKey_0 = NULL;
1873 : {
1874 0 : uint32_t _flags_save_STRUCT = ndr->flags;
1875 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
1876 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
1877 0 : if (ndr_flags & NDR_SCALARS) {
1878 0 : NDR_CHECK(ndr_pull_align(ndr, 5));
1879 0 : size_Signature_0 = 8;
1880 0 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->Signature, size_Signature_0, sizeof(uint8_t), CH_DOS));
1881 0 : NDR_CHECK(ndr_pull_ntlmssp_MessageType(ndr, NDR_SCALARS, &r->MessageType));
1882 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->LmChallengeResponseLen));
1883 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->LmChallengeResponseMaxLen));
1884 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_LmChallengeResponse));
1885 0 : if (_ptr_LmChallengeResponse) {
1886 0 : NDR_PULL_ALLOC(ndr, r->LmChallengeResponse);
1887 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->LmChallengeResponse, _ptr_LmChallengeResponse));
1888 : } else {
1889 0 : r->LmChallengeResponse = NULL;
1890 : }
1891 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->NtChallengeResponseLen));
1892 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->NtChallengeResponseMaxLen));
1893 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_NtChallengeResponse));
1894 0 : if (_ptr_NtChallengeResponse) {
1895 0 : NDR_PULL_ALLOC(ndr, r->NtChallengeResponse);
1896 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->NtChallengeResponse, _ptr_NtChallengeResponse));
1897 : } else {
1898 0 : r->NtChallengeResponse = NULL;
1899 : }
1900 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->DomainNameLen));
1901 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->DomainNameMaxLen));
1902 : {
1903 0 : uint32_t _flags_save_string = ndr->flags;
1904 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
1905 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_DomainName));
1906 0 : if (_ptr_DomainName) {
1907 0 : NDR_PULL_ALLOC(ndr, r->DomainName);
1908 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->DomainName, _ptr_DomainName));
1909 : } else {
1910 0 : r->DomainName = NULL;
1911 : }
1912 0 : ndr->flags = _flags_save_string;
1913 : }
1914 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->UserNameLen));
1915 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->UserNameMaxLen));
1916 : {
1917 0 : uint32_t _flags_save_string = ndr->flags;
1918 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
1919 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_UserName));
1920 0 : if (_ptr_UserName) {
1921 0 : NDR_PULL_ALLOC(ndr, r->UserName);
1922 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->UserName, _ptr_UserName));
1923 : } else {
1924 0 : r->UserName = NULL;
1925 : }
1926 0 : ndr->flags = _flags_save_string;
1927 : }
1928 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->WorkstationLen));
1929 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->WorkstationMaxLen));
1930 : {
1931 0 : uint32_t _flags_save_string = ndr->flags;
1932 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
1933 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_Workstation));
1934 0 : if (_ptr_Workstation) {
1935 0 : NDR_PULL_ALLOC(ndr, r->Workstation);
1936 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->Workstation, _ptr_Workstation));
1937 : } else {
1938 0 : r->Workstation = NULL;
1939 : }
1940 0 : ndr->flags = _flags_save_string;
1941 : }
1942 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->EncryptedRandomSessionKeyLen));
1943 0 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->EncryptedRandomSessionKeyMaxLen));
1944 0 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_EncryptedRandomSessionKey));
1945 0 : if (_ptr_EncryptedRandomSessionKey) {
1946 0 : NDR_PULL_ALLOC(ndr, r->EncryptedRandomSessionKey);
1947 0 : NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->EncryptedRandomSessionKey, _ptr_EncryptedRandomSessionKey));
1948 : } else {
1949 0 : r->EncryptedRandomSessionKey = NULL;
1950 : }
1951 0 : NDR_CHECK(ndr_pull_NEGOTIATE(ndr, NDR_SCALARS, &r->NegotiateFlags));
1952 0 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION));
1953 0 : NDR_CHECK(ndr_pull_ntlmssp_Version(ndr, NDR_SCALARS, &r->Version));
1954 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
1955 : }
1956 0 : if (ndr_flags & NDR_BUFFERS) {
1957 0 : if (r->LmChallengeResponse) {
1958 : uint32_t _relative_save_offset;
1959 0 : _relative_save_offset = ndr->offset;
1960 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->LmChallengeResponse));
1961 0 : _mem_save_LmChallengeResponse_0 = NDR_PULL_GET_MEM_CTX(ndr);
1962 0 : NDR_PULL_SET_MEM_CTX(ndr, r->LmChallengeResponse, 0);
1963 : {
1964 : struct ndr_pull *_ndr_LmChallengeResponse;
1965 0 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_LmChallengeResponse, 0, r->LmChallengeResponseLen));
1966 0 : NDR_CHECK(ndr_pull_set_switch_value(_ndr_LmChallengeResponse, r->LmChallengeResponse, r->LmChallengeResponseLen));
1967 0 : NDR_CHECK(ndr_pull_ntlmssp_LM_RESPONSE_with_len(_ndr_LmChallengeResponse, NDR_SCALARS|NDR_BUFFERS, r->LmChallengeResponse));
1968 0 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_LmChallengeResponse, 0, r->LmChallengeResponseLen));
1969 : }
1970 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_LmChallengeResponse_0, 0);
1971 0 : if (ndr->offset > ndr->relative_highest_offset) {
1972 0 : ndr->relative_highest_offset = ndr->offset;
1973 : }
1974 0 : ndr->offset = _relative_save_offset;
1975 : }
1976 0 : if (r->NtChallengeResponse) {
1977 : uint32_t _relative_save_offset;
1978 0 : _relative_save_offset = ndr->offset;
1979 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->NtChallengeResponse));
1980 0 : _mem_save_NtChallengeResponse_0 = NDR_PULL_GET_MEM_CTX(ndr);
1981 0 : NDR_PULL_SET_MEM_CTX(ndr, r->NtChallengeResponse, 0);
1982 : {
1983 : struct ndr_pull *_ndr_NtChallengeResponse;
1984 0 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_NtChallengeResponse, 0, r->NtChallengeResponseMaxLen));
1985 0 : NDR_CHECK(ndr_pull_set_switch_value(_ndr_NtChallengeResponse, r->NtChallengeResponse, r->NtChallengeResponseLen));
1986 0 : NDR_CHECK(ndr_pull_ntlmssp_NTLM_RESPONSE_with_len(_ndr_NtChallengeResponse, NDR_SCALARS|NDR_BUFFERS, r->NtChallengeResponse));
1987 0 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_NtChallengeResponse, 0, r->NtChallengeResponseMaxLen));
1988 : }
1989 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_NtChallengeResponse_0, 0);
1990 0 : if (ndr->offset > ndr->relative_highest_offset) {
1991 0 : ndr->relative_highest_offset = ndr->offset;
1992 : }
1993 0 : ndr->offset = _relative_save_offset;
1994 : }
1995 : {
1996 0 : uint32_t _flags_save_string = ndr->flags;
1997 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
1998 0 : if (r->DomainName) {
1999 : uint32_t _relative_save_offset;
2000 0 : _relative_save_offset = ndr->offset;
2001 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->DomainName));
2002 0 : _mem_save_DomainName_0 = NDR_PULL_GET_MEM_CTX(ndr);
2003 0 : NDR_PULL_SET_MEM_CTX(ndr, r->DomainName, 0);
2004 : {
2005 : struct ndr_pull *_ndr_DomainName;
2006 0 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_DomainName, 0, r->DomainNameLen));
2007 0 : NDR_CHECK(ndr_pull_string(_ndr_DomainName, NDR_SCALARS, &r->DomainName));
2008 0 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_DomainName, 0, r->DomainNameLen));
2009 : }
2010 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_DomainName_0, 0);
2011 0 : if (ndr->offset > ndr->relative_highest_offset) {
2012 0 : ndr->relative_highest_offset = ndr->offset;
2013 : }
2014 0 : ndr->offset = _relative_save_offset;
2015 : }
2016 0 : ndr->flags = _flags_save_string;
2017 : }
2018 : {
2019 0 : uint32_t _flags_save_string = ndr->flags;
2020 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
2021 0 : if (r->UserName) {
2022 : uint32_t _relative_save_offset;
2023 0 : _relative_save_offset = ndr->offset;
2024 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->UserName));
2025 0 : _mem_save_UserName_0 = NDR_PULL_GET_MEM_CTX(ndr);
2026 0 : NDR_PULL_SET_MEM_CTX(ndr, r->UserName, 0);
2027 : {
2028 : struct ndr_pull *_ndr_UserName;
2029 0 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_UserName, 0, r->UserNameLen));
2030 0 : NDR_CHECK(ndr_pull_string(_ndr_UserName, NDR_SCALARS, &r->UserName));
2031 0 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_UserName, 0, r->UserNameLen));
2032 : }
2033 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_UserName_0, 0);
2034 0 : if (ndr->offset > ndr->relative_highest_offset) {
2035 0 : ndr->relative_highest_offset = ndr->offset;
2036 : }
2037 0 : ndr->offset = _relative_save_offset;
2038 : }
2039 0 : ndr->flags = _flags_save_string;
2040 : }
2041 : {
2042 0 : uint32_t _flags_save_string = ndr->flags;
2043 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
2044 0 : if (r->Workstation) {
2045 : uint32_t _relative_save_offset;
2046 0 : _relative_save_offset = ndr->offset;
2047 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->Workstation));
2048 0 : _mem_save_Workstation_0 = NDR_PULL_GET_MEM_CTX(ndr);
2049 0 : NDR_PULL_SET_MEM_CTX(ndr, r->Workstation, 0);
2050 : {
2051 : struct ndr_pull *_ndr_Workstation;
2052 0 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_Workstation, 0, r->WorkstationLen));
2053 0 : NDR_CHECK(ndr_pull_string(_ndr_Workstation, NDR_SCALARS, &r->Workstation));
2054 0 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_Workstation, 0, r->WorkstationLen));
2055 : }
2056 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_Workstation_0, 0);
2057 0 : if (ndr->offset > ndr->relative_highest_offset) {
2058 0 : ndr->relative_highest_offset = ndr->offset;
2059 : }
2060 0 : ndr->offset = _relative_save_offset;
2061 : }
2062 0 : ndr->flags = _flags_save_string;
2063 : }
2064 0 : if (r->EncryptedRandomSessionKey) {
2065 : uint32_t _relative_save_offset;
2066 0 : _relative_save_offset = ndr->offset;
2067 0 : NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->EncryptedRandomSessionKey));
2068 0 : _mem_save_EncryptedRandomSessionKey_0 = NDR_PULL_GET_MEM_CTX(ndr);
2069 0 : NDR_PULL_SET_MEM_CTX(ndr, r->EncryptedRandomSessionKey, 0);
2070 : {
2071 : struct ndr_pull *_ndr_EncryptedRandomSessionKey;
2072 0 : NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_EncryptedRandomSessionKey, 0, r->EncryptedRandomSessionKeyLen));
2073 0 : NDR_CHECK(ndr_pull_DATA_BLOB(_ndr_EncryptedRandomSessionKey, NDR_SCALARS, r->EncryptedRandomSessionKey));
2074 0 : NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_EncryptedRandomSessionKey, 0, r->EncryptedRandomSessionKeyLen));
2075 : }
2076 0 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_EncryptedRandomSessionKey_0, 0);
2077 0 : if (ndr->offset > ndr->relative_highest_offset) {
2078 0 : ndr->relative_highest_offset = ndr->offset;
2079 : }
2080 0 : ndr->offset = _relative_save_offset;
2081 : }
2082 0 : NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION));
2083 0 : NDR_CHECK(ndr_pull_ntlmssp_Version(ndr, NDR_BUFFERS, &r->Version));
2084 : }
2085 0 : ndr->flags = _flags_save_STRUCT;
2086 : }
2087 0 : return NDR_ERR_SUCCESS;
2088 : }
2089 :
2090 0 : static void ndr_print_flags_AUTHENTICATE_MESSAGE(struct ndr_print *ndr, const char *name, int unused, const struct AUTHENTICATE_MESSAGE *r)
2091 : {
2092 0 : ndr_print_AUTHENTICATE_MESSAGE(ndr, name, r);
2093 0 : }
2094 :
2095 0 : _PUBLIC_ void ndr_print_AUTHENTICATE_MESSAGE(struct ndr_print *ndr, const char *name, const struct AUTHENTICATE_MESSAGE *r)
2096 : {
2097 0 : ndr_print_struct(ndr, name, "AUTHENTICATE_MESSAGE");
2098 0 : if (r == NULL) { ndr_print_null(ndr); return; }
2099 : {
2100 0 : uint32_t _flags_save_STRUCT = ndr->flags;
2101 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
2102 0 : ndr->depth++;
2103 0 : ndr_print_string(ndr, "Signature", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?"NTLMSSP":r->Signature);
2104 0 : ndr_print_ntlmssp_MessageType(ndr, "MessageType", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NtLmAuthenticate:r->MessageType);
2105 0 : ndr_print_uint16(ndr, "LmChallengeResponseLen", r->LmChallengeResponseLen);
2106 0 : ndr_print_uint16(ndr, "LmChallengeResponseMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->LmChallengeResponseLen:r->LmChallengeResponseMaxLen);
2107 0 : ndr_print_ptr(ndr, "LmChallengeResponse", r->LmChallengeResponse);
2108 0 : ndr->depth++;
2109 0 : if (r->LmChallengeResponse) {
2110 0 : ndr_print_set_switch_value(ndr, r->LmChallengeResponse, r->LmChallengeResponseLen);
2111 0 : ndr_print_ntlmssp_LM_RESPONSE_with_len(ndr, "LmChallengeResponse", r->LmChallengeResponse);
2112 : }
2113 0 : ndr->depth--;
2114 0 : ndr_print_uint16(ndr, "NtChallengeResponseLen", r->NtChallengeResponseLen);
2115 0 : ndr_print_uint16(ndr, "NtChallengeResponseMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->NtChallengeResponseLen:r->NtChallengeResponseMaxLen);
2116 0 : ndr_print_ptr(ndr, "NtChallengeResponse", r->NtChallengeResponse);
2117 0 : ndr->depth++;
2118 0 : if (r->NtChallengeResponse) {
2119 0 : ndr_print_set_switch_value(ndr, r->NtChallengeResponse, r->NtChallengeResponseLen);
2120 0 : ndr_print_ntlmssp_NTLM_RESPONSE_with_len(ndr, "NtChallengeResponse", r->NtChallengeResponse);
2121 : }
2122 0 : ndr->depth--;
2123 0 : ndr_print_uint16(ndr, "DomainNameLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_ntlmssp_string_length(r->NegotiateFlags, r->DomainName):r->DomainNameLen);
2124 0 : ndr_print_uint16(ndr, "DomainNameMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->DomainNameLen:r->DomainNameMaxLen);
2125 : {
2126 0 : uint32_t _flags_save_string = ndr->flags;
2127 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
2128 0 : ndr_print_ptr(ndr, "DomainName", r->DomainName);
2129 0 : ndr->depth++;
2130 0 : if (r->DomainName) {
2131 0 : ndr_print_string(ndr, "DomainName", r->DomainName);
2132 : }
2133 0 : ndr->depth--;
2134 0 : ndr->flags = _flags_save_string;
2135 : }
2136 0 : ndr_print_uint16(ndr, "UserNameLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_ntlmssp_string_length(r->NegotiateFlags, r->UserName):r->UserNameLen);
2137 0 : ndr_print_uint16(ndr, "UserNameMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->UserNameLen:r->UserNameMaxLen);
2138 : {
2139 0 : uint32_t _flags_save_string = ndr->flags;
2140 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
2141 0 : ndr_print_ptr(ndr, "UserName", r->UserName);
2142 0 : ndr->depth++;
2143 0 : if (r->UserName) {
2144 0 : ndr_print_string(ndr, "UserName", r->UserName);
2145 : }
2146 0 : ndr->depth--;
2147 0 : ndr->flags = _flags_save_string;
2148 : }
2149 0 : ndr_print_uint16(ndr, "WorkstationLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_ntlmssp_string_length(r->NegotiateFlags, r->Workstation):r->WorkstationLen);
2150 0 : ndr_print_uint16(ndr, "WorkstationMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->WorkstationLen:r->WorkstationMaxLen);
2151 : {
2152 0 : uint32_t _flags_save_string = ndr->flags;
2153 0 : ndr_set_flags(&ndr->flags, ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags));
2154 0 : ndr_print_ptr(ndr, "Workstation", r->Workstation);
2155 0 : ndr->depth++;
2156 0 : if (r->Workstation) {
2157 0 : ndr_print_string(ndr, "Workstation", r->Workstation);
2158 : }
2159 0 : ndr->depth--;
2160 0 : ndr->flags = _flags_save_string;
2161 : }
2162 0 : ndr_print_uint16(ndr, "EncryptedRandomSessionKeyLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->EncryptedRandomSessionKey == NULL?0:r->EncryptedRandomSessionKey->length:r->EncryptedRandomSessionKeyLen);
2163 0 : ndr_print_uint16(ndr, "EncryptedRandomSessionKeyMaxLen", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->EncryptedRandomSessionKeyLen:r->EncryptedRandomSessionKeyMaxLen);
2164 0 : ndr_print_ptr(ndr, "EncryptedRandomSessionKey", r->EncryptedRandomSessionKey);
2165 0 : ndr->depth++;
2166 0 : if (r->EncryptedRandomSessionKey) {
2167 0 : ndr_print_DATA_BLOB(ndr, "EncryptedRandomSessionKey", *r->EncryptedRandomSessionKey);
2168 : }
2169 0 : ndr->depth--;
2170 0 : ndr_print_NEGOTIATE(ndr, "NegotiateFlags", r->NegotiateFlags);
2171 0 : ndr_print_set_switch_value(ndr, &r->Version, r->NegotiateFlags & NTLMSSP_NEGOTIATE_VERSION);
2172 0 : ndr_print_ntlmssp_Version(ndr, "Version", &r->Version);
2173 0 : ndr->depth--;
2174 0 : ndr->flags = _flags_save_STRUCT;
2175 : }
2176 : }
2177 :
2178 0 : _PUBLIC_ enum ndr_err_code ndr_push_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_push *ndr, int ndr_flags, const struct NTLMSSP_MESSAGE_SIGNATURE *r)
2179 : {
2180 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
2181 0 : if (ndr_flags & NDR_SCALARS) {
2182 0 : NDR_CHECK(ndr_push_align(ndr, 4));
2183 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, NTLMSSP_SIGN_VERSION));
2184 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->RandomPad));
2185 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->Checksum));
2186 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SeqNum));
2187 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2188 : }
2189 0 : if (ndr_flags & NDR_BUFFERS) {
2190 : }
2191 0 : return NDR_ERR_SUCCESS;
2192 : }
2193 :
2194 0 : _PUBLIC_ enum ndr_err_code ndr_pull_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_pull *ndr, int ndr_flags, struct NTLMSSP_MESSAGE_SIGNATURE *r)
2195 : {
2196 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
2197 0 : if (ndr_flags & NDR_SCALARS) {
2198 0 : NDR_CHECK(ndr_pull_align(ndr, 4));
2199 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Version));
2200 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->RandomPad));
2201 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Checksum));
2202 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SeqNum));
2203 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2204 : }
2205 0 : if (ndr_flags & NDR_BUFFERS) {
2206 : }
2207 0 : return NDR_ERR_SUCCESS;
2208 : }
2209 :
2210 0 : static void ndr_print_flags_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_print *ndr, const char *name, int unused, const struct NTLMSSP_MESSAGE_SIGNATURE *r)
2211 : {
2212 0 : ndr_print_NTLMSSP_MESSAGE_SIGNATURE(ndr, name, r);
2213 0 : }
2214 :
2215 0 : _PUBLIC_ void ndr_print_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_print *ndr, const char *name, const struct NTLMSSP_MESSAGE_SIGNATURE *r)
2216 : {
2217 0 : ndr_print_struct(ndr, name, "NTLMSSP_MESSAGE_SIGNATURE");
2218 0 : if (r == NULL) { ndr_print_null(ndr); return; }
2219 0 : ndr->depth++;
2220 0 : ndr_print_uint32(ndr, "Version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NTLMSSP_SIGN_VERSION:r->Version);
2221 0 : ndr_print_uint32(ndr, "RandomPad", r->RandomPad);
2222 0 : ndr_print_uint32(ndr, "Checksum", r->Checksum);
2223 0 : ndr_print_uint32(ndr, "SeqNum", r->SeqNum);
2224 0 : ndr->depth--;
2225 : }
2226 :
2227 0 : _PUBLIC_ enum ndr_err_code ndr_push_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_push *ndr, int ndr_flags, const struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 *r)
2228 : {
2229 : {
2230 0 : uint32_t _flags_save_STRUCT = ndr->flags;
2231 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2232 0 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
2233 0 : if (ndr_flags & NDR_SCALARS) {
2234 0 : NDR_CHECK(ndr_push_align(ndr, 4));
2235 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, NTLMSSP_SIGN_VERSION));
2236 0 : NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->Checksum, 8));
2237 0 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->SeqNum));
2238 0 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
2239 : }
2240 0 : if (ndr_flags & NDR_BUFFERS) {
2241 : }
2242 0 : ndr->flags = _flags_save_STRUCT;
2243 : }
2244 0 : return NDR_ERR_SUCCESS;
2245 : }
2246 :
2247 0 : _PUBLIC_ enum ndr_err_code ndr_pull_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_pull *ndr, int ndr_flags, struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 *r)
2248 : {
2249 0 : uint32_t size_Checksum_0 = 0;
2250 : {
2251 0 : uint32_t _flags_save_STRUCT = ndr->flags;
2252 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2253 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
2254 0 : if (ndr_flags & NDR_SCALARS) {
2255 0 : NDR_CHECK(ndr_pull_align(ndr, 4));
2256 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->Version));
2257 0 : size_Checksum_0 = 8;
2258 0 : NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->Checksum, size_Checksum_0));
2259 0 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->SeqNum));
2260 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
2261 : }
2262 0 : if (ndr_flags & NDR_BUFFERS) {
2263 : }
2264 0 : ndr->flags = _flags_save_STRUCT;
2265 : }
2266 0 : return NDR_ERR_SUCCESS;
2267 : }
2268 :
2269 0 : static void ndr_print_flags_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_print *ndr, const char *name, int unused, const struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 *r)
2270 : {
2271 0 : ndr_print_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(ndr, name, r);
2272 0 : }
2273 :
2274 0 : _PUBLIC_ void ndr_print_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_print *ndr, const char *name, const struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 *r)
2275 : {
2276 0 : ndr_print_struct(ndr, name, "NTLMSSP_MESSAGE_SIGNATURE_NTLMv2");
2277 0 : if (r == NULL) { ndr_print_null(ndr); return; }
2278 : {
2279 0 : uint32_t _flags_save_STRUCT = ndr->flags;
2280 0 : ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
2281 0 : ndr->depth++;
2282 0 : ndr_print_uint32(ndr, "Version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NTLMSSP_SIGN_VERSION:r->Version);
2283 0 : ndr_print_array_uint8(ndr, "Checksum", r->Checksum, 8);
2284 0 : ndr_print_uint32(ndr, "SeqNum", r->SeqNum);
2285 0 : ndr->depth--;
2286 0 : ndr->flags = _flags_save_STRUCT;
2287 : }
2288 : }
2289 :
2290 : #ifndef SKIP_NDR_TABLE_ntlmssp
2291 : static const struct ndr_interface_public_struct ntlmssp_public_structs[] = {
2292 : {
2293 : .name = "ntlmssp_VERSION",
2294 : .struct_size = sizeof(struct ntlmssp_VERSION ),
2295 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_ntlmssp_VERSION,
2296 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_ntlmssp_VERSION,
2297 : .ndr_print = (ndr_print_function_t) ndr_print_flags_ntlmssp_VERSION,
2298 : },
2299 : {
2300 : .name = "NEGOTIATE_MESSAGE",
2301 : .struct_size = sizeof(struct NEGOTIATE_MESSAGE ),
2302 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_NEGOTIATE_MESSAGE,
2303 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_NEGOTIATE_MESSAGE,
2304 : .ndr_print = (ndr_print_function_t) ndr_print_flags_NEGOTIATE_MESSAGE,
2305 : },
2306 : {
2307 : .name = "AV_PAIR",
2308 : .struct_size = sizeof(struct AV_PAIR ),
2309 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_AV_PAIR,
2310 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_AV_PAIR,
2311 : .ndr_print = (ndr_print_function_t) ndr_print_flags_AV_PAIR,
2312 : },
2313 : {
2314 : .name = "AV_PAIR_LIST",
2315 : .struct_size = sizeof(struct AV_PAIR_LIST ),
2316 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_AV_PAIR_LIST,
2317 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_AV_PAIR_LIST,
2318 : .ndr_print = (ndr_print_function_t) ndr_print_flags_AV_PAIR_LIST,
2319 : },
2320 : {
2321 : .name = "CHALLENGE_MESSAGE",
2322 : .struct_size = sizeof(struct CHALLENGE_MESSAGE ),
2323 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_CHALLENGE_MESSAGE,
2324 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_CHALLENGE_MESSAGE,
2325 : .ndr_print = (ndr_print_function_t) ndr_print_flags_CHALLENGE_MESSAGE,
2326 : },
2327 : {
2328 : .name = "LM_RESPONSE",
2329 : .struct_size = sizeof(struct LM_RESPONSE ),
2330 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_LM_RESPONSE,
2331 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_LM_RESPONSE,
2332 : .ndr_print = (ndr_print_function_t) ndr_print_flags_LM_RESPONSE,
2333 : },
2334 : {
2335 : .name = "LMv2_RESPONSE",
2336 : .struct_size = sizeof(struct LMv2_RESPONSE ),
2337 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_LMv2_RESPONSE,
2338 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_LMv2_RESPONSE,
2339 : .ndr_print = (ndr_print_function_t) ndr_print_flags_LMv2_RESPONSE,
2340 : },
2341 : {
2342 : .name = "NTLM_RESPONSE",
2343 : .struct_size = sizeof(struct NTLM_RESPONSE ),
2344 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_NTLM_RESPONSE,
2345 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_NTLM_RESPONSE,
2346 : .ndr_print = (ndr_print_function_t) ndr_print_flags_NTLM_RESPONSE,
2347 : },
2348 : {
2349 : .name = "NTLMv2_RESPONSE",
2350 : .struct_size = sizeof(struct NTLMv2_RESPONSE ),
2351 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_NTLMv2_RESPONSE,
2352 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_NTLMv2_RESPONSE,
2353 : .ndr_print = (ndr_print_function_t) ndr_print_flags_NTLMv2_RESPONSE,
2354 : },
2355 : {
2356 : .name = "AUTHENTICATE_MESSAGE",
2357 : .struct_size = sizeof(struct AUTHENTICATE_MESSAGE ),
2358 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_AUTHENTICATE_MESSAGE,
2359 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_AUTHENTICATE_MESSAGE,
2360 : .ndr_print = (ndr_print_function_t) ndr_print_flags_AUTHENTICATE_MESSAGE,
2361 : },
2362 : {
2363 : .name = "NTLMSSP_MESSAGE_SIGNATURE",
2364 : .struct_size = sizeof(struct NTLMSSP_MESSAGE_SIGNATURE ),
2365 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_NTLMSSP_MESSAGE_SIGNATURE,
2366 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_NTLMSSP_MESSAGE_SIGNATURE,
2367 : .ndr_print = (ndr_print_function_t) ndr_print_flags_NTLMSSP_MESSAGE_SIGNATURE,
2368 : },
2369 : {
2370 : .name = "NTLMSSP_MESSAGE_SIGNATURE_NTLMv2",
2371 : .struct_size = sizeof(struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 ),
2372 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2,
2373 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2,
2374 : .ndr_print = (ndr_print_function_t) ndr_print_flags_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2,
2375 : },
2376 : { .name = NULL }
2377 : };
2378 :
2379 : static const struct ndr_interface_call ntlmssp_calls[] = {
2380 : { .name = NULL }
2381 : };
2382 :
2383 : static const char * const ntlmssp_endpoint_strings[] = {
2384 : "ncacn_np:[\\pipe\\ntlmssp]",
2385 : };
2386 :
2387 : static const struct ndr_interface_string_array ntlmssp_endpoints = {
2388 : .count = 1,
2389 : .names = ntlmssp_endpoint_strings
2390 : };
2391 :
2392 : static const char * const ntlmssp_authservice_strings[] = {
2393 : "host",
2394 : };
2395 :
2396 : static const struct ndr_interface_string_array ntlmssp_authservices = {
2397 : .count = 1,
2398 : .names = ntlmssp_authservice_strings
2399 : };
2400 :
2401 :
2402 : const struct ndr_interface_table ndr_table_ntlmssp = {
2403 : .name = "ntlmssp",
2404 : .syntax_id = {
2405 : {0x6e746c6d,0x7373,0x700a,{0x00,0x00},{0x00,0x00,0x00,0x00}},
2406 : NDR_NTLMSSP_VERSION
2407 : },
2408 : .helpstring = NDR_NTLMSSP_HELPSTRING,
2409 : .num_calls = 0,
2410 : .calls = ntlmssp_calls,
2411 : .num_public_structs = 12,
2412 : .public_structs = ntlmssp_public_structs,
2413 : .endpoints = &ntlmssp_endpoints,
2414 : .authservices = &ntlmssp_authservices
2415 : };
2416 :
2417 : #endif /* SKIP_NDR_TABLE_ntlmssp */
|