1 /* parser auto-generated by pidl */
4 #include "../librpc/gen_ndr/ndr_ntlmssp.h"
6 static enum ndr_err_code
ndr_push_ntlmssp_MessageType(struct ndr_push
*ndr
, int ndr_flags
, enum ntlmssp_MessageType r
)
8 NDR_CHECK(ndr_push_enum_uint32(ndr
, NDR_SCALARS
, r
));
9 return NDR_ERR_SUCCESS
;
12 static enum ndr_err_code
ndr_pull_ntlmssp_MessageType(struct ndr_pull
*ndr
, int ndr_flags
, enum ntlmssp_MessageType
*r
)
15 NDR_CHECK(ndr_pull_enum_uint32(ndr
, NDR_SCALARS
, &v
));
17 return NDR_ERR_SUCCESS
;
20 _PUBLIC_
void ndr_print_ntlmssp_MessageType(struct ndr_print
*ndr
, const char *name
, enum ntlmssp_MessageType r
)
22 const char *val
= NULL
;
25 case NtLmNegotiate
: val
= "NtLmNegotiate"; break;
26 case NtLmChallenge
: val
= "NtLmChallenge"; break;
27 case NtLmAuthenticate
: val
= "NtLmAuthenticate"; break;
29 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
32 static enum ndr_err_code
ndr_push_NEGOTIATE(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
34 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
35 return NDR_ERR_SUCCESS
;
38 static enum ndr_err_code
ndr_pull_NEGOTIATE(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
41 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
43 return NDR_ERR_SUCCESS
;
46 _PUBLIC_
void ndr_print_NEGOTIATE(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
48 ndr_print_uint32(ndr
, name
, r
);
50 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_UNICODE", NTLMSSP_NEGOTIATE_UNICODE
, r
);
51 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_OEM", NTLMSSP_NEGOTIATE_OEM
, r
);
52 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_REQUEST_TARGET", NTLMSSP_REQUEST_TARGET
, r
);
53 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_SIGN", NTLMSSP_NEGOTIATE_SIGN
, r
);
54 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_SEAL", NTLMSSP_NEGOTIATE_SEAL
, r
);
55 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_DATAGRAM", NTLMSSP_NEGOTIATE_DATAGRAM
, r
);
56 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_LM_KEY", NTLMSSP_NEGOTIATE_LM_KEY
, r
);
57 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_NETWARE", NTLMSSP_NEGOTIATE_NETWARE
, r
);
58 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_NTLM", NTLMSSP_NEGOTIATE_NTLM
, r
);
59 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_NT_ONLY", NTLMSSP_NEGOTIATE_NT_ONLY
, r
);
60 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_ANONYMOUS", NTLMSSP_ANONYMOUS
, r
);
61 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED", NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED
, r
);
62 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED", NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED
, r
);
63 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL", NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL
, r
);
64 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_ALWAYS_SIGN", NTLMSSP_NEGOTIATE_ALWAYS_SIGN
, r
);
65 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_TARGET_TYPE_DOMAIN", NTLMSSP_TARGET_TYPE_DOMAIN
, r
);
66 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_TARGET_TYPE_SERVER", NTLMSSP_TARGET_TYPE_SERVER
, r
);
67 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_TARGET_TYPE_SHARE", NTLMSSP_TARGET_TYPE_SHARE
, r
);
68 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY", NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
, r
);
69 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_IDENTIFY", NTLMSSP_NEGOTIATE_IDENTIFY
, r
);
70 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_REQUEST_NON_NT_SESSION_KEY", NTLMSSP_REQUEST_NON_NT_SESSION_KEY
, r
);
71 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_TARGET_INFO", NTLMSSP_NEGOTIATE_TARGET_INFO
, r
);
72 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_VERSION", NTLMSSP_NEGOTIATE_VERSION
, r
);
73 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_128", NTLMSSP_NEGOTIATE_128
, r
);
74 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_KEY_EXCH", NTLMSSP_NEGOTIATE_KEY_EXCH
, r
);
75 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_NEGOTIATE_56", NTLMSSP_NEGOTIATE_56
, r
);
79 static enum ndr_err_code
ndr_push_ntlmssp_WindowsMajorVersion(struct ndr_push
*ndr
, int ndr_flags
, enum ntlmssp_WindowsMajorVersion r
)
81 NDR_CHECK(ndr_push_enum_uint8(ndr
, NDR_SCALARS
, r
));
82 return NDR_ERR_SUCCESS
;
85 static enum ndr_err_code
ndr_pull_ntlmssp_WindowsMajorVersion(struct ndr_pull
*ndr
, int ndr_flags
, enum ntlmssp_WindowsMajorVersion
*r
)
88 NDR_CHECK(ndr_pull_enum_uint8(ndr
, NDR_SCALARS
, &v
));
90 return NDR_ERR_SUCCESS
;
93 _PUBLIC_
void ndr_print_ntlmssp_WindowsMajorVersion(struct ndr_print
*ndr
, const char *name
, enum ntlmssp_WindowsMajorVersion r
)
95 const char *val
= NULL
;
98 case NTLMSSP_WINDOWS_MAJOR_VERSION_5
: val
= "NTLMSSP_WINDOWS_MAJOR_VERSION_5"; break;
99 case NTLMSSP_WINDOWS_MAJOR_VERSION_6
: val
= "NTLMSSP_WINDOWS_MAJOR_VERSION_6"; break;
101 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
104 static enum ndr_err_code
ndr_push_ntlmssp_WindowsMinorVersion(struct ndr_push
*ndr
, int ndr_flags
, enum ntlmssp_WindowsMinorVersion r
)
106 NDR_CHECK(ndr_push_enum_uint8(ndr
, NDR_SCALARS
, r
));
107 return NDR_ERR_SUCCESS
;
110 static enum ndr_err_code
ndr_pull_ntlmssp_WindowsMinorVersion(struct ndr_pull
*ndr
, int ndr_flags
, enum ntlmssp_WindowsMinorVersion
*r
)
113 NDR_CHECK(ndr_pull_enum_uint8(ndr
, NDR_SCALARS
, &v
));
115 return NDR_ERR_SUCCESS
;
118 _PUBLIC_
void ndr_print_ntlmssp_WindowsMinorVersion(struct ndr_print
*ndr
, const char *name
, enum ntlmssp_WindowsMinorVersion r
)
120 const char *val
= NULL
;
123 case NTLMSSP_WINDOWS_MINOR_VERSION_0
: val
= "NTLMSSP_WINDOWS_MINOR_VERSION_0"; break;
124 case NTLMSSP_WINDOWS_MINOR_VERSION_1
: val
= "NTLMSSP_WINDOWS_MINOR_VERSION_1"; break;
125 case NTLMSSP_WINDOWS_MINOR_VERSION_2
: val
= "NTLMSSP_WINDOWS_MINOR_VERSION_2"; break;
127 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
130 static enum ndr_err_code
ndr_push_ntlmssp_NTLMRevisionCurrent(struct ndr_push
*ndr
, int ndr_flags
, enum ntlmssp_NTLMRevisionCurrent r
)
132 NDR_CHECK(ndr_push_enum_uint8(ndr
, NDR_SCALARS
, r
));
133 return NDR_ERR_SUCCESS
;
136 static enum ndr_err_code
ndr_pull_ntlmssp_NTLMRevisionCurrent(struct ndr_pull
*ndr
, int ndr_flags
, enum ntlmssp_NTLMRevisionCurrent
*r
)
139 NDR_CHECK(ndr_pull_enum_uint8(ndr
, NDR_SCALARS
, &v
));
141 return NDR_ERR_SUCCESS
;
144 _PUBLIC_
void ndr_print_ntlmssp_NTLMRevisionCurrent(struct ndr_print
*ndr
, const char *name
, enum ntlmssp_NTLMRevisionCurrent r
)
146 const char *val
= NULL
;
149 case NTLMSSP_REVISION_W2K3_RC1
: val
= "NTLMSSP_REVISION_W2K3_RC1"; break;
150 case NTLMSSP_REVISION_W2K3
: val
= "NTLMSSP_REVISION_W2K3"; break;
152 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
155 static enum ndr_err_code
ndr_push_VERSION(struct ndr_push
*ndr
, int ndr_flags
, const struct VERSION
*r
)
157 if (ndr_flags
& NDR_SCALARS
) {
158 NDR_CHECK(ndr_push_align(ndr
, 2));
159 NDR_CHECK(ndr_push_ntlmssp_WindowsMajorVersion(ndr
, NDR_SCALARS
, r
->ProductMajorVersion
));
160 NDR_CHECK(ndr_push_ntlmssp_WindowsMinorVersion(ndr
, NDR_SCALARS
, r
->ProductMinorVersion
));
161 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->ProductBuild
));
162 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Reserved
, 3));
163 NDR_CHECK(ndr_push_ntlmssp_NTLMRevisionCurrent(ndr
, NDR_SCALARS
, r
->NTLMRevisionCurrent
));
164 NDR_CHECK(ndr_push_trailer_align(ndr
, 2));
166 if (ndr_flags
& NDR_BUFFERS
) {
168 return NDR_ERR_SUCCESS
;
171 static enum ndr_err_code
ndr_pull_VERSION(struct ndr_pull
*ndr
, int ndr_flags
, struct VERSION
*r
)
173 if (ndr_flags
& NDR_SCALARS
) {
174 NDR_CHECK(ndr_pull_align(ndr
, 2));
175 NDR_CHECK(ndr_pull_ntlmssp_WindowsMajorVersion(ndr
, NDR_SCALARS
, &r
->ProductMajorVersion
));
176 NDR_CHECK(ndr_pull_ntlmssp_WindowsMinorVersion(ndr
, NDR_SCALARS
, &r
->ProductMinorVersion
));
177 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->ProductBuild
));
178 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Reserved
, 3));
179 NDR_CHECK(ndr_pull_ntlmssp_NTLMRevisionCurrent(ndr
, NDR_SCALARS
, &r
->NTLMRevisionCurrent
));
180 NDR_CHECK(ndr_pull_trailer_align(ndr
, 2));
182 if (ndr_flags
& NDR_BUFFERS
) {
184 return NDR_ERR_SUCCESS
;
187 _PUBLIC_
void ndr_print_VERSION(struct ndr_print
*ndr
, const char *name
, const struct VERSION
*r
)
189 ndr_print_struct(ndr
, name
, "VERSION");
191 ndr_print_ntlmssp_WindowsMajorVersion(ndr
, "ProductMajorVersion", r
->ProductMajorVersion
);
192 ndr_print_ntlmssp_WindowsMinorVersion(ndr
, "ProductMinorVersion", r
->ProductMinorVersion
);
193 ndr_print_uint16(ndr
, "ProductBuild", r
->ProductBuild
);
194 ndr_print_array_uint8(ndr
, "Reserved", r
->Reserved
, 3);
195 ndr_print_ntlmssp_NTLMRevisionCurrent(ndr
, "NTLMRevisionCurrent", r
->NTLMRevisionCurrent
);
199 static enum ndr_err_code
ndr_push_ntlmssp_Version(struct ndr_push
*ndr
, int ndr_flags
, const union ntlmssp_Version
*r
)
201 if (ndr_flags
& NDR_SCALARS
) {
202 int level
= ndr_push_get_switch_value(ndr
, r
);
203 NDR_CHECK(ndr_push_union_align(ndr
, 2));
205 case NTLMSSP_NEGOTIATE_VERSION
: {
206 NDR_CHECK(ndr_push_VERSION(ndr
, NDR_SCALARS
, &r
->version
));
214 if (ndr_flags
& NDR_BUFFERS
) {
215 int level
= ndr_push_get_switch_value(ndr
, r
);
217 case NTLMSSP_NEGOTIATE_VERSION
:
225 return NDR_ERR_SUCCESS
;
228 static enum ndr_err_code
ndr_pull_ntlmssp_Version(struct ndr_pull
*ndr
, int ndr_flags
, union ntlmssp_Version
*r
)
231 level
= ndr_pull_get_switch_value(ndr
, r
);
232 if (ndr_flags
& NDR_SCALARS
) {
233 NDR_CHECK(ndr_pull_union_align(ndr
, 2));
235 case NTLMSSP_NEGOTIATE_VERSION
: {
236 NDR_CHECK(ndr_pull_VERSION(ndr
, NDR_SCALARS
, &r
->version
));
244 if (ndr_flags
& NDR_BUFFERS
) {
246 case NTLMSSP_NEGOTIATE_VERSION
:
254 return NDR_ERR_SUCCESS
;
257 _PUBLIC_
enum ndr_err_code
ndr_push_NEGOTIATE_MESSAGE(struct ndr_push
*ndr
, int ndr_flags
, const struct NEGOTIATE_MESSAGE
*r
)
259 if (ndr_flags
& NDR_SCALARS
) {
260 NDR_CHECK(ndr_push_align(ndr
, 5));
261 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, "NTLMSSP", 8, sizeof(uint8_t), CH_DOS
));
262 NDR_CHECK(ndr_push_ntlmssp_MessageType(ndr
, NDR_SCALARS
, NtLmNegotiate
));
263 NDR_CHECK(ndr_push_NEGOTIATE(ndr
, NDR_SCALARS
, r
->NegotiateFlags
));
264 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, strlen(r
->DomainName
)));
265 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, strlen(r
->DomainName
)));
267 uint32_t _flags_save_string
= ndr
->flags
;
268 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM
));
269 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->DomainName
));
270 ndr
->flags
= _flags_save_string
;
272 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, strlen(r
->Workstation
)));
273 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, strlen(r
->Workstation
)));
275 uint32_t _flags_save_string
= ndr
->flags
;
276 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM
));
277 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->Workstation
));
278 ndr
->flags
= _flags_save_string
;
280 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
));
281 NDR_CHECK(ndr_push_ntlmssp_Version(ndr
, NDR_SCALARS
, &r
->Version
));
282 NDR_CHECK(ndr_push_trailer_align(ndr
, 5));
284 if (ndr_flags
& NDR_BUFFERS
) {
286 uint32_t _flags_save_string
= ndr
->flags
;
287 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM
));
289 NDR_CHECK(ndr_push_relative_ptr2(ndr
, r
->DomainName
));
291 struct ndr_push
*_ndr_DomainName
;
292 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_DomainName
, 0, strlen(r
->DomainName
)));
293 NDR_CHECK(ndr_push_string(_ndr_DomainName
, NDR_SCALARS
, r
->DomainName
));
294 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_DomainName
, 0, strlen(r
->DomainName
)));
297 ndr
->flags
= _flags_save_string
;
300 uint32_t _flags_save_string
= ndr
->flags
;
301 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM
));
302 if (r
->Workstation
) {
303 NDR_CHECK(ndr_push_relative_ptr2(ndr
, r
->Workstation
));
305 struct ndr_push
*_ndr_Workstation
;
306 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_Workstation
, 0, strlen(r
->Workstation
)));
307 NDR_CHECK(ndr_push_string(_ndr_Workstation
, NDR_SCALARS
, r
->Workstation
));
308 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_Workstation
, 0, strlen(r
->Workstation
)));
311 ndr
->flags
= _flags_save_string
;
313 NDR_CHECK(ndr_push_ntlmssp_Version(ndr
, NDR_BUFFERS
, &r
->Version
));
315 return NDR_ERR_SUCCESS
;
318 _PUBLIC_
enum ndr_err_code
ndr_pull_NEGOTIATE_MESSAGE(struct ndr_pull
*ndr
, int ndr_flags
, struct NEGOTIATE_MESSAGE
*r
)
320 uint32_t _ptr_DomainName
;
321 TALLOC_CTX
*_mem_save_DomainName_0
;
322 uint32_t _ptr_Workstation
;
323 TALLOC_CTX
*_mem_save_Workstation_0
;
324 if (ndr_flags
& NDR_SCALARS
) {
325 NDR_CHECK(ndr_pull_align(ndr
, 5));
326 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->Signature
, 8, sizeof(uint8_t), CH_DOS
));
327 NDR_CHECK(ndr_pull_ntlmssp_MessageType(ndr
, NDR_SCALARS
, &r
->MessageType
));
328 NDR_CHECK(ndr_pull_NEGOTIATE(ndr
, NDR_SCALARS
, &r
->NegotiateFlags
));
329 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->DomainNameLen
));
330 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->DomainNameMaxLen
));
332 uint32_t _flags_save_string
= ndr
->flags
;
333 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM
));
334 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_DomainName
));
335 if (_ptr_DomainName
) {
336 NDR_PULL_ALLOC(ndr
, r
->DomainName
);
337 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->DomainName
, _ptr_DomainName
));
339 r
->DomainName
= NULL
;
341 ndr
->flags
= _flags_save_string
;
343 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->WorkstationLen
));
344 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->WorkstationMaxLen
));
346 uint32_t _flags_save_string
= ndr
->flags
;
347 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM
));
348 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_Workstation
));
349 if (_ptr_Workstation
) {
350 NDR_PULL_ALLOC(ndr
, r
->Workstation
);
351 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->Workstation
, _ptr_Workstation
));
353 r
->Workstation
= NULL
;
355 ndr
->flags
= _flags_save_string
;
357 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
));
358 NDR_CHECK(ndr_pull_ntlmssp_Version(ndr
, NDR_SCALARS
, &r
->Version
));
359 NDR_CHECK(ndr_pull_trailer_align(ndr
, 5));
361 if (ndr_flags
& NDR_BUFFERS
) {
363 uint32_t _flags_save_string
= ndr
->flags
;
364 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM
));
366 uint32_t _relative_save_offset
;
367 _relative_save_offset
= ndr
->offset
;
368 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->DomainName
));
369 _mem_save_DomainName_0
= NDR_PULL_GET_MEM_CTX(ndr
);
370 NDR_PULL_SET_MEM_CTX(ndr
, r
->DomainName
, 0);
372 struct ndr_pull
*_ndr_DomainName
;
373 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_DomainName
, 0, r
->DomainNameLen
));
374 NDR_CHECK(ndr_pull_string(_ndr_DomainName
, NDR_SCALARS
, &r
->DomainName
));
375 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_DomainName
, 0, r
->DomainNameLen
));
377 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_DomainName_0
, 0);
378 if (ndr
->offset
> ndr
->relative_highest_offset
) {
379 ndr
->relative_highest_offset
= ndr
->offset
;
381 ndr
->offset
= _relative_save_offset
;
383 ndr
->flags
= _flags_save_string
;
386 uint32_t _flags_save_string
= ndr
->flags
;
387 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM
));
388 if (r
->Workstation
) {
389 uint32_t _relative_save_offset
;
390 _relative_save_offset
= ndr
->offset
;
391 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->Workstation
));
392 _mem_save_Workstation_0
= NDR_PULL_GET_MEM_CTX(ndr
);
393 NDR_PULL_SET_MEM_CTX(ndr
, r
->Workstation
, 0);
395 struct ndr_pull
*_ndr_Workstation
;
396 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_Workstation
, 0, r
->WorkstationLen
));
397 NDR_CHECK(ndr_pull_string(_ndr_Workstation
, NDR_SCALARS
, &r
->Workstation
));
398 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_Workstation
, 0, r
->WorkstationLen
));
400 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_Workstation_0
, 0);
401 if (ndr
->offset
> ndr
->relative_highest_offset
) {
402 ndr
->relative_highest_offset
= ndr
->offset
;
404 ndr
->offset
= _relative_save_offset
;
406 ndr
->flags
= _flags_save_string
;
408 NDR_CHECK(ndr_pull_ntlmssp_Version(ndr
, NDR_BUFFERS
, &r
->Version
));
410 return NDR_ERR_SUCCESS
;
413 _PUBLIC_
void ndr_print_NEGOTIATE_MESSAGE(struct ndr_print
*ndr
, const char *name
, const struct NEGOTIATE_MESSAGE
*r
)
415 ndr_print_struct(ndr
, name
, "NEGOTIATE_MESSAGE");
417 ndr_print_string(ndr
, "Signature", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?"NTLMSSP":r
->Signature
);
418 ndr_print_ntlmssp_MessageType(ndr
, "MessageType", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?NtLmNegotiate
:r
->MessageType
);
419 ndr_print_NEGOTIATE(ndr
, "NegotiateFlags", r
->NegotiateFlags
);
420 ndr_print_uint16(ndr
, "DomainNameLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?strlen(r
->DomainName
):r
->DomainNameLen
);
421 ndr_print_uint16(ndr
, "DomainNameMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->DomainNameLen
:r
->DomainNameMaxLen
);
422 ndr_print_ptr(ndr
, "DomainName", r
->DomainName
);
425 ndr_print_string(ndr
, "DomainName", r
->DomainName
);
428 ndr_print_uint16(ndr
, "WorkstationLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?strlen(r
->Workstation
):r
->WorkstationLen
);
429 ndr_print_uint16(ndr
, "WorkstationMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->WorkstationLen
:r
->WorkstationMaxLen
);
430 ndr_print_ptr(ndr
, "Workstation", r
->Workstation
);
432 if (r
->Workstation
) {
433 ndr_print_string(ndr
, "Workstation", r
->Workstation
);
436 ndr_print_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
);
437 ndr_print_ntlmssp_Version(ndr
, "Version", &r
->Version
);
441 static enum ndr_err_code
ndr_push_ntlmssp_AvId(struct ndr_push
*ndr
, int ndr_flags
, enum ntlmssp_AvId r
)
443 NDR_CHECK(ndr_push_enum_uint1632(ndr
, NDR_SCALARS
, r
));
444 return NDR_ERR_SUCCESS
;
447 static enum ndr_err_code
ndr_pull_ntlmssp_AvId(struct ndr_pull
*ndr
, int ndr_flags
, enum ntlmssp_AvId
*r
)
450 NDR_CHECK(ndr_pull_enum_uint1632(ndr
, NDR_SCALARS
, &v
));
452 return NDR_ERR_SUCCESS
;
455 _PUBLIC_
void ndr_print_ntlmssp_AvId(struct ndr_print
*ndr
, const char *name
, enum ntlmssp_AvId r
)
457 const char *val
= NULL
;
460 case MsvAvEOL
: val
= "MsvAvEOL"; break;
461 case MsvAvNbComputerName
: val
= "MsvAvNbComputerName"; break;
462 case MsvAvNbDomainName
: val
= "MsvAvNbDomainName"; break;
463 case MsvAvDnsComputerName
: val
= "MsvAvDnsComputerName"; break;
464 case MsvAvDnsDomainName
: val
= "MsvAvDnsDomainName"; break;
465 case MsvAvDnsTreeName
: val
= "MsvAvDnsTreeName"; break;
466 case MsvAvFlags
: val
= "MsvAvFlags"; break;
467 case MsvAvTimestamp
: val
= "MsvAvTimestamp"; break;
468 case MsAvRestrictions
: val
= "MsAvRestrictions"; break;
469 case MsvAvTargetName
: val
= "MsvAvTargetName"; break;
470 case MsvChannelBindings
: val
= "MsvChannelBindings"; break;
472 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
475 static enum ndr_err_code
ndr_push_Restriction_Encoding(struct ndr_push
*ndr
, int ndr_flags
, const struct Restriction_Encoding
*r
)
477 if (ndr_flags
& NDR_SCALARS
) {
478 NDR_CHECK(ndr_push_align(ndr
, 4));
479 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->Size
));
480 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
481 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->IntegrityLevel
));
482 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SubjectIntegrityLevel
));
483 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->MachineId
, 32));
484 NDR_CHECK(ndr_push_trailer_align(ndr
, 4));
486 if (ndr_flags
& NDR_BUFFERS
) {
488 return NDR_ERR_SUCCESS
;
491 static enum ndr_err_code
ndr_pull_Restriction_Encoding(struct ndr_pull
*ndr
, int ndr_flags
, struct Restriction_Encoding
*r
)
493 if (ndr_flags
& NDR_SCALARS
) {
494 NDR_CHECK(ndr_pull_align(ndr
, 4));
495 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->Size
));
496 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->Z4
));
497 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->IntegrityLevel
));
498 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SubjectIntegrityLevel
));
499 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->MachineId
, 32));
500 NDR_CHECK(ndr_pull_trailer_align(ndr
, 4));
502 if (ndr_flags
& NDR_BUFFERS
) {
504 return NDR_ERR_SUCCESS
;
507 _PUBLIC_
void ndr_print_Restriction_Encoding(struct ndr_print
*ndr
, const char *name
, const struct Restriction_Encoding
*r
)
509 ndr_print_struct(ndr
, name
, "Restriction_Encoding");
511 ndr_print_uint32(ndr
, "Size", r
->Size
);
512 ndr_print_uint32(ndr
, "Z4", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?0:r
->Z4
);
513 ndr_print_uint32(ndr
, "IntegrityLevel", r
->IntegrityLevel
);
514 ndr_print_uint32(ndr
, "SubjectIntegrityLevel", r
->SubjectIntegrityLevel
);
515 ndr_print_array_uint8(ndr
, "MachineId", r
->MachineId
, 32);
519 static enum ndr_err_code
ndr_push_ntlmssp_AvFlags(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
521 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
522 return NDR_ERR_SUCCESS
;
525 static enum ndr_err_code
ndr_pull_ntlmssp_AvFlags(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
528 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
530 return NDR_ERR_SUCCESS
;
533 _PUBLIC_
void ndr_print_ntlmssp_AvFlags(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
535 ndr_print_uint32(ndr
, name
, r
);
537 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT", NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT
, r
);
538 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE", NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE
, r
);
542 static enum ndr_err_code
ndr_push_ntlmssp_AvValue(struct ndr_push
*ndr
, int ndr_flags
, const union ntlmssp_AvValue
*r
)
545 uint32_t _flags_save_UNION
= ndr
->flags
;
546 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_NOALIGN
);
547 if (ndr_flags
& NDR_SCALARS
) {
548 int level
= ndr_push_get_switch_value(ndr
, r
);
549 NDR_CHECK(ndr_push_union_align(ndr
, 4));
554 case MsvAvNbComputerName
: {
556 uint32_t _flags_save_string
= ndr
->flags
;
557 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
558 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->AvNbComputerName
));
559 ndr
->flags
= _flags_save_string
;
563 case MsvAvNbDomainName
: {
565 uint32_t _flags_save_string
= ndr
->flags
;
566 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
567 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->AvNbDomainName
));
568 ndr
->flags
= _flags_save_string
;
572 case MsvAvDnsComputerName
: {
574 uint32_t _flags_save_string
= ndr
->flags
;
575 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
576 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->AvDnsComputerName
));
577 ndr
->flags
= _flags_save_string
;
581 case MsvAvDnsDomainName
: {
583 uint32_t _flags_save_string
= ndr
->flags
;
584 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
585 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->AvDnsDomainName
));
586 ndr
->flags
= _flags_save_string
;
590 case MsvAvDnsTreeName
: {
592 uint32_t _flags_save_string
= ndr
->flags
;
593 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
594 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->AvDnsTreeName
));
595 ndr
->flags
= _flags_save_string
;
600 NDR_CHECK(ndr_push_ntlmssp_AvFlags(ndr
, NDR_SCALARS
, r
->AvFlags
));
603 case MsvAvTimestamp
: {
604 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->AvTimestamp
));
607 case MsAvRestrictions
: {
608 NDR_CHECK(ndr_push_Restriction_Encoding(ndr
, NDR_SCALARS
, &r
->AvRestrictions
));
611 case MsvAvTargetName
: {
613 uint32_t _flags_save_string
= ndr
->flags
;
614 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
615 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->AvTargetName
));
616 ndr
->flags
= _flags_save_string
;
620 case MsvChannelBindings
: {
621 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->ChannelBindings
, 16));
626 uint32_t _flags_save_DATA_BLOB
= ndr
->flags
;
627 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
628 NDR_CHECK(ndr_push_DATA_BLOB(ndr
, NDR_SCALARS
, r
->blob
));
629 ndr
->flags
= _flags_save_DATA_BLOB
;
635 if (ndr_flags
& NDR_BUFFERS
) {
636 int level
= ndr_push_get_switch_value(ndr
, r
);
641 case MsvAvNbComputerName
:
644 case MsvAvNbDomainName
:
647 case MsvAvDnsComputerName
:
650 case MsvAvDnsDomainName
:
653 case MsvAvDnsTreeName
:
662 case MsAvRestrictions
:
665 case MsvAvTargetName
:
668 case MsvChannelBindings
:
676 ndr
->flags
= _flags_save_UNION
;
678 return NDR_ERR_SUCCESS
;
681 static enum ndr_err_code
ndr_pull_ntlmssp_AvValue(struct ndr_pull
*ndr
, int ndr_flags
, union ntlmssp_AvValue
*r
)
685 uint32_t _flags_save_UNION
= ndr
->flags
;
686 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_NOALIGN
);
687 level
= ndr_pull_get_switch_value(ndr
, r
);
688 if (ndr_flags
& NDR_SCALARS
) {
689 NDR_CHECK(ndr_pull_union_align(ndr
, 4));
694 case MsvAvNbComputerName
: {
696 uint32_t _flags_save_string
= ndr
->flags
;
697 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
698 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->AvNbComputerName
));
699 ndr
->flags
= _flags_save_string
;
703 case MsvAvNbDomainName
: {
705 uint32_t _flags_save_string
= ndr
->flags
;
706 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
707 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->AvNbDomainName
));
708 ndr
->flags
= _flags_save_string
;
712 case MsvAvDnsComputerName
: {
714 uint32_t _flags_save_string
= ndr
->flags
;
715 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
716 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->AvDnsComputerName
));
717 ndr
->flags
= _flags_save_string
;
721 case MsvAvDnsDomainName
: {
723 uint32_t _flags_save_string
= ndr
->flags
;
724 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
725 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->AvDnsDomainName
));
726 ndr
->flags
= _flags_save_string
;
730 case MsvAvDnsTreeName
: {
732 uint32_t _flags_save_string
= ndr
->flags
;
733 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
734 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->AvDnsTreeName
));
735 ndr
->flags
= _flags_save_string
;
740 NDR_CHECK(ndr_pull_ntlmssp_AvFlags(ndr
, NDR_SCALARS
, &r
->AvFlags
));
743 case MsvAvTimestamp
: {
744 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->AvTimestamp
));
747 case MsAvRestrictions
: {
748 NDR_CHECK(ndr_pull_Restriction_Encoding(ndr
, NDR_SCALARS
, &r
->AvRestrictions
));
751 case MsvAvTargetName
: {
753 uint32_t _flags_save_string
= ndr
->flags
;
754 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
755 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->AvTargetName
));
756 ndr
->flags
= _flags_save_string
;
760 case MsvChannelBindings
: {
761 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->ChannelBindings
, 16));
766 uint32_t _flags_save_DATA_BLOB
= ndr
->flags
;
767 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
768 NDR_CHECK(ndr_pull_DATA_BLOB(ndr
, NDR_SCALARS
, &r
->blob
));
769 ndr
->flags
= _flags_save_DATA_BLOB
;
775 if (ndr_flags
& NDR_BUFFERS
) {
780 case MsvAvNbComputerName
:
783 case MsvAvNbDomainName
:
786 case MsvAvDnsComputerName
:
789 case MsvAvDnsDomainName
:
792 case MsvAvDnsTreeName
:
801 case MsAvRestrictions
:
804 case MsvAvTargetName
:
807 case MsvChannelBindings
:
815 ndr
->flags
= _flags_save_UNION
;
817 return NDR_ERR_SUCCESS
;
820 _PUBLIC_
void ndr_print_ntlmssp_AvValue(struct ndr_print
*ndr
, const char *name
, const union ntlmssp_AvValue
*r
)
824 uint32_t _flags_save_UNION
= ndr
->flags
;
825 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_NOALIGN
);
826 level
= ndr_print_get_switch_value(ndr
, r
);
827 ndr_print_union(ndr
, name
, level
, "ntlmssp_AvValue");
832 case MsvAvNbComputerName
:
833 ndr_print_string(ndr
, "AvNbComputerName", r
->AvNbComputerName
);
836 case MsvAvNbDomainName
:
837 ndr_print_string(ndr
, "AvNbDomainName", r
->AvNbDomainName
);
840 case MsvAvDnsComputerName
:
841 ndr_print_string(ndr
, "AvDnsComputerName", r
->AvDnsComputerName
);
844 case MsvAvDnsDomainName
:
845 ndr_print_string(ndr
, "AvDnsDomainName", r
->AvDnsDomainName
);
848 case MsvAvDnsTreeName
:
849 ndr_print_string(ndr
, "AvDnsTreeName", r
->AvDnsTreeName
);
853 ndr_print_ntlmssp_AvFlags(ndr
, "AvFlags", r
->AvFlags
);
857 ndr_print_NTTIME(ndr
, "AvTimestamp", r
->AvTimestamp
);
860 case MsAvRestrictions
:
861 ndr_print_Restriction_Encoding(ndr
, "AvRestrictions", &r
->AvRestrictions
);
864 case MsvAvTargetName
:
865 ndr_print_string(ndr
, "AvTargetName", r
->AvTargetName
);
868 case MsvChannelBindings
:
869 ndr_print_array_uint8(ndr
, "ChannelBindings", r
->ChannelBindings
, 16);
873 ndr_print_DATA_BLOB(ndr
, "blob", r
->blob
);
877 ndr
->flags
= _flags_save_UNION
;
881 static size_t ndr_size_ntlmssp_AvValue(const union ntlmssp_AvValue
*r
, uint32_t level
, struct smb_iconv_convenience
*ic
, int flags
)
883 flags
|= LIBNDR_FLAG_NOALIGN
;
884 return ndr_size_union(r
, flags
, level
, (ndr_push_flags_fn_t
)ndr_push_ntlmssp_AvValue
, ic
);
887 _PUBLIC_
enum ndr_err_code
ndr_push_AV_PAIR(struct ndr_push
*ndr
, int ndr_flags
, const struct AV_PAIR
*r
)
890 uint32_t _flags_save_STRUCT
= ndr
->flags
;
891 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_NOALIGN
);
892 if (ndr_flags
& NDR_SCALARS
) {
893 NDR_CHECK(ndr_push_align(ndr
, 4));
894 NDR_CHECK(ndr_push_ntlmssp_AvId(ndr
, NDR_SCALARS
, r
->AvId
));
895 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_size_ntlmssp_AvValue(&r
->Value
, r
->AvId
, ndr
->iconv_convenience
, 0)));
897 struct ndr_push
*_ndr_Value
;
898 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_Value
, 0, ndr_size_ntlmssp_AvValue(&r
->Value
, r
->AvId
, ndr
->iconv_convenience
, 0)));
899 NDR_CHECK(ndr_push_set_switch_value(_ndr_Value
, &r
->Value
, r
->AvId
));
900 NDR_CHECK(ndr_push_ntlmssp_AvValue(_ndr_Value
, NDR_SCALARS
|NDR_BUFFERS
, &r
->Value
));
901 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_Value
, 0, ndr_size_ntlmssp_AvValue(&r
->Value
, r
->AvId
, ndr
->iconv_convenience
, 0)));
903 NDR_CHECK(ndr_push_trailer_align(ndr
, 4));
905 if (ndr_flags
& NDR_BUFFERS
) {
907 ndr
->flags
= _flags_save_STRUCT
;
909 return NDR_ERR_SUCCESS
;
912 _PUBLIC_
enum ndr_err_code
ndr_pull_AV_PAIR(struct ndr_pull
*ndr
, int ndr_flags
, struct AV_PAIR
*r
)
915 uint32_t _flags_save_STRUCT
= ndr
->flags
;
916 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_NOALIGN
);
917 if (ndr_flags
& NDR_SCALARS
) {
918 NDR_CHECK(ndr_pull_align(ndr
, 4));
919 NDR_CHECK(ndr_pull_ntlmssp_AvId(ndr
, NDR_SCALARS
, &r
->AvId
));
920 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->AvLen
));
922 struct ndr_pull
*_ndr_Value
;
923 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_Value
, 0, r
->AvLen
));
924 NDR_CHECK(ndr_pull_set_switch_value(_ndr_Value
, &r
->Value
, r
->AvId
));
925 NDR_CHECK(ndr_pull_ntlmssp_AvValue(_ndr_Value
, NDR_SCALARS
|NDR_BUFFERS
, &r
->Value
));
926 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_Value
, 0, r
->AvLen
));
928 NDR_CHECK(ndr_pull_trailer_align(ndr
, 4));
930 if (ndr_flags
& NDR_BUFFERS
) {
932 ndr
->flags
= _flags_save_STRUCT
;
934 return NDR_ERR_SUCCESS
;
937 _PUBLIC_
void ndr_print_AV_PAIR(struct ndr_print
*ndr
, const char *name
, const struct AV_PAIR
*r
)
939 ndr_print_struct(ndr
, name
, "AV_PAIR");
941 uint32_t _flags_save_STRUCT
= ndr
->flags
;
942 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_NOALIGN
);
944 ndr_print_ntlmssp_AvId(ndr
, "AvId", r
->AvId
);
945 ndr_print_uint16(ndr
, "AvLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?ndr_size_ntlmssp_AvValue(&r
->Value
, r
->AvId
, ndr
->iconv_convenience
, 0):r
->AvLen
);
946 ndr_print_set_switch_value(ndr
, &r
->Value
, r
->AvId
);
947 ndr_print_ntlmssp_AvValue(ndr
, "Value", &r
->Value
);
949 ndr
->flags
= _flags_save_STRUCT
;
953 _PUBLIC_
void ndr_print_AV_PAIR_LIST(struct ndr_print
*ndr
, const char *name
, const struct AV_PAIR_LIST
*r
)
955 uint32_t cntr_pair_0
;
956 ndr_print_struct(ndr
, name
, "AV_PAIR_LIST");
958 uint32_t _flags_save_STRUCT
= ndr
->flags
;
959 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_NOALIGN
);
961 ndr_print_uint32(ndr
, "count", r
->count
);
962 ndr
->print(ndr
, "%s: ARRAY(%d)", "pair", (int)r
->count
);
964 for (cntr_pair_0
=0;cntr_pair_0
<r
->count
;cntr_pair_0
++) {
966 if (asprintf(&idx_0
, "[%d]", cntr_pair_0
) != -1) {
967 ndr_print_AV_PAIR(ndr
, "pair", &r
->pair
[cntr_pair_0
]);
973 ndr
->flags
= _flags_save_STRUCT
;
977 static size_t ndr_size_AV_PAIR_LIST(const struct AV_PAIR_LIST
*r
, struct smb_iconv_convenience
*ic
, int flags
)
979 flags
|= LIBNDR_FLAG_NOALIGN
;
980 return ndr_size_struct(r
, flags
, (ndr_push_flags_fn_t
)ndr_push_AV_PAIR_LIST
, ic
);
983 _PUBLIC_
enum ndr_err_code
ndr_push_CHALLENGE_MESSAGE(struct ndr_push
*ndr
, int ndr_flags
, const struct CHALLENGE_MESSAGE
*r
)
986 uint32_t _flags_save_STRUCT
= ndr
->flags
;
987 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
988 if (ndr_flags
& NDR_SCALARS
) {
989 NDR_CHECK(ndr_push_align(ndr
, 5));
990 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, "NTLMSSP", 8, sizeof(uint8_t), CH_DOS
));
991 NDR_CHECK(ndr_push_ntlmssp_MessageType(ndr
, NDR_SCALARS
, NtLmChallenge
));
992 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->TargetName
)));
993 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->TargetName
)));
995 uint32_t _flags_save_string
= ndr
->flags
;
996 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
997 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->TargetName
));
998 ndr
->flags
= _flags_save_string
;
1000 NDR_CHECK(ndr_push_NEGOTIATE(ndr
, NDR_SCALARS
, r
->NegotiateFlags
));
1001 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->ServerChallenge
, 8));
1002 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Reserved
, 8));
1003 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_size_AV_PAIR_LIST(r
->TargetInfo
, ndr
->iconv_convenience
, ndr
->flags
)));
1004 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_size_AV_PAIR_LIST(r
->TargetInfo
, ndr
->iconv_convenience
, ndr
->flags
)));
1005 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->TargetInfo
));
1006 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
));
1007 NDR_CHECK(ndr_push_ntlmssp_Version(ndr
, NDR_SCALARS
, &r
->Version
));
1008 NDR_CHECK(ndr_push_trailer_align(ndr
, 5));
1010 if (ndr_flags
& NDR_BUFFERS
) {
1012 uint32_t _flags_save_string
= ndr
->flags
;
1013 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1014 if (r
->TargetName
) {
1015 NDR_CHECK(ndr_push_relative_ptr2(ndr
, r
->TargetName
));
1017 struct ndr_push
*_ndr_TargetName
;
1018 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_TargetName
, 0, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->TargetName
)));
1019 NDR_CHECK(ndr_push_string(_ndr_TargetName
, NDR_SCALARS
, r
->TargetName
));
1020 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_TargetName
, 0, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->TargetName
)));
1023 ndr
->flags
= _flags_save_string
;
1025 if (r
->TargetInfo
) {
1026 NDR_CHECK(ndr_push_relative_ptr2(ndr
, r
->TargetInfo
));
1028 struct ndr_push
*_ndr_TargetInfo
;
1029 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_TargetInfo
, 0, ndr_size_AV_PAIR_LIST(r
->TargetInfo
, ndr
->iconv_convenience
, ndr
->flags
)));
1030 NDR_CHECK(ndr_push_AV_PAIR_LIST(_ndr_TargetInfo
, NDR_SCALARS
|NDR_BUFFERS
, r
->TargetInfo
));
1031 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_TargetInfo
, 0, ndr_size_AV_PAIR_LIST(r
->TargetInfo
, ndr
->iconv_convenience
, ndr
->flags
)));
1034 NDR_CHECK(ndr_push_ntlmssp_Version(ndr
, NDR_BUFFERS
, &r
->Version
));
1036 ndr
->flags
= _flags_save_STRUCT
;
1038 return NDR_ERR_SUCCESS
;
1041 _PUBLIC_
enum ndr_err_code
ndr_pull_CHALLENGE_MESSAGE(struct ndr_pull
*ndr
, int ndr_flags
, struct CHALLENGE_MESSAGE
*r
)
1043 uint32_t _ptr_TargetName
;
1044 TALLOC_CTX
*_mem_save_TargetName_0
;
1045 uint32_t _ptr_TargetInfo
;
1046 TALLOC_CTX
*_mem_save_TargetInfo_0
;
1048 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1049 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1050 if (ndr_flags
& NDR_SCALARS
) {
1051 NDR_CHECK(ndr_pull_align(ndr
, 5));
1052 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->Signature
, 8, sizeof(uint8_t), CH_DOS
));
1053 NDR_CHECK(ndr_pull_ntlmssp_MessageType(ndr
, NDR_SCALARS
, &r
->MessageType
));
1054 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->TargetNameLen
));
1055 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->TargetNameMaxLen
));
1057 uint32_t _flags_save_string
= ndr
->flags
;
1058 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1059 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_TargetName
));
1060 if (_ptr_TargetName
) {
1061 NDR_PULL_ALLOC(ndr
, r
->TargetName
);
1062 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->TargetName
, _ptr_TargetName
));
1064 r
->TargetName
= NULL
;
1066 ndr
->flags
= _flags_save_string
;
1068 NDR_CHECK(ndr_pull_NEGOTIATE(ndr
, NDR_SCALARS
, &r
->NegotiateFlags
));
1069 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->ServerChallenge
, 8));
1070 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Reserved
, 8));
1071 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->TargetInfoLen
));
1072 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->TargetNameInfoMaxLen
));
1073 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_TargetInfo
));
1074 if (_ptr_TargetInfo
) {
1075 NDR_PULL_ALLOC(ndr
, r
->TargetInfo
);
1076 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->TargetInfo
, _ptr_TargetInfo
));
1078 r
->TargetInfo
= NULL
;
1080 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
));
1081 NDR_CHECK(ndr_pull_ntlmssp_Version(ndr
, NDR_SCALARS
, &r
->Version
));
1082 NDR_CHECK(ndr_pull_trailer_align(ndr
, 5));
1084 if (ndr_flags
& NDR_BUFFERS
) {
1086 uint32_t _flags_save_string
= ndr
->flags
;
1087 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1088 if (r
->TargetName
) {
1089 uint32_t _relative_save_offset
;
1090 _relative_save_offset
= ndr
->offset
;
1091 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->TargetName
));
1092 _mem_save_TargetName_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1093 NDR_PULL_SET_MEM_CTX(ndr
, r
->TargetName
, 0);
1095 struct ndr_pull
*_ndr_TargetName
;
1096 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_TargetName
, 0, r
->TargetNameLen
));
1097 NDR_CHECK(ndr_pull_string(_ndr_TargetName
, NDR_SCALARS
, &r
->TargetName
));
1098 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_TargetName
, 0, r
->TargetNameLen
));
1100 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_TargetName_0
, 0);
1101 if (ndr
->offset
> ndr
->relative_highest_offset
) {
1102 ndr
->relative_highest_offset
= ndr
->offset
;
1104 ndr
->offset
= _relative_save_offset
;
1106 ndr
->flags
= _flags_save_string
;
1108 if (r
->TargetInfo
) {
1109 uint32_t _relative_save_offset
;
1110 _relative_save_offset
= ndr
->offset
;
1111 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->TargetInfo
));
1112 _mem_save_TargetInfo_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1113 NDR_PULL_SET_MEM_CTX(ndr
, r
->TargetInfo
, 0);
1115 struct ndr_pull
*_ndr_TargetInfo
;
1116 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_TargetInfo
, 0, r
->TargetInfoLen
));
1117 NDR_CHECK(ndr_pull_AV_PAIR_LIST(_ndr_TargetInfo
, NDR_SCALARS
|NDR_BUFFERS
, r
->TargetInfo
));
1118 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_TargetInfo
, 0, r
->TargetInfoLen
));
1120 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_TargetInfo_0
, 0);
1121 if (ndr
->offset
> ndr
->relative_highest_offset
) {
1122 ndr
->relative_highest_offset
= ndr
->offset
;
1124 ndr
->offset
= _relative_save_offset
;
1126 NDR_CHECK(ndr_pull_ntlmssp_Version(ndr
, NDR_BUFFERS
, &r
->Version
));
1128 ndr
->flags
= _flags_save_STRUCT
;
1130 return NDR_ERR_SUCCESS
;
1133 _PUBLIC_
void ndr_print_CHALLENGE_MESSAGE(struct ndr_print
*ndr
, const char *name
, const struct CHALLENGE_MESSAGE
*r
)
1135 ndr_print_struct(ndr
, name
, "CHALLENGE_MESSAGE");
1137 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1138 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1140 ndr_print_string(ndr
, "Signature", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?"NTLMSSP":r
->Signature
);
1141 ndr_print_ntlmssp_MessageType(ndr
, "MessageType", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?NtLmChallenge
:r
->MessageType
);
1142 ndr_print_uint16(ndr
, "TargetNameLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->TargetName
):r
->TargetNameLen
);
1143 ndr_print_uint16(ndr
, "TargetNameMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->TargetNameLen
:r
->TargetNameMaxLen
);
1144 ndr_print_ptr(ndr
, "TargetName", r
->TargetName
);
1146 if (r
->TargetName
) {
1147 ndr_print_string(ndr
, "TargetName", r
->TargetName
);
1150 ndr_print_NEGOTIATE(ndr
, "NegotiateFlags", r
->NegotiateFlags
);
1151 ndr_print_array_uint8(ndr
, "ServerChallenge", r
->ServerChallenge
, 8);
1152 ndr_print_array_uint8(ndr
, "Reserved", r
->Reserved
, 8);
1153 ndr_print_uint16(ndr
, "TargetInfoLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?ndr_size_AV_PAIR_LIST(r
->TargetInfo
, ndr
->iconv_convenience
, ndr
->flags
):r
->TargetInfoLen
);
1154 ndr_print_uint16(ndr
, "TargetNameInfoMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->TargetInfoLen
:r
->TargetNameInfoMaxLen
);
1155 ndr_print_ptr(ndr
, "TargetInfo", r
->TargetInfo
);
1157 if (r
->TargetInfo
) {
1158 ndr_print_AV_PAIR_LIST(ndr
, "TargetInfo", r
->TargetInfo
);
1161 ndr_print_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
);
1162 ndr_print_ntlmssp_Version(ndr
, "Version", &r
->Version
);
1164 ndr
->flags
= _flags_save_STRUCT
;
1168 _PUBLIC_
enum ndr_err_code
ndr_push_LM_RESPONSE(struct ndr_push
*ndr
, int ndr_flags
, const struct LM_RESPONSE
*r
)
1171 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1172 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1173 if (ndr_flags
& NDR_SCALARS
) {
1174 NDR_CHECK(ndr_push_align(ndr
, 1));
1175 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Response
, 24));
1176 NDR_CHECK(ndr_push_trailer_align(ndr
, 1));
1178 if (ndr_flags
& NDR_BUFFERS
) {
1180 ndr
->flags
= _flags_save_STRUCT
;
1182 return NDR_ERR_SUCCESS
;
1185 _PUBLIC_
enum ndr_err_code
ndr_pull_LM_RESPONSE(struct ndr_pull
*ndr
, int ndr_flags
, struct LM_RESPONSE
*r
)
1188 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1189 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1190 if (ndr_flags
& NDR_SCALARS
) {
1191 NDR_CHECK(ndr_pull_align(ndr
, 1));
1192 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Response
, 24));
1193 NDR_CHECK(ndr_pull_trailer_align(ndr
, 1));
1195 if (ndr_flags
& NDR_BUFFERS
) {
1197 ndr
->flags
= _flags_save_STRUCT
;
1199 return NDR_ERR_SUCCESS
;
1202 _PUBLIC_
void ndr_print_LM_RESPONSE(struct ndr_print
*ndr
, const char *name
, const struct LM_RESPONSE
*r
)
1204 ndr_print_struct(ndr
, name
, "LM_RESPONSE");
1206 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1207 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1209 ndr_print_array_uint8(ndr
, "Response", r
->Response
, 24);
1211 ndr
->flags
= _flags_save_STRUCT
;
1215 _PUBLIC_
enum ndr_err_code
ndr_push_LMv2_RESPONSE(struct ndr_push
*ndr
, int ndr_flags
, const struct LMv2_RESPONSE
*r
)
1218 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1219 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1220 if (ndr_flags
& NDR_SCALARS
) {
1221 NDR_CHECK(ndr_push_align(ndr
, 1));
1222 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Response
, 16));
1223 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->ChallengeFromClient
, 8));
1224 NDR_CHECK(ndr_push_trailer_align(ndr
, 1));
1226 if (ndr_flags
& NDR_BUFFERS
) {
1228 ndr
->flags
= _flags_save_STRUCT
;
1230 return NDR_ERR_SUCCESS
;
1233 _PUBLIC_
enum ndr_err_code
ndr_pull_LMv2_RESPONSE(struct ndr_pull
*ndr
, int ndr_flags
, struct LMv2_RESPONSE
*r
)
1236 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1237 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1238 if (ndr_flags
& NDR_SCALARS
) {
1239 NDR_CHECK(ndr_pull_align(ndr
, 1));
1240 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Response
, 16));
1241 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->ChallengeFromClient
, 8));
1242 NDR_CHECK(ndr_pull_trailer_align(ndr
, 1));
1244 if (ndr_flags
& NDR_BUFFERS
) {
1246 ndr
->flags
= _flags_save_STRUCT
;
1248 return NDR_ERR_SUCCESS
;
1251 _PUBLIC_
void ndr_print_LMv2_RESPONSE(struct ndr_print
*ndr
, const char *name
, const struct LMv2_RESPONSE
*r
)
1253 ndr_print_struct(ndr
, name
, "LMv2_RESPONSE");
1255 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1256 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1258 ndr_print_array_uint8(ndr
, "Response", r
->Response
, 16);
1259 ndr_print_array_uint8(ndr
, "ChallengeFromClient", r
->ChallengeFromClient
, 8);
1261 ndr
->flags
= _flags_save_STRUCT
;
1265 static enum ndr_err_code
ndr_push_ntlmssp_LM_RESPONSE(struct ndr_push
*ndr
, int ndr_flags
, const union ntlmssp_LM_RESPONSE
*r
)
1267 if (ndr_flags
& NDR_SCALARS
) {
1268 int level
= ndr_push_get_switch_value(ndr
, r
);
1269 NDR_CHECK(ndr_push_union_align(ndr
, 1));
1272 NDR_CHECK(ndr_push_LM_RESPONSE(ndr
, NDR_SCALARS
, &r
->v1
));
1280 if (ndr_flags
& NDR_BUFFERS
) {
1281 int level
= ndr_push_get_switch_value(ndr
, r
);
1291 return NDR_ERR_SUCCESS
;
1294 static enum ndr_err_code
ndr_pull_ntlmssp_LM_RESPONSE(struct ndr_pull
*ndr
, int ndr_flags
, union ntlmssp_LM_RESPONSE
*r
)
1297 level
= ndr_pull_get_switch_value(ndr
, r
);
1298 if (ndr_flags
& NDR_SCALARS
) {
1299 NDR_CHECK(ndr_pull_union_align(ndr
, 1));
1302 NDR_CHECK(ndr_pull_LM_RESPONSE(ndr
, NDR_SCALARS
, &r
->v1
));
1310 if (ndr_flags
& NDR_BUFFERS
) {
1320 return NDR_ERR_SUCCESS
;
1323 _PUBLIC_
void ndr_print_ntlmssp_LM_RESPONSE(struct ndr_print
*ndr
, const char *name
, const union ntlmssp_LM_RESPONSE
*r
)
1326 level
= ndr_print_get_switch_value(ndr
, r
);
1327 ndr_print_union(ndr
, name
, level
, "ntlmssp_LM_RESPONSE");
1330 ndr_print_LM_RESPONSE(ndr
, "v1", &r
->v1
);
1339 _PUBLIC_
enum ndr_err_code
ndr_push_NTLM_RESPONSE(struct ndr_push
*ndr
, int ndr_flags
, const struct NTLM_RESPONSE
*r
)
1342 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1343 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1344 if (ndr_flags
& NDR_SCALARS
) {
1345 NDR_CHECK(ndr_push_align(ndr
, 1));
1346 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Response
, 24));
1347 NDR_CHECK(ndr_push_trailer_align(ndr
, 1));
1349 if (ndr_flags
& NDR_BUFFERS
) {
1351 ndr
->flags
= _flags_save_STRUCT
;
1353 return NDR_ERR_SUCCESS
;
1356 _PUBLIC_
enum ndr_err_code
ndr_pull_NTLM_RESPONSE(struct ndr_pull
*ndr
, int ndr_flags
, struct NTLM_RESPONSE
*r
)
1359 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1360 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1361 if (ndr_flags
& NDR_SCALARS
) {
1362 NDR_CHECK(ndr_pull_align(ndr
, 1));
1363 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Response
, 24));
1364 NDR_CHECK(ndr_pull_trailer_align(ndr
, 1));
1366 if (ndr_flags
& NDR_BUFFERS
) {
1368 ndr
->flags
= _flags_save_STRUCT
;
1370 return NDR_ERR_SUCCESS
;
1373 _PUBLIC_
void ndr_print_NTLM_RESPONSE(struct ndr_print
*ndr
, const char *name
, const struct NTLM_RESPONSE
*r
)
1375 ndr_print_struct(ndr
, name
, "NTLM_RESPONSE");
1377 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1378 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1380 ndr_print_array_uint8(ndr
, "Response", r
->Response
, 24);
1382 ndr
->flags
= _flags_save_STRUCT
;
1386 static enum ndr_err_code
ndr_push_NTLMv2_CLIENT_CHALLENGE(struct ndr_push
*ndr
, int ndr_flags
, const struct NTLMv2_CLIENT_CHALLENGE
*r
)
1389 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1390 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1391 if (ndr_flags
& NDR_SCALARS
) {
1392 NDR_CHECK(ndr_push_align(ndr
, 4));
1393 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, 1));
1394 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, 1));
1395 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->Reserved1
));
1396 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->Reserved2
));
1397 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->TimeStamp
));
1398 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->ChallengeFromClient
, 8));
1399 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->Reserved3
));
1401 uint32_t _flags_save_AV_PAIR_LIST
= ndr
->flags
;
1402 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
1404 struct ndr_push
*_ndr_AvPairs
;
1405 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_AvPairs
, 0, -1));
1406 NDR_CHECK(ndr_push_AV_PAIR_LIST(_ndr_AvPairs
, NDR_SCALARS
|NDR_BUFFERS
, &r
->AvPairs
));
1407 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_AvPairs
, 0, -1));
1409 ndr
->flags
= _flags_save_AV_PAIR_LIST
;
1411 NDR_CHECK(ndr_push_trailer_align(ndr
, 4));
1413 if (ndr_flags
& NDR_BUFFERS
) {
1415 uint32_t _flags_save_AV_PAIR_LIST
= ndr
->flags
;
1416 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
1417 ndr
->flags
= _flags_save_AV_PAIR_LIST
;
1420 ndr
->flags
= _flags_save_STRUCT
;
1422 return NDR_ERR_SUCCESS
;
1425 static enum ndr_err_code
ndr_pull_NTLMv2_CLIENT_CHALLENGE(struct ndr_pull
*ndr
, int ndr_flags
, struct NTLMv2_CLIENT_CHALLENGE
*r
)
1428 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1429 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1430 if (ndr_flags
& NDR_SCALARS
) {
1431 NDR_CHECK(ndr_pull_align(ndr
, 4));
1432 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->RespType
));
1433 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->HiRespType
));
1434 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->Reserved1
));
1435 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->Reserved2
));
1436 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->TimeStamp
));
1437 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->ChallengeFromClient
, 8));
1438 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->Reserved3
));
1440 uint32_t _flags_save_AV_PAIR_LIST
= ndr
->flags
;
1441 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
1443 struct ndr_pull
*_ndr_AvPairs
;
1444 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_AvPairs
, 0, -1));
1445 NDR_CHECK(ndr_pull_AV_PAIR_LIST(_ndr_AvPairs
, NDR_SCALARS
|NDR_BUFFERS
, &r
->AvPairs
));
1446 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_AvPairs
, 0, -1));
1448 ndr
->flags
= _flags_save_AV_PAIR_LIST
;
1450 NDR_CHECK(ndr_pull_trailer_align(ndr
, 4));
1452 if (ndr_flags
& NDR_BUFFERS
) {
1454 uint32_t _flags_save_AV_PAIR_LIST
= ndr
->flags
;
1455 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
1456 ndr
->flags
= _flags_save_AV_PAIR_LIST
;
1459 ndr
->flags
= _flags_save_STRUCT
;
1461 return NDR_ERR_SUCCESS
;
1464 _PUBLIC_
void ndr_print_NTLMv2_CLIENT_CHALLENGE(struct ndr_print
*ndr
, const char *name
, const struct NTLMv2_CLIENT_CHALLENGE
*r
)
1466 ndr_print_struct(ndr
, name
, "NTLMv2_CLIENT_CHALLENGE");
1468 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1469 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1471 ndr_print_uint8(ndr
, "RespType", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?1:r
->RespType
);
1472 ndr_print_uint8(ndr
, "HiRespType", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?1:r
->HiRespType
);
1473 ndr_print_uint16(ndr
, "Reserved1", r
->Reserved1
);
1474 ndr_print_uint32(ndr
, "Reserved2", r
->Reserved2
);
1475 ndr_print_NTTIME(ndr
, "TimeStamp", r
->TimeStamp
);
1476 ndr_print_array_uint8(ndr
, "ChallengeFromClient", r
->ChallengeFromClient
, 8);
1477 ndr_print_uint32(ndr
, "Reserved3", r
->Reserved3
);
1478 ndr_print_AV_PAIR_LIST(ndr
, "AvPairs", &r
->AvPairs
);
1480 ndr
->flags
= _flags_save_STRUCT
;
1484 _PUBLIC_
enum ndr_err_code
ndr_push_NTLMv2_RESPONSE(struct ndr_push
*ndr
, int ndr_flags
, const struct NTLMv2_RESPONSE
*r
)
1487 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1488 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1489 if (ndr_flags
& NDR_SCALARS
) {
1490 NDR_CHECK(ndr_push_align(ndr
, 4));
1491 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Response
, 16));
1492 NDR_CHECK(ndr_push_NTLMv2_CLIENT_CHALLENGE(ndr
, NDR_SCALARS
, &r
->Challenge
));
1493 NDR_CHECK(ndr_push_trailer_align(ndr
, 4));
1495 if (ndr_flags
& NDR_BUFFERS
) {
1496 NDR_CHECK(ndr_push_NTLMv2_CLIENT_CHALLENGE(ndr
, NDR_BUFFERS
, &r
->Challenge
));
1498 ndr
->flags
= _flags_save_STRUCT
;
1500 return NDR_ERR_SUCCESS
;
1503 _PUBLIC_
enum ndr_err_code
ndr_pull_NTLMv2_RESPONSE(struct ndr_pull
*ndr
, int ndr_flags
, struct NTLMv2_RESPONSE
*r
)
1506 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1507 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1508 if (ndr_flags
& NDR_SCALARS
) {
1509 NDR_CHECK(ndr_pull_align(ndr
, 4));
1510 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Response
, 16));
1511 NDR_CHECK(ndr_pull_NTLMv2_CLIENT_CHALLENGE(ndr
, NDR_SCALARS
, &r
->Challenge
));
1512 NDR_CHECK(ndr_pull_trailer_align(ndr
, 4));
1514 if (ndr_flags
& NDR_BUFFERS
) {
1515 NDR_CHECK(ndr_pull_NTLMv2_CLIENT_CHALLENGE(ndr
, NDR_BUFFERS
, &r
->Challenge
));
1517 ndr
->flags
= _flags_save_STRUCT
;
1519 return NDR_ERR_SUCCESS
;
1522 _PUBLIC_
void ndr_print_NTLMv2_RESPONSE(struct ndr_print
*ndr
, const char *name
, const struct NTLMv2_RESPONSE
*r
)
1524 ndr_print_struct(ndr
, name
, "NTLMv2_RESPONSE");
1526 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1527 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1529 ndr_print_array_uint8(ndr
, "Response", r
->Response
, 16);
1530 ndr_print_NTLMv2_CLIENT_CHALLENGE(ndr
, "Challenge", &r
->Challenge
);
1532 ndr
->flags
= _flags_save_STRUCT
;
1536 _PUBLIC_
enum ndr_err_code
ndr_push_ntlmssp_NTLM_RESPONSE(struct ndr_push
*ndr
, int ndr_flags
, const union ntlmssp_NTLM_RESPONSE
*r
)
1538 if (ndr_flags
& NDR_SCALARS
) {
1539 int level
= ndr_push_get_switch_value(ndr
, r
);
1540 NDR_CHECK(ndr_push_union_align(ndr
, 4));
1546 NDR_CHECK(ndr_push_NTLM_RESPONSE(ndr
, NDR_SCALARS
, &r
->v1
));
1550 NDR_CHECK(ndr_push_NTLMv2_RESPONSE(ndr
, NDR_SCALARS
, &r
->v2
));
1555 if (ndr_flags
& NDR_BUFFERS
) {
1556 int level
= ndr_push_get_switch_value(ndr
, r
);
1565 NDR_CHECK(ndr_push_NTLMv2_RESPONSE(ndr
, NDR_BUFFERS
, &r
->v2
));
1570 return NDR_ERR_SUCCESS
;
1573 _PUBLIC_
enum ndr_err_code
ndr_pull_ntlmssp_NTLM_RESPONSE(struct ndr_pull
*ndr
, int ndr_flags
, union ntlmssp_NTLM_RESPONSE
*r
)
1576 level
= ndr_pull_get_switch_value(ndr
, r
);
1577 if (ndr_flags
& NDR_SCALARS
) {
1578 NDR_CHECK(ndr_pull_union_align(ndr
, 4));
1584 NDR_CHECK(ndr_pull_NTLM_RESPONSE(ndr
, NDR_SCALARS
, &r
->v1
));
1588 NDR_CHECK(ndr_pull_NTLMv2_RESPONSE(ndr
, NDR_SCALARS
, &r
->v2
));
1593 if (ndr_flags
& NDR_BUFFERS
) {
1602 NDR_CHECK(ndr_pull_NTLMv2_RESPONSE(ndr
, NDR_BUFFERS
, &r
->v2
));
1607 return NDR_ERR_SUCCESS
;
1610 _PUBLIC_
void ndr_print_ntlmssp_NTLM_RESPONSE(struct ndr_print
*ndr
, const char *name
, const union ntlmssp_NTLM_RESPONSE
*r
)
1613 level
= ndr_print_get_switch_value(ndr
, r
);
1614 ndr_print_union(ndr
, name
, level
, "ntlmssp_NTLM_RESPONSE");
1620 ndr_print_NTLM_RESPONSE(ndr
, "v1", &r
->v1
);
1624 ndr_print_NTLMv2_RESPONSE(ndr
, "v2", &r
->v2
);
1630 _PUBLIC_
enum ndr_err_code
ndr_push_AUTHENTICATE_MESSAGE(struct ndr_push
*ndr
, int ndr_flags
, const struct AUTHENTICATE_MESSAGE
*r
)
1633 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1634 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
1635 if (ndr_flags
& NDR_SCALARS
) {
1636 NDR_CHECK(ndr_push_align(ndr
, 5));
1637 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, "NTLMSSP", 8, sizeof(uint8_t), CH_DOS
));
1638 NDR_CHECK(ndr_push_ntlmssp_MessageType(ndr
, NDR_SCALARS
, NtLmAuthenticate
));
1639 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->LmChallengeResponseLen
));
1640 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->LmChallengeResponseLen
));
1641 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->LmChallengeResponse
));
1642 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->NtChallengeResponseLen
));
1643 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->NtChallengeResponseLen
));
1644 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->NtChallengeResponse
));
1645 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->DomainName
)));
1646 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->DomainName
)));
1648 uint32_t _flags_save_string
= ndr
->flags
;
1649 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1650 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->DomainName
));
1651 ndr
->flags
= _flags_save_string
;
1653 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->UserName
)));
1654 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->UserName
)));
1656 uint32_t _flags_save_string
= ndr
->flags
;
1657 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1658 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->UserName
));
1659 ndr
->flags
= _flags_save_string
;
1661 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->Workstation
)));
1662 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->Workstation
)));
1664 uint32_t _flags_save_string
= ndr
->flags
;
1665 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1666 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->Workstation
));
1667 ndr
->flags
= _flags_save_string
;
1669 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->EncryptedRandomSessionKey
->length
));
1670 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->EncryptedRandomSessionKey
->length
));
1671 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->EncryptedRandomSessionKey
));
1672 NDR_CHECK(ndr_push_NEGOTIATE(ndr
, NDR_SCALARS
, r
->NegotiateFlags
));
1673 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
));
1674 NDR_CHECK(ndr_push_ntlmssp_Version(ndr
, NDR_SCALARS
, &r
->Version
));
1675 NDR_CHECK(ndr_push_trailer_align(ndr
, 5));
1677 if (ndr_flags
& NDR_BUFFERS
) {
1678 if (r
->LmChallengeResponse
) {
1679 NDR_CHECK(ndr_push_relative_ptr2(ndr
, r
->LmChallengeResponse
));
1681 struct ndr_push
*_ndr_LmChallengeResponse
;
1682 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_LmChallengeResponse
, 0, r
->LmChallengeResponseLen
));
1683 NDR_CHECK(ndr_push_set_switch_value(_ndr_LmChallengeResponse
, r
->LmChallengeResponse
, r
->LmChallengeResponseLen
));
1684 NDR_CHECK(ndr_push_ntlmssp_LM_RESPONSE(_ndr_LmChallengeResponse
, NDR_SCALARS
|NDR_BUFFERS
, r
->LmChallengeResponse
));
1685 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_LmChallengeResponse
, 0, r
->LmChallengeResponseLen
));
1688 if (r
->NtChallengeResponse
) {
1689 NDR_CHECK(ndr_push_relative_ptr2(ndr
, r
->NtChallengeResponse
));
1691 struct ndr_push
*_ndr_NtChallengeResponse
;
1692 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_NtChallengeResponse
, 0, r
->NtChallengeResponseLen
));
1693 NDR_CHECK(ndr_push_set_switch_value(_ndr_NtChallengeResponse
, r
->NtChallengeResponse
, r
->NtChallengeResponseLen
));
1694 NDR_CHECK(ndr_push_ntlmssp_NTLM_RESPONSE(_ndr_NtChallengeResponse
, NDR_SCALARS
|NDR_BUFFERS
, r
->NtChallengeResponse
));
1695 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_NtChallengeResponse
, 0, r
->NtChallengeResponseLen
));
1699 uint32_t _flags_save_string
= ndr
->flags
;
1700 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1701 if (r
->DomainName
) {
1702 NDR_CHECK(ndr_push_relative_ptr2(ndr
, r
->DomainName
));
1704 struct ndr_push
*_ndr_DomainName
;
1705 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_DomainName
, 0, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->DomainName
)));
1706 NDR_CHECK(ndr_push_string(_ndr_DomainName
, NDR_SCALARS
, r
->DomainName
));
1707 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_DomainName
, 0, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->DomainName
)));
1710 ndr
->flags
= _flags_save_string
;
1713 uint32_t _flags_save_string
= ndr
->flags
;
1714 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1716 NDR_CHECK(ndr_push_relative_ptr2(ndr
, r
->UserName
));
1718 struct ndr_push
*_ndr_UserName
;
1719 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_UserName
, 0, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->UserName
)));
1720 NDR_CHECK(ndr_push_string(_ndr_UserName
, NDR_SCALARS
, r
->UserName
));
1721 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_UserName
, 0, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->UserName
)));
1724 ndr
->flags
= _flags_save_string
;
1727 uint32_t _flags_save_string
= ndr
->flags
;
1728 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1729 if (r
->Workstation
) {
1730 NDR_CHECK(ndr_push_relative_ptr2(ndr
, r
->Workstation
));
1732 struct ndr_push
*_ndr_Workstation
;
1733 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_Workstation
, 0, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->Workstation
)));
1734 NDR_CHECK(ndr_push_string(_ndr_Workstation
, NDR_SCALARS
, r
->Workstation
));
1735 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_Workstation
, 0, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->Workstation
)));
1738 ndr
->flags
= _flags_save_string
;
1740 if (r
->EncryptedRandomSessionKey
) {
1741 NDR_CHECK(ndr_push_relative_ptr2(ndr
, r
->EncryptedRandomSessionKey
));
1743 struct ndr_push
*_ndr_EncryptedRandomSessionKey
;
1744 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_EncryptedRandomSessionKey
, 0, r
->EncryptedRandomSessionKey
->length
));
1745 NDR_CHECK(ndr_push_DATA_BLOB(_ndr_EncryptedRandomSessionKey
, NDR_SCALARS
, *r
->EncryptedRandomSessionKey
));
1746 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_EncryptedRandomSessionKey
, 0, r
->EncryptedRandomSessionKey
->length
));
1749 NDR_CHECK(ndr_push_ntlmssp_Version(ndr
, NDR_BUFFERS
, &r
->Version
));
1751 ndr
->flags
= _flags_save_STRUCT
;
1753 return NDR_ERR_SUCCESS
;
1756 _PUBLIC_
enum ndr_err_code
ndr_pull_AUTHENTICATE_MESSAGE(struct ndr_pull
*ndr
, int ndr_flags
, struct AUTHENTICATE_MESSAGE
*r
)
1758 uint32_t _ptr_LmChallengeResponse
;
1759 TALLOC_CTX
*_mem_save_LmChallengeResponse_0
;
1760 uint32_t _ptr_NtChallengeResponse
;
1761 TALLOC_CTX
*_mem_save_NtChallengeResponse_0
;
1762 uint32_t _ptr_DomainName
;
1763 TALLOC_CTX
*_mem_save_DomainName_0
;
1764 uint32_t _ptr_UserName
;
1765 TALLOC_CTX
*_mem_save_UserName_0
;
1766 uint32_t _ptr_Workstation
;
1767 TALLOC_CTX
*_mem_save_Workstation_0
;
1768 uint32_t _ptr_EncryptedRandomSessionKey
;
1769 TALLOC_CTX
*_mem_save_EncryptedRandomSessionKey_0
;
1771 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1772 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
1773 if (ndr_flags
& NDR_SCALARS
) {
1774 NDR_CHECK(ndr_pull_align(ndr
, 5));
1775 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->Signature
, 8, sizeof(uint8_t), CH_DOS
));
1776 NDR_CHECK(ndr_pull_ntlmssp_MessageType(ndr
, NDR_SCALARS
, &r
->MessageType
));
1777 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->LmChallengeResponseLen
));
1778 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->LmChallengeResponseMaxLen
));
1779 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_LmChallengeResponse
));
1780 if (_ptr_LmChallengeResponse
) {
1781 NDR_PULL_ALLOC(ndr
, r
->LmChallengeResponse
);
1782 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->LmChallengeResponse
, _ptr_LmChallengeResponse
));
1784 r
->LmChallengeResponse
= NULL
;
1786 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->NtChallengeResponseLen
));
1787 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->NtChallengeResponseMaxLen
));
1788 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_NtChallengeResponse
));
1789 if (_ptr_NtChallengeResponse
) {
1790 NDR_PULL_ALLOC(ndr
, r
->NtChallengeResponse
);
1791 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->NtChallengeResponse
, _ptr_NtChallengeResponse
));
1793 r
->NtChallengeResponse
= NULL
;
1795 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->DomainNameLen
));
1796 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->DomainNameMaxLen
));
1798 uint32_t _flags_save_string
= ndr
->flags
;
1799 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1800 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_DomainName
));
1801 if (_ptr_DomainName
) {
1802 NDR_PULL_ALLOC(ndr
, r
->DomainName
);
1803 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->DomainName
, _ptr_DomainName
));
1805 r
->DomainName
= NULL
;
1807 ndr
->flags
= _flags_save_string
;
1809 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->UserNameLen
));
1810 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->UserNameMaxLen
));
1812 uint32_t _flags_save_string
= ndr
->flags
;
1813 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1814 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_UserName
));
1815 if (_ptr_UserName
) {
1816 NDR_PULL_ALLOC(ndr
, r
->UserName
);
1817 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->UserName
, _ptr_UserName
));
1821 ndr
->flags
= _flags_save_string
;
1823 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->WorkstationLen
));
1824 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->WorkstationMaxLen
));
1826 uint32_t _flags_save_string
= ndr
->flags
;
1827 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1828 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_Workstation
));
1829 if (_ptr_Workstation
) {
1830 NDR_PULL_ALLOC(ndr
, r
->Workstation
);
1831 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->Workstation
, _ptr_Workstation
));
1833 r
->Workstation
= NULL
;
1835 ndr
->flags
= _flags_save_string
;
1837 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->EncryptedRandomSessionKeyLen
));
1838 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->EncryptedRandomSessionKeyMaxLen
));
1839 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_EncryptedRandomSessionKey
));
1840 if (_ptr_EncryptedRandomSessionKey
) {
1841 NDR_PULL_ALLOC(ndr
, r
->EncryptedRandomSessionKey
);
1842 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->EncryptedRandomSessionKey
, _ptr_EncryptedRandomSessionKey
));
1844 r
->EncryptedRandomSessionKey
= NULL
;
1846 NDR_CHECK(ndr_pull_NEGOTIATE(ndr
, NDR_SCALARS
, &r
->NegotiateFlags
));
1847 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
));
1848 NDR_CHECK(ndr_pull_ntlmssp_Version(ndr
, NDR_SCALARS
, &r
->Version
));
1849 NDR_CHECK(ndr_pull_trailer_align(ndr
, 5));
1851 if (ndr_flags
& NDR_BUFFERS
) {
1852 if (r
->LmChallengeResponse
) {
1853 uint32_t _relative_save_offset
;
1854 _relative_save_offset
= ndr
->offset
;
1855 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->LmChallengeResponse
));
1856 _mem_save_LmChallengeResponse_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1857 NDR_PULL_SET_MEM_CTX(ndr
, r
->LmChallengeResponse
, 0);
1859 struct ndr_pull
*_ndr_LmChallengeResponse
;
1860 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_LmChallengeResponse
, 0, r
->LmChallengeResponseLen
));
1861 NDR_CHECK(ndr_pull_set_switch_value(_ndr_LmChallengeResponse
, r
->LmChallengeResponse
, r
->LmChallengeResponseLen
));
1862 NDR_CHECK(ndr_pull_ntlmssp_LM_RESPONSE(_ndr_LmChallengeResponse
, NDR_SCALARS
|NDR_BUFFERS
, r
->LmChallengeResponse
));
1863 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_LmChallengeResponse
, 0, r
->LmChallengeResponseLen
));
1865 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_LmChallengeResponse_0
, 0);
1866 if (ndr
->offset
> ndr
->relative_highest_offset
) {
1867 ndr
->relative_highest_offset
= ndr
->offset
;
1869 ndr
->offset
= _relative_save_offset
;
1871 if (r
->NtChallengeResponse
) {
1872 uint32_t _relative_save_offset
;
1873 _relative_save_offset
= ndr
->offset
;
1874 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->NtChallengeResponse
));
1875 _mem_save_NtChallengeResponse_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1876 NDR_PULL_SET_MEM_CTX(ndr
, r
->NtChallengeResponse
, 0);
1878 struct ndr_pull
*_ndr_NtChallengeResponse
;
1879 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_NtChallengeResponse
, 0, r
->NtChallengeResponseMaxLen
));
1880 NDR_CHECK(ndr_pull_set_switch_value(_ndr_NtChallengeResponse
, r
->NtChallengeResponse
, r
->NtChallengeResponseLen
));
1881 NDR_CHECK(ndr_pull_ntlmssp_NTLM_RESPONSE(_ndr_NtChallengeResponse
, NDR_SCALARS
|NDR_BUFFERS
, r
->NtChallengeResponse
));
1882 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_NtChallengeResponse
, 0, r
->NtChallengeResponseMaxLen
));
1884 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_NtChallengeResponse_0
, 0);
1885 if (ndr
->offset
> ndr
->relative_highest_offset
) {
1886 ndr
->relative_highest_offset
= ndr
->offset
;
1888 ndr
->offset
= _relative_save_offset
;
1891 uint32_t _flags_save_string
= ndr
->flags
;
1892 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1893 if (r
->DomainName
) {
1894 uint32_t _relative_save_offset
;
1895 _relative_save_offset
= ndr
->offset
;
1896 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->DomainName
));
1897 _mem_save_DomainName_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1898 NDR_PULL_SET_MEM_CTX(ndr
, r
->DomainName
, 0);
1900 struct ndr_pull
*_ndr_DomainName
;
1901 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_DomainName
, 0, r
->DomainNameLen
));
1902 NDR_CHECK(ndr_pull_string(_ndr_DomainName
, NDR_SCALARS
, &r
->DomainName
));
1903 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_DomainName
, 0, r
->DomainNameLen
));
1905 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_DomainName_0
, 0);
1906 if (ndr
->offset
> ndr
->relative_highest_offset
) {
1907 ndr
->relative_highest_offset
= ndr
->offset
;
1909 ndr
->offset
= _relative_save_offset
;
1911 ndr
->flags
= _flags_save_string
;
1914 uint32_t _flags_save_string
= ndr
->flags
;
1915 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1917 uint32_t _relative_save_offset
;
1918 _relative_save_offset
= ndr
->offset
;
1919 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->UserName
));
1920 _mem_save_UserName_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1921 NDR_PULL_SET_MEM_CTX(ndr
, r
->UserName
, 0);
1923 struct ndr_pull
*_ndr_UserName
;
1924 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_UserName
, 0, r
->UserNameLen
));
1925 NDR_CHECK(ndr_pull_string(_ndr_UserName
, NDR_SCALARS
, &r
->UserName
));
1926 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_UserName
, 0, r
->UserNameLen
));
1928 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_UserName_0
, 0);
1929 if (ndr
->offset
> ndr
->relative_highest_offset
) {
1930 ndr
->relative_highest_offset
= ndr
->offset
;
1932 ndr
->offset
= _relative_save_offset
;
1934 ndr
->flags
= _flags_save_string
;
1937 uint32_t _flags_save_string
= ndr
->flags
;
1938 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1939 if (r
->Workstation
) {
1940 uint32_t _relative_save_offset
;
1941 _relative_save_offset
= ndr
->offset
;
1942 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->Workstation
));
1943 _mem_save_Workstation_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1944 NDR_PULL_SET_MEM_CTX(ndr
, r
->Workstation
, 0);
1946 struct ndr_pull
*_ndr_Workstation
;
1947 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_Workstation
, 0, r
->WorkstationLen
));
1948 NDR_CHECK(ndr_pull_string(_ndr_Workstation
, NDR_SCALARS
, &r
->Workstation
));
1949 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_Workstation
, 0, r
->WorkstationLen
));
1951 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_Workstation_0
, 0);
1952 if (ndr
->offset
> ndr
->relative_highest_offset
) {
1953 ndr
->relative_highest_offset
= ndr
->offset
;
1955 ndr
->offset
= _relative_save_offset
;
1957 ndr
->flags
= _flags_save_string
;
1959 if (r
->EncryptedRandomSessionKey
) {
1960 uint32_t _relative_save_offset
;
1961 _relative_save_offset
= ndr
->offset
;
1962 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->EncryptedRandomSessionKey
));
1963 _mem_save_EncryptedRandomSessionKey_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1964 NDR_PULL_SET_MEM_CTX(ndr
, r
->EncryptedRandomSessionKey
, 0);
1966 struct ndr_pull
*_ndr_EncryptedRandomSessionKey
;
1967 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_EncryptedRandomSessionKey
, 0, r
->EncryptedRandomSessionKeyLen
));
1968 NDR_CHECK(ndr_pull_DATA_BLOB(_ndr_EncryptedRandomSessionKey
, NDR_SCALARS
, r
->EncryptedRandomSessionKey
));
1969 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_EncryptedRandomSessionKey
, 0, r
->EncryptedRandomSessionKeyLen
));
1971 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_EncryptedRandomSessionKey_0
, 0);
1972 if (ndr
->offset
> ndr
->relative_highest_offset
) {
1973 ndr
->relative_highest_offset
= ndr
->offset
;
1975 ndr
->offset
= _relative_save_offset
;
1977 NDR_CHECK(ndr_pull_ntlmssp_Version(ndr
, NDR_BUFFERS
, &r
->Version
));
1979 ndr
->flags
= _flags_save_STRUCT
;
1981 return NDR_ERR_SUCCESS
;
1984 _PUBLIC_
void ndr_print_AUTHENTICATE_MESSAGE(struct ndr_print
*ndr
, const char *name
, const struct AUTHENTICATE_MESSAGE
*r
)
1986 ndr_print_struct(ndr
, name
, "AUTHENTICATE_MESSAGE");
1988 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1989 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
1991 ndr_print_string(ndr
, "Signature", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?"NTLMSSP":r
->Signature
);
1992 ndr_print_ntlmssp_MessageType(ndr
, "MessageType", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?NtLmAuthenticate
:r
->MessageType
);
1993 ndr_print_uint16(ndr
, "LmChallengeResponseLen", r
->LmChallengeResponseLen
);
1994 ndr_print_uint16(ndr
, "LmChallengeResponseMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->LmChallengeResponseLen
:r
->LmChallengeResponseMaxLen
);
1995 ndr_print_ptr(ndr
, "LmChallengeResponse", r
->LmChallengeResponse
);
1997 if (r
->LmChallengeResponse
) {
1998 ndr_print_set_switch_value(ndr
, r
->LmChallengeResponse
, r
->LmChallengeResponseLen
);
1999 ndr_print_ntlmssp_LM_RESPONSE(ndr
, "LmChallengeResponse", r
->LmChallengeResponse
);
2002 ndr_print_uint16(ndr
, "NtChallengeResponseLen", r
->NtChallengeResponseLen
);
2003 ndr_print_uint16(ndr
, "NtChallengeResponseMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->NtChallengeResponseLen
:r
->NtChallengeResponseMaxLen
);
2004 ndr_print_ptr(ndr
, "NtChallengeResponse", r
->NtChallengeResponse
);
2006 if (r
->NtChallengeResponse
) {
2007 ndr_print_set_switch_value(ndr
, r
->NtChallengeResponse
, r
->NtChallengeResponseLen
);
2008 ndr_print_ntlmssp_NTLM_RESPONSE(ndr
, "NtChallengeResponse", r
->NtChallengeResponse
);
2011 ndr_print_uint16(ndr
, "DomainNameLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->DomainName
):r
->DomainNameLen
);
2012 ndr_print_uint16(ndr
, "DomainNameMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->DomainNameLen
:r
->DomainNameMaxLen
);
2013 ndr_print_ptr(ndr
, "DomainName", r
->DomainName
);
2015 if (r
->DomainName
) {
2016 ndr_print_string(ndr
, "DomainName", r
->DomainName
);
2019 ndr_print_uint16(ndr
, "UserNameLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->UserName
):r
->UserNameLen
);
2020 ndr_print_uint16(ndr
, "UserNameMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->UserNameLen
:r
->UserNameMaxLen
);
2021 ndr_print_ptr(ndr
, "UserName", r
->UserName
);
2024 ndr_print_string(ndr
, "UserName", r
->UserName
);
2027 ndr_print_uint16(ndr
, "WorkstationLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->Workstation
):r
->WorkstationLen
);
2028 ndr_print_uint16(ndr
, "WorkstationMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->WorkstationLen
:r
->WorkstationMaxLen
);
2029 ndr_print_ptr(ndr
, "Workstation", r
->Workstation
);
2031 if (r
->Workstation
) {
2032 ndr_print_string(ndr
, "Workstation", r
->Workstation
);
2035 ndr_print_uint16(ndr
, "EncryptedRandomSessionKeyLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->EncryptedRandomSessionKey
->length
:r
->EncryptedRandomSessionKeyLen
);
2036 ndr_print_uint16(ndr
, "EncryptedRandomSessionKeyMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->EncryptedRandomSessionKeyLen
:r
->EncryptedRandomSessionKeyMaxLen
);
2037 ndr_print_ptr(ndr
, "EncryptedRandomSessionKey", r
->EncryptedRandomSessionKey
);
2039 if (r
->EncryptedRandomSessionKey
) {
2040 ndr_print_DATA_BLOB(ndr
, "EncryptedRandomSessionKey", *r
->EncryptedRandomSessionKey
);
2043 ndr_print_NEGOTIATE(ndr
, "NegotiateFlags", r
->NegotiateFlags
);
2044 ndr_print_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
);
2045 ndr_print_ntlmssp_Version(ndr
, "Version", &r
->Version
);
2047 ndr
->flags
= _flags_save_STRUCT
;
2051 _PUBLIC_
enum ndr_err_code
ndr_push_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_push
*ndr
, int ndr_flags
, const struct NTLMSSP_MESSAGE_SIGNATURE
*r
)
2053 if (ndr_flags
& NDR_SCALARS
) {
2054 NDR_CHECK(ndr_push_align(ndr
, 4));
2055 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, NTLMSSP_SIGN_VERSION
));
2056 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->RandomPad
));
2057 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->Checksum
));
2058 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SeqNum
));
2059 NDR_CHECK(ndr_push_trailer_align(ndr
, 4));
2061 if (ndr_flags
& NDR_BUFFERS
) {
2063 return NDR_ERR_SUCCESS
;
2066 _PUBLIC_
enum ndr_err_code
ndr_pull_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_pull
*ndr
, int ndr_flags
, struct NTLMSSP_MESSAGE_SIGNATURE
*r
)
2068 if (ndr_flags
& NDR_SCALARS
) {
2069 NDR_CHECK(ndr_pull_align(ndr
, 4));
2070 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->Version
));
2071 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->RandomPad
));
2072 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->Checksum
));
2073 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SeqNum
));
2074 NDR_CHECK(ndr_pull_trailer_align(ndr
, 4));
2076 if (ndr_flags
& NDR_BUFFERS
) {
2078 return NDR_ERR_SUCCESS
;
2081 _PUBLIC_
void ndr_print_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_print
*ndr
, const char *name
, const struct NTLMSSP_MESSAGE_SIGNATURE
*r
)
2083 ndr_print_struct(ndr
, name
, "NTLMSSP_MESSAGE_SIGNATURE");
2085 ndr_print_uint32(ndr
, "Version", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?NTLMSSP_SIGN_VERSION
:r
->Version
);
2086 ndr_print_uint32(ndr
, "RandomPad", r
->RandomPad
);
2087 ndr_print_uint32(ndr
, "Checksum", r
->Checksum
);
2088 ndr_print_uint32(ndr
, "SeqNum", r
->SeqNum
);
2092 _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
)
2095 uint32_t _flags_save_STRUCT
= ndr
->flags
;
2096 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2097 if (ndr_flags
& NDR_SCALARS
) {
2098 NDR_CHECK(ndr_push_align(ndr
, 4));
2099 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, NTLMSSP_SIGN_VERSION
));
2100 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Checksum
, 8));
2101 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SeqNum
));
2102 NDR_CHECK(ndr_push_trailer_align(ndr
, 4));
2104 if (ndr_flags
& NDR_BUFFERS
) {
2106 ndr
->flags
= _flags_save_STRUCT
;
2108 return NDR_ERR_SUCCESS
;
2111 _PUBLIC_
enum ndr_err_code
ndr_pull_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_pull
*ndr
, int ndr_flags
, struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2
*r
)
2114 uint32_t _flags_save_STRUCT
= ndr
->flags
;
2115 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2116 if (ndr_flags
& NDR_SCALARS
) {
2117 NDR_CHECK(ndr_pull_align(ndr
, 4));
2118 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->Version
));
2119 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Checksum
, 8));
2120 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SeqNum
));
2121 NDR_CHECK(ndr_pull_trailer_align(ndr
, 4));
2123 if (ndr_flags
& NDR_BUFFERS
) {
2125 ndr
->flags
= _flags_save_STRUCT
;
2127 return NDR_ERR_SUCCESS
;
2130 _PUBLIC_
void ndr_print_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_print
*ndr
, const char *name
, const struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2
*r
)
2132 ndr_print_struct(ndr
, name
, "NTLMSSP_MESSAGE_SIGNATURE_NTLMv2");
2134 uint32_t _flags_save_STRUCT
= ndr
->flags
;
2135 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2137 ndr_print_uint32(ndr
, "Version", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?NTLMSSP_SIGN_VERSION
:r
->Version
);
2138 ndr_print_array_uint8(ndr
, "Checksum", r
->Checksum
, 8);
2139 ndr_print_uint32(ndr
, "SeqNum", r
->SeqNum
);
2141 ndr
->flags
= _flags_save_STRUCT
;
2145 static enum ndr_err_code
ndr_push_decode_NEGOTIATE_MESSAGE(struct ndr_push
*ndr
, int flags
, const struct decode_NEGOTIATE_MESSAGE
*r
)
2147 if (flags
& NDR_IN
) {
2148 NDR_CHECK(ndr_push_NEGOTIATE_MESSAGE(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.negotiate
));
2150 if (flags
& NDR_OUT
) {
2152 return NDR_ERR_SUCCESS
;
2155 static enum ndr_err_code
ndr_pull_decode_NEGOTIATE_MESSAGE(struct ndr_pull
*ndr
, int flags
, struct decode_NEGOTIATE_MESSAGE
*r
)
2157 if (flags
& NDR_IN
) {
2158 NDR_CHECK(ndr_pull_NEGOTIATE_MESSAGE(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.negotiate
));
2160 if (flags
& NDR_OUT
) {
2162 return NDR_ERR_SUCCESS
;
2165 _PUBLIC_
void ndr_print_decode_NEGOTIATE_MESSAGE(struct ndr_print
*ndr
, const char *name
, int flags
, const struct decode_NEGOTIATE_MESSAGE
*r
)
2167 ndr_print_struct(ndr
, name
, "decode_NEGOTIATE_MESSAGE");
2169 if (flags
& NDR_SET_VALUES
) {
2170 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
2172 if (flags
& NDR_IN
) {
2173 ndr_print_struct(ndr
, "in", "decode_NEGOTIATE_MESSAGE");
2175 ndr_print_NEGOTIATE_MESSAGE(ndr
, "negotiate", &r
->in
.negotiate
);
2178 if (flags
& NDR_OUT
) {
2179 ndr_print_struct(ndr
, "out", "decode_NEGOTIATE_MESSAGE");
2186 static enum ndr_err_code
ndr_push_decode_CHALLENGE_MESSAGE(struct ndr_push
*ndr
, int flags
, const struct decode_CHALLENGE_MESSAGE
*r
)
2188 if (flags
& NDR_IN
) {
2189 NDR_CHECK(ndr_push_CHALLENGE_MESSAGE(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.challenge
));
2191 if (flags
& NDR_OUT
) {
2193 return NDR_ERR_SUCCESS
;
2196 static enum ndr_err_code
ndr_pull_decode_CHALLENGE_MESSAGE(struct ndr_pull
*ndr
, int flags
, struct decode_CHALLENGE_MESSAGE
*r
)
2198 if (flags
& NDR_IN
) {
2199 NDR_CHECK(ndr_pull_CHALLENGE_MESSAGE(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.challenge
));
2201 if (flags
& NDR_OUT
) {
2203 return NDR_ERR_SUCCESS
;
2206 _PUBLIC_
void ndr_print_decode_CHALLENGE_MESSAGE(struct ndr_print
*ndr
, const char *name
, int flags
, const struct decode_CHALLENGE_MESSAGE
*r
)
2208 ndr_print_struct(ndr
, name
, "decode_CHALLENGE_MESSAGE");
2210 if (flags
& NDR_SET_VALUES
) {
2211 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
2213 if (flags
& NDR_IN
) {
2214 ndr_print_struct(ndr
, "in", "decode_CHALLENGE_MESSAGE");
2216 ndr_print_CHALLENGE_MESSAGE(ndr
, "challenge", &r
->in
.challenge
);
2219 if (flags
& NDR_OUT
) {
2220 ndr_print_struct(ndr
, "out", "decode_CHALLENGE_MESSAGE");
2227 static enum ndr_err_code
ndr_push_decode_AUTHENTICATE_MESSAGE(struct ndr_push
*ndr
, int flags
, const struct decode_AUTHENTICATE_MESSAGE
*r
)
2229 if (flags
& NDR_IN
) {
2230 NDR_CHECK(ndr_push_AUTHENTICATE_MESSAGE(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.authenticate
));
2232 if (flags
& NDR_OUT
) {
2234 return NDR_ERR_SUCCESS
;
2237 static enum ndr_err_code
ndr_pull_decode_AUTHENTICATE_MESSAGE(struct ndr_pull
*ndr
, int flags
, struct decode_AUTHENTICATE_MESSAGE
*r
)
2239 if (flags
& NDR_IN
) {
2240 NDR_CHECK(ndr_pull_AUTHENTICATE_MESSAGE(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.authenticate
));
2242 if (flags
& NDR_OUT
) {
2244 return NDR_ERR_SUCCESS
;
2247 _PUBLIC_
void ndr_print_decode_AUTHENTICATE_MESSAGE(struct ndr_print
*ndr
, const char *name
, int flags
, const struct decode_AUTHENTICATE_MESSAGE
*r
)
2249 ndr_print_struct(ndr
, name
, "decode_AUTHENTICATE_MESSAGE");
2251 if (flags
& NDR_SET_VALUES
) {
2252 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
2254 if (flags
& NDR_IN
) {
2255 ndr_print_struct(ndr
, "in", "decode_AUTHENTICATE_MESSAGE");
2257 ndr_print_AUTHENTICATE_MESSAGE(ndr
, "authenticate", &r
->in
.authenticate
);
2260 if (flags
& NDR_OUT
) {
2261 ndr_print_struct(ndr
, "out", "decode_AUTHENTICATE_MESSAGE");
2268 static enum ndr_err_code
ndr_push_decode_NTLMv2_CLIENT_CHALLENGE(struct ndr_push
*ndr
, int flags
, const struct decode_NTLMv2_CLIENT_CHALLENGE
*r
)
2270 if (flags
& NDR_IN
) {
2271 NDR_CHECK(ndr_push_NTLMv2_CLIENT_CHALLENGE(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.challenge
));
2273 if (flags
& NDR_OUT
) {
2275 return NDR_ERR_SUCCESS
;
2278 static enum ndr_err_code
ndr_pull_decode_NTLMv2_CLIENT_CHALLENGE(struct ndr_pull
*ndr
, int flags
, struct decode_NTLMv2_CLIENT_CHALLENGE
*r
)
2280 if (flags
& NDR_IN
) {
2281 NDR_CHECK(ndr_pull_NTLMv2_CLIENT_CHALLENGE(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.challenge
));
2283 if (flags
& NDR_OUT
) {
2285 return NDR_ERR_SUCCESS
;
2288 _PUBLIC_
void ndr_print_decode_NTLMv2_CLIENT_CHALLENGE(struct ndr_print
*ndr
, const char *name
, int flags
, const struct decode_NTLMv2_CLIENT_CHALLENGE
*r
)
2290 ndr_print_struct(ndr
, name
, "decode_NTLMv2_CLIENT_CHALLENGE");
2292 if (flags
& NDR_SET_VALUES
) {
2293 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
2295 if (flags
& NDR_IN
) {
2296 ndr_print_struct(ndr
, "in", "decode_NTLMv2_CLIENT_CHALLENGE");
2298 ndr_print_NTLMv2_CLIENT_CHALLENGE(ndr
, "challenge", &r
->in
.challenge
);
2301 if (flags
& NDR_OUT
) {
2302 ndr_print_struct(ndr
, "out", "decode_NTLMv2_CLIENT_CHALLENGE");
2309 static const struct ndr_interface_call ntlmssp_calls
[] = {
2311 "decode_NEGOTIATE_MESSAGE",
2312 sizeof(struct decode_NEGOTIATE_MESSAGE
),
2313 (ndr_push_flags_fn_t
) ndr_push_decode_NEGOTIATE_MESSAGE
,
2314 (ndr_pull_flags_fn_t
) ndr_pull_decode_NEGOTIATE_MESSAGE
,
2315 (ndr_print_function_t
) ndr_print_decode_NEGOTIATE_MESSAGE
,
2319 "decode_CHALLENGE_MESSAGE",
2320 sizeof(struct decode_CHALLENGE_MESSAGE
),
2321 (ndr_push_flags_fn_t
) ndr_push_decode_CHALLENGE_MESSAGE
,
2322 (ndr_pull_flags_fn_t
) ndr_pull_decode_CHALLENGE_MESSAGE
,
2323 (ndr_print_function_t
) ndr_print_decode_CHALLENGE_MESSAGE
,
2327 "decode_AUTHENTICATE_MESSAGE",
2328 sizeof(struct decode_AUTHENTICATE_MESSAGE
),
2329 (ndr_push_flags_fn_t
) ndr_push_decode_AUTHENTICATE_MESSAGE
,
2330 (ndr_pull_flags_fn_t
) ndr_pull_decode_AUTHENTICATE_MESSAGE
,
2331 (ndr_print_function_t
) ndr_print_decode_AUTHENTICATE_MESSAGE
,
2335 "decode_NTLMv2_CLIENT_CHALLENGE",
2336 sizeof(struct decode_NTLMv2_CLIENT_CHALLENGE
),
2337 (ndr_push_flags_fn_t
) ndr_push_decode_NTLMv2_CLIENT_CHALLENGE
,
2338 (ndr_pull_flags_fn_t
) ndr_pull_decode_NTLMv2_CLIENT_CHALLENGE
,
2339 (ndr_print_function_t
) ndr_print_decode_NTLMv2_CLIENT_CHALLENGE
,
2342 { NULL
, 0, NULL
, NULL
, NULL
, false }
2345 static const char * const ntlmssp_endpoint_strings
[] = {
2346 "ncacn_np:[\\pipe\\ntlmssp]",
2349 static const struct ndr_interface_string_array ntlmssp_endpoints
= {
2351 .names
= ntlmssp_endpoint_strings
2354 static const char * const ntlmssp_authservice_strings
[] = {
2358 static const struct ndr_interface_string_array ntlmssp_authservices
= {
2360 .names
= ntlmssp_authservice_strings
2364 const struct ndr_interface_table ndr_table_ntlmssp
= {
2367 {0x6e746c6d,0x7373,0x700a,{0x00,0x00},{0x00,0x00,0x00,0x00}},
2370 .helpstring
= NDR_NTLMSSP_HELPSTRING
,
2372 .calls
= ntlmssp_calls
,
2373 .endpoints
= &ntlmssp_endpoints
,
2374 .authservices
= &ntlmssp_authservices