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_start(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
)));
296 NDR_CHECK(ndr_push_relative_ptr2_end(ndr
, r
->DomainName
));
298 ndr
->flags
= _flags_save_string
;
301 uint32_t _flags_save_string
= ndr
->flags
;
302 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM
));
303 if (r
->Workstation
) {
304 NDR_CHECK(ndr_push_relative_ptr2_start(ndr
, r
->Workstation
));
306 struct ndr_push
*_ndr_Workstation
;
307 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_Workstation
, 0, strlen(r
->Workstation
)));
308 NDR_CHECK(ndr_push_string(_ndr_Workstation
, NDR_SCALARS
, r
->Workstation
));
309 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_Workstation
, 0, strlen(r
->Workstation
)));
311 NDR_CHECK(ndr_push_relative_ptr2_end(ndr
, r
->Workstation
));
313 ndr
->flags
= _flags_save_string
;
315 NDR_CHECK(ndr_push_ntlmssp_Version(ndr
, NDR_BUFFERS
, &r
->Version
));
317 return NDR_ERR_SUCCESS
;
320 _PUBLIC_
enum ndr_err_code
ndr_pull_NEGOTIATE_MESSAGE(struct ndr_pull
*ndr
, int ndr_flags
, struct NEGOTIATE_MESSAGE
*r
)
322 uint32_t _ptr_DomainName
;
323 TALLOC_CTX
*_mem_save_DomainName_0
;
324 uint32_t _ptr_Workstation
;
325 TALLOC_CTX
*_mem_save_Workstation_0
;
326 if (ndr_flags
& NDR_SCALARS
) {
327 NDR_CHECK(ndr_pull_align(ndr
, 5));
328 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->Signature
, 8, sizeof(uint8_t), CH_DOS
));
329 NDR_CHECK(ndr_pull_ntlmssp_MessageType(ndr
, NDR_SCALARS
, &r
->MessageType
));
330 NDR_CHECK(ndr_pull_NEGOTIATE(ndr
, NDR_SCALARS
, &r
->NegotiateFlags
));
331 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->DomainNameLen
));
332 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->DomainNameMaxLen
));
334 uint32_t _flags_save_string
= ndr
->flags
;
335 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM
));
336 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_DomainName
));
337 if (_ptr_DomainName
) {
338 NDR_PULL_ALLOC(ndr
, r
->DomainName
);
339 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->DomainName
, _ptr_DomainName
));
341 r
->DomainName
= NULL
;
343 ndr
->flags
= _flags_save_string
;
345 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->WorkstationLen
));
346 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->WorkstationMaxLen
));
348 uint32_t _flags_save_string
= ndr
->flags
;
349 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM
));
350 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_Workstation
));
351 if (_ptr_Workstation
) {
352 NDR_PULL_ALLOC(ndr
, r
->Workstation
);
353 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->Workstation
, _ptr_Workstation
));
355 r
->Workstation
= NULL
;
357 ndr
->flags
= _flags_save_string
;
359 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
));
360 NDR_CHECK(ndr_pull_ntlmssp_Version(ndr
, NDR_SCALARS
, &r
->Version
));
361 NDR_CHECK(ndr_pull_trailer_align(ndr
, 5));
363 if (ndr_flags
& NDR_BUFFERS
) {
365 uint32_t _flags_save_string
= ndr
->flags
;
366 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM
));
368 uint32_t _relative_save_offset
;
369 _relative_save_offset
= ndr
->offset
;
370 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->DomainName
));
371 _mem_save_DomainName_0
= NDR_PULL_GET_MEM_CTX(ndr
);
372 NDR_PULL_SET_MEM_CTX(ndr
, r
->DomainName
, 0);
374 struct ndr_pull
*_ndr_DomainName
;
375 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_DomainName
, 0, r
->DomainNameLen
));
376 NDR_CHECK(ndr_pull_string(_ndr_DomainName
, NDR_SCALARS
, &r
->DomainName
));
377 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_DomainName
, 0, r
->DomainNameLen
));
379 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_DomainName_0
, 0);
380 if (ndr
->offset
> ndr
->relative_highest_offset
) {
381 ndr
->relative_highest_offset
= ndr
->offset
;
383 ndr
->offset
= _relative_save_offset
;
385 ndr
->flags
= _flags_save_string
;
388 uint32_t _flags_save_string
= ndr
->flags
;
389 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM
));
390 if (r
->Workstation
) {
391 uint32_t _relative_save_offset
;
392 _relative_save_offset
= ndr
->offset
;
393 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->Workstation
));
394 _mem_save_Workstation_0
= NDR_PULL_GET_MEM_CTX(ndr
);
395 NDR_PULL_SET_MEM_CTX(ndr
, r
->Workstation
, 0);
397 struct ndr_pull
*_ndr_Workstation
;
398 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_Workstation
, 0, r
->WorkstationLen
));
399 NDR_CHECK(ndr_pull_string(_ndr_Workstation
, NDR_SCALARS
, &r
->Workstation
));
400 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_Workstation
, 0, r
->WorkstationLen
));
402 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_Workstation_0
, 0);
403 if (ndr
->offset
> ndr
->relative_highest_offset
) {
404 ndr
->relative_highest_offset
= ndr
->offset
;
406 ndr
->offset
= _relative_save_offset
;
408 ndr
->flags
= _flags_save_string
;
410 NDR_CHECK(ndr_pull_ntlmssp_Version(ndr
, NDR_BUFFERS
, &r
->Version
));
412 return NDR_ERR_SUCCESS
;
415 _PUBLIC_
void ndr_print_NEGOTIATE_MESSAGE(struct ndr_print
*ndr
, const char *name
, const struct NEGOTIATE_MESSAGE
*r
)
417 ndr_print_struct(ndr
, name
, "NEGOTIATE_MESSAGE");
419 ndr_print_string(ndr
, "Signature", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?"NTLMSSP":r
->Signature
);
420 ndr_print_ntlmssp_MessageType(ndr
, "MessageType", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?NtLmNegotiate
:r
->MessageType
);
421 ndr_print_NEGOTIATE(ndr
, "NegotiateFlags", r
->NegotiateFlags
);
422 ndr_print_uint16(ndr
, "DomainNameLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?strlen(r
->DomainName
):r
->DomainNameLen
);
423 ndr_print_uint16(ndr
, "DomainNameMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->DomainNameLen
:r
->DomainNameMaxLen
);
424 ndr_print_ptr(ndr
, "DomainName", r
->DomainName
);
427 ndr_print_string(ndr
, "DomainName", r
->DomainName
);
430 ndr_print_uint16(ndr
, "WorkstationLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?strlen(r
->Workstation
):r
->WorkstationLen
);
431 ndr_print_uint16(ndr
, "WorkstationMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->WorkstationLen
:r
->WorkstationMaxLen
);
432 ndr_print_ptr(ndr
, "Workstation", r
->Workstation
);
434 if (r
->Workstation
) {
435 ndr_print_string(ndr
, "Workstation", r
->Workstation
);
438 ndr_print_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
);
439 ndr_print_ntlmssp_Version(ndr
, "Version", &r
->Version
);
443 static enum ndr_err_code
ndr_push_ntlmssp_AvId(struct ndr_push
*ndr
, int ndr_flags
, enum ntlmssp_AvId r
)
445 NDR_CHECK(ndr_push_enum_uint1632(ndr
, NDR_SCALARS
, r
));
446 return NDR_ERR_SUCCESS
;
449 static enum ndr_err_code
ndr_pull_ntlmssp_AvId(struct ndr_pull
*ndr
, int ndr_flags
, enum ntlmssp_AvId
*r
)
452 NDR_CHECK(ndr_pull_enum_uint1632(ndr
, NDR_SCALARS
, &v
));
454 return NDR_ERR_SUCCESS
;
457 _PUBLIC_
void ndr_print_ntlmssp_AvId(struct ndr_print
*ndr
, const char *name
, enum ntlmssp_AvId r
)
459 const char *val
= NULL
;
462 case MsvAvEOL
: val
= "MsvAvEOL"; break;
463 case MsvAvNbComputerName
: val
= "MsvAvNbComputerName"; break;
464 case MsvAvNbDomainName
: val
= "MsvAvNbDomainName"; break;
465 case MsvAvDnsComputerName
: val
= "MsvAvDnsComputerName"; break;
466 case MsvAvDnsDomainName
: val
= "MsvAvDnsDomainName"; break;
467 case MsvAvDnsTreeName
: val
= "MsvAvDnsTreeName"; break;
468 case MsvAvFlags
: val
= "MsvAvFlags"; break;
469 case MsvAvTimestamp
: val
= "MsvAvTimestamp"; break;
470 case MsAvRestrictions
: val
= "MsAvRestrictions"; break;
471 case MsvAvTargetName
: val
= "MsvAvTargetName"; break;
472 case MsvChannelBindings
: val
= "MsvChannelBindings"; break;
474 ndr_print_enum(ndr
, name
, "ENUM", val
, r
);
477 static enum ndr_err_code
ndr_push_Restriction_Encoding(struct ndr_push
*ndr
, int ndr_flags
, const struct Restriction_Encoding
*r
)
479 if (ndr_flags
& NDR_SCALARS
) {
480 NDR_CHECK(ndr_push_align(ndr
, 4));
481 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->Size
));
482 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, 0));
483 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->IntegrityLevel
));
484 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SubjectIntegrityLevel
));
485 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->MachineId
, 32));
486 NDR_CHECK(ndr_push_trailer_align(ndr
, 4));
488 if (ndr_flags
& NDR_BUFFERS
) {
490 return NDR_ERR_SUCCESS
;
493 static enum ndr_err_code
ndr_pull_Restriction_Encoding(struct ndr_pull
*ndr
, int ndr_flags
, struct Restriction_Encoding
*r
)
495 if (ndr_flags
& NDR_SCALARS
) {
496 NDR_CHECK(ndr_pull_align(ndr
, 4));
497 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->Size
));
498 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->Z4
));
499 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->IntegrityLevel
));
500 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SubjectIntegrityLevel
));
501 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->MachineId
, 32));
502 NDR_CHECK(ndr_pull_trailer_align(ndr
, 4));
504 if (ndr_flags
& NDR_BUFFERS
) {
506 return NDR_ERR_SUCCESS
;
509 _PUBLIC_
void ndr_print_Restriction_Encoding(struct ndr_print
*ndr
, const char *name
, const struct Restriction_Encoding
*r
)
511 ndr_print_struct(ndr
, name
, "Restriction_Encoding");
513 ndr_print_uint32(ndr
, "Size", r
->Size
);
514 ndr_print_uint32(ndr
, "Z4", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?0:r
->Z4
);
515 ndr_print_uint32(ndr
, "IntegrityLevel", r
->IntegrityLevel
);
516 ndr_print_uint32(ndr
, "SubjectIntegrityLevel", r
->SubjectIntegrityLevel
);
517 ndr_print_array_uint8(ndr
, "MachineId", r
->MachineId
, 32);
521 static enum ndr_err_code
ndr_push_ntlmssp_AvFlags(struct ndr_push
*ndr
, int ndr_flags
, uint32_t r
)
523 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
));
524 return NDR_ERR_SUCCESS
;
527 static enum ndr_err_code
ndr_pull_ntlmssp_AvFlags(struct ndr_pull
*ndr
, int ndr_flags
, uint32_t *r
)
530 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &v
));
532 return NDR_ERR_SUCCESS
;
535 _PUBLIC_
void ndr_print_ntlmssp_AvFlags(struct ndr_print
*ndr
, const char *name
, uint32_t r
)
537 ndr_print_uint32(ndr
, name
, r
);
539 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT", NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT
, r
);
540 ndr_print_bitmap_flag(ndr
, sizeof(uint32_t), "NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE", NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE
, r
);
544 static enum ndr_err_code
ndr_push_ntlmssp_AvValue(struct ndr_push
*ndr
, int ndr_flags
, const union ntlmssp_AvValue
*r
)
547 uint32_t _flags_save_UNION
= ndr
->flags
;
548 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_NOALIGN
);
549 if (ndr_flags
& NDR_SCALARS
) {
550 int level
= ndr_push_get_switch_value(ndr
, r
);
551 NDR_CHECK(ndr_push_union_align(ndr
, 4));
556 case MsvAvNbComputerName
: {
558 uint32_t _flags_save_string
= ndr
->flags
;
559 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
560 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->AvNbComputerName
));
561 ndr
->flags
= _flags_save_string
;
565 case MsvAvNbDomainName
: {
567 uint32_t _flags_save_string
= ndr
->flags
;
568 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
569 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->AvNbDomainName
));
570 ndr
->flags
= _flags_save_string
;
574 case MsvAvDnsComputerName
: {
576 uint32_t _flags_save_string
= ndr
->flags
;
577 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
578 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->AvDnsComputerName
));
579 ndr
->flags
= _flags_save_string
;
583 case MsvAvDnsDomainName
: {
585 uint32_t _flags_save_string
= ndr
->flags
;
586 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
587 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->AvDnsDomainName
));
588 ndr
->flags
= _flags_save_string
;
592 case MsvAvDnsTreeName
: {
594 uint32_t _flags_save_string
= ndr
->flags
;
595 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
596 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->AvDnsTreeName
));
597 ndr
->flags
= _flags_save_string
;
602 NDR_CHECK(ndr_push_ntlmssp_AvFlags(ndr
, NDR_SCALARS
, r
->AvFlags
));
605 case MsvAvTimestamp
: {
606 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->AvTimestamp
));
609 case MsAvRestrictions
: {
610 NDR_CHECK(ndr_push_Restriction_Encoding(ndr
, NDR_SCALARS
, &r
->AvRestrictions
));
613 case MsvAvTargetName
: {
615 uint32_t _flags_save_string
= ndr
->flags
;
616 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
617 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->AvTargetName
));
618 ndr
->flags
= _flags_save_string
;
622 case MsvChannelBindings
: {
623 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->ChannelBindings
, 16));
628 uint32_t _flags_save_DATA_BLOB
= ndr
->flags
;
629 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
630 NDR_CHECK(ndr_push_DATA_BLOB(ndr
, NDR_SCALARS
, r
->blob
));
631 ndr
->flags
= _flags_save_DATA_BLOB
;
637 if (ndr_flags
& NDR_BUFFERS
) {
638 int level
= ndr_push_get_switch_value(ndr
, r
);
643 case MsvAvNbComputerName
:
646 case MsvAvNbDomainName
:
649 case MsvAvDnsComputerName
:
652 case MsvAvDnsDomainName
:
655 case MsvAvDnsTreeName
:
664 case MsAvRestrictions
:
667 case MsvAvTargetName
:
670 case MsvChannelBindings
:
678 ndr
->flags
= _flags_save_UNION
;
680 return NDR_ERR_SUCCESS
;
683 static enum ndr_err_code
ndr_pull_ntlmssp_AvValue(struct ndr_pull
*ndr
, int ndr_flags
, union ntlmssp_AvValue
*r
)
687 uint32_t _flags_save_UNION
= ndr
->flags
;
688 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_NOALIGN
);
689 level
= ndr_pull_get_switch_value(ndr
, r
);
690 if (ndr_flags
& NDR_SCALARS
) {
691 NDR_CHECK(ndr_pull_union_align(ndr
, 4));
696 case MsvAvNbComputerName
: {
698 uint32_t _flags_save_string
= ndr
->flags
;
699 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
700 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->AvNbComputerName
));
701 ndr
->flags
= _flags_save_string
;
705 case MsvAvNbDomainName
: {
707 uint32_t _flags_save_string
= ndr
->flags
;
708 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
709 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->AvNbDomainName
));
710 ndr
->flags
= _flags_save_string
;
714 case MsvAvDnsComputerName
: {
716 uint32_t _flags_save_string
= ndr
->flags
;
717 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
718 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->AvDnsComputerName
));
719 ndr
->flags
= _flags_save_string
;
723 case MsvAvDnsDomainName
: {
725 uint32_t _flags_save_string
= ndr
->flags
;
726 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
727 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->AvDnsDomainName
));
728 ndr
->flags
= _flags_save_string
;
732 case MsvAvDnsTreeName
: {
734 uint32_t _flags_save_string
= ndr
->flags
;
735 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
736 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->AvDnsTreeName
));
737 ndr
->flags
= _flags_save_string
;
742 NDR_CHECK(ndr_pull_ntlmssp_AvFlags(ndr
, NDR_SCALARS
, &r
->AvFlags
));
745 case MsvAvTimestamp
: {
746 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->AvTimestamp
));
749 case MsAvRestrictions
: {
750 NDR_CHECK(ndr_pull_Restriction_Encoding(ndr
, NDR_SCALARS
, &r
->AvRestrictions
));
753 case MsvAvTargetName
: {
755 uint32_t _flags_save_string
= ndr
->flags
;
756 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE
));
757 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->AvTargetName
));
758 ndr
->flags
= _flags_save_string
;
762 case MsvChannelBindings
: {
763 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->ChannelBindings
, 16));
768 uint32_t _flags_save_DATA_BLOB
= ndr
->flags
;
769 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
770 NDR_CHECK(ndr_pull_DATA_BLOB(ndr
, NDR_SCALARS
, &r
->blob
));
771 ndr
->flags
= _flags_save_DATA_BLOB
;
777 if (ndr_flags
& NDR_BUFFERS
) {
782 case MsvAvNbComputerName
:
785 case MsvAvNbDomainName
:
788 case MsvAvDnsComputerName
:
791 case MsvAvDnsDomainName
:
794 case MsvAvDnsTreeName
:
803 case MsAvRestrictions
:
806 case MsvAvTargetName
:
809 case MsvChannelBindings
:
817 ndr
->flags
= _flags_save_UNION
;
819 return NDR_ERR_SUCCESS
;
822 _PUBLIC_
void ndr_print_ntlmssp_AvValue(struct ndr_print
*ndr
, const char *name
, const union ntlmssp_AvValue
*r
)
826 uint32_t _flags_save_UNION
= ndr
->flags
;
827 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_NOALIGN
);
828 level
= ndr_print_get_switch_value(ndr
, r
);
829 ndr_print_union(ndr
, name
, level
, "ntlmssp_AvValue");
834 case MsvAvNbComputerName
:
835 ndr_print_string(ndr
, "AvNbComputerName", r
->AvNbComputerName
);
838 case MsvAvNbDomainName
:
839 ndr_print_string(ndr
, "AvNbDomainName", r
->AvNbDomainName
);
842 case MsvAvDnsComputerName
:
843 ndr_print_string(ndr
, "AvDnsComputerName", r
->AvDnsComputerName
);
846 case MsvAvDnsDomainName
:
847 ndr_print_string(ndr
, "AvDnsDomainName", r
->AvDnsDomainName
);
850 case MsvAvDnsTreeName
:
851 ndr_print_string(ndr
, "AvDnsTreeName", r
->AvDnsTreeName
);
855 ndr_print_ntlmssp_AvFlags(ndr
, "AvFlags", r
->AvFlags
);
859 ndr_print_NTTIME(ndr
, "AvTimestamp", r
->AvTimestamp
);
862 case MsAvRestrictions
:
863 ndr_print_Restriction_Encoding(ndr
, "AvRestrictions", &r
->AvRestrictions
);
866 case MsvAvTargetName
:
867 ndr_print_string(ndr
, "AvTargetName", r
->AvTargetName
);
870 case MsvChannelBindings
:
871 ndr_print_array_uint8(ndr
, "ChannelBindings", r
->ChannelBindings
, 16);
875 ndr_print_DATA_BLOB(ndr
, "blob", r
->blob
);
879 ndr
->flags
= _flags_save_UNION
;
883 static size_t ndr_size_ntlmssp_AvValue(const union ntlmssp_AvValue
*r
, uint32_t level
, struct smb_iconv_convenience
*ic
, int flags
)
885 flags
|= LIBNDR_FLAG_NOALIGN
;
886 return ndr_size_union(r
, flags
, level
, (ndr_push_flags_fn_t
)ndr_push_ntlmssp_AvValue
, ic
);
889 _PUBLIC_
enum ndr_err_code
ndr_push_AV_PAIR(struct ndr_push
*ndr
, int ndr_flags
, const struct AV_PAIR
*r
)
892 uint32_t _flags_save_STRUCT
= ndr
->flags
;
893 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_NOALIGN
);
894 if (ndr_flags
& NDR_SCALARS
) {
895 NDR_CHECK(ndr_push_align(ndr
, 4));
896 NDR_CHECK(ndr_push_ntlmssp_AvId(ndr
, NDR_SCALARS
, r
->AvId
));
897 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_size_ntlmssp_AvValue(&r
->Value
, r
->AvId
, ndr
->iconv_convenience
, 0)));
899 struct ndr_push
*_ndr_Value
;
900 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_Value
, 0, ndr_size_ntlmssp_AvValue(&r
->Value
, r
->AvId
, ndr
->iconv_convenience
, 0)));
901 NDR_CHECK(ndr_push_set_switch_value(_ndr_Value
, &r
->Value
, r
->AvId
));
902 NDR_CHECK(ndr_push_ntlmssp_AvValue(_ndr_Value
, NDR_SCALARS
|NDR_BUFFERS
, &r
->Value
));
903 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_Value
, 0, ndr_size_ntlmssp_AvValue(&r
->Value
, r
->AvId
, ndr
->iconv_convenience
, 0)));
905 NDR_CHECK(ndr_push_trailer_align(ndr
, 4));
907 if (ndr_flags
& NDR_BUFFERS
) {
909 ndr
->flags
= _flags_save_STRUCT
;
911 return NDR_ERR_SUCCESS
;
914 _PUBLIC_
enum ndr_err_code
ndr_pull_AV_PAIR(struct ndr_pull
*ndr
, int ndr_flags
, struct AV_PAIR
*r
)
917 uint32_t _flags_save_STRUCT
= ndr
->flags
;
918 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_NOALIGN
);
919 if (ndr_flags
& NDR_SCALARS
) {
920 NDR_CHECK(ndr_pull_align(ndr
, 4));
921 NDR_CHECK(ndr_pull_ntlmssp_AvId(ndr
, NDR_SCALARS
, &r
->AvId
));
922 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->AvLen
));
924 struct ndr_pull
*_ndr_Value
;
925 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_Value
, 0, r
->AvLen
));
926 NDR_CHECK(ndr_pull_set_switch_value(_ndr_Value
, &r
->Value
, r
->AvId
));
927 NDR_CHECK(ndr_pull_ntlmssp_AvValue(_ndr_Value
, NDR_SCALARS
|NDR_BUFFERS
, &r
->Value
));
928 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_Value
, 0, r
->AvLen
));
930 NDR_CHECK(ndr_pull_trailer_align(ndr
, 4));
932 if (ndr_flags
& NDR_BUFFERS
) {
934 ndr
->flags
= _flags_save_STRUCT
;
936 return NDR_ERR_SUCCESS
;
939 _PUBLIC_
void ndr_print_AV_PAIR(struct ndr_print
*ndr
, const char *name
, const struct AV_PAIR
*r
)
941 ndr_print_struct(ndr
, name
, "AV_PAIR");
943 uint32_t _flags_save_STRUCT
= ndr
->flags
;
944 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_NOALIGN
);
946 ndr_print_ntlmssp_AvId(ndr
, "AvId", r
->AvId
);
947 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
);
948 ndr_print_set_switch_value(ndr
, &r
->Value
, r
->AvId
);
949 ndr_print_ntlmssp_AvValue(ndr
, "Value", &r
->Value
);
951 ndr
->flags
= _flags_save_STRUCT
;
955 _PUBLIC_
void ndr_print_AV_PAIR_LIST(struct ndr_print
*ndr
, const char *name
, const struct AV_PAIR_LIST
*r
)
957 uint32_t cntr_pair_0
;
958 ndr_print_struct(ndr
, name
, "AV_PAIR_LIST");
960 uint32_t _flags_save_STRUCT
= ndr
->flags
;
961 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_NOALIGN
);
963 ndr_print_uint32(ndr
, "count", r
->count
);
964 ndr
->print(ndr
, "%s: ARRAY(%d)", "pair", (int)r
->count
);
966 for (cntr_pair_0
=0;cntr_pair_0
<r
->count
;cntr_pair_0
++) {
968 if (asprintf(&idx_0
, "[%d]", cntr_pair_0
) != -1) {
969 ndr_print_AV_PAIR(ndr
, "pair", &r
->pair
[cntr_pair_0
]);
975 ndr
->flags
= _flags_save_STRUCT
;
979 static size_t ndr_size_AV_PAIR_LIST(const struct AV_PAIR_LIST
*r
, struct smb_iconv_convenience
*ic
, int flags
)
981 flags
|= LIBNDR_FLAG_NOALIGN
;
982 return ndr_size_struct(r
, flags
, (ndr_push_flags_fn_t
)ndr_push_AV_PAIR_LIST
, ic
);
985 _PUBLIC_
enum ndr_err_code
ndr_push_CHALLENGE_MESSAGE(struct ndr_push
*ndr
, int ndr_flags
, const struct CHALLENGE_MESSAGE
*r
)
988 uint32_t _flags_save_STRUCT
= ndr
->flags
;
989 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
990 if (ndr_flags
& NDR_SCALARS
) {
991 NDR_CHECK(ndr_push_align(ndr
, 5));
992 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, "NTLMSSP", 8, sizeof(uint8_t), CH_DOS
));
993 NDR_CHECK(ndr_push_ntlmssp_MessageType(ndr
, NDR_SCALARS
, NtLmChallenge
));
994 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->TargetName
)));
995 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->TargetName
)));
997 uint32_t _flags_save_string
= ndr
->flags
;
998 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
999 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->TargetName
));
1000 ndr
->flags
= _flags_save_string
;
1002 NDR_CHECK(ndr_push_NEGOTIATE(ndr
, NDR_SCALARS
, r
->NegotiateFlags
));
1003 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->ServerChallenge
, 8));
1004 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Reserved
, 8));
1005 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_size_AV_PAIR_LIST(r
->TargetInfo
, ndr
->iconv_convenience
, ndr
->flags
)));
1006 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_size_AV_PAIR_LIST(r
->TargetInfo
, ndr
->iconv_convenience
, ndr
->flags
)));
1007 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->TargetInfo
));
1008 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
));
1009 NDR_CHECK(ndr_push_ntlmssp_Version(ndr
, NDR_SCALARS
, &r
->Version
));
1010 NDR_CHECK(ndr_push_trailer_align(ndr
, 5));
1012 if (ndr_flags
& NDR_BUFFERS
) {
1014 uint32_t _flags_save_string
= ndr
->flags
;
1015 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1016 if (r
->TargetName
) {
1017 NDR_CHECK(ndr_push_relative_ptr2_start(ndr
, r
->TargetName
));
1019 struct ndr_push
*_ndr_TargetName
;
1020 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_TargetName
, 0, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->TargetName
)));
1021 NDR_CHECK(ndr_push_string(_ndr_TargetName
, NDR_SCALARS
, r
->TargetName
));
1022 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_TargetName
, 0, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->TargetName
)));
1024 NDR_CHECK(ndr_push_relative_ptr2_end(ndr
, r
->TargetName
));
1026 ndr
->flags
= _flags_save_string
;
1028 if (r
->TargetInfo
) {
1029 NDR_CHECK(ndr_push_relative_ptr2_start(ndr
, r
->TargetInfo
));
1031 struct ndr_push
*_ndr_TargetInfo
;
1032 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_TargetInfo
, 0, ndr_size_AV_PAIR_LIST(r
->TargetInfo
, ndr
->iconv_convenience
, ndr
->flags
)));
1033 NDR_CHECK(ndr_push_AV_PAIR_LIST(_ndr_TargetInfo
, NDR_SCALARS
|NDR_BUFFERS
, r
->TargetInfo
));
1034 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_TargetInfo
, 0, ndr_size_AV_PAIR_LIST(r
->TargetInfo
, ndr
->iconv_convenience
, ndr
->flags
)));
1036 NDR_CHECK(ndr_push_relative_ptr2_end(ndr
, r
->TargetInfo
));
1038 NDR_CHECK(ndr_push_ntlmssp_Version(ndr
, NDR_BUFFERS
, &r
->Version
));
1040 ndr
->flags
= _flags_save_STRUCT
;
1042 return NDR_ERR_SUCCESS
;
1045 _PUBLIC_
enum ndr_err_code
ndr_pull_CHALLENGE_MESSAGE(struct ndr_pull
*ndr
, int ndr_flags
, struct CHALLENGE_MESSAGE
*r
)
1047 uint32_t _ptr_TargetName
;
1048 TALLOC_CTX
*_mem_save_TargetName_0
;
1049 uint32_t _ptr_TargetInfo
;
1050 TALLOC_CTX
*_mem_save_TargetInfo_0
;
1052 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1053 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1054 if (ndr_flags
& NDR_SCALARS
) {
1055 NDR_CHECK(ndr_pull_align(ndr
, 5));
1056 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->Signature
, 8, sizeof(uint8_t), CH_DOS
));
1057 NDR_CHECK(ndr_pull_ntlmssp_MessageType(ndr
, NDR_SCALARS
, &r
->MessageType
));
1058 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->TargetNameLen
));
1059 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->TargetNameMaxLen
));
1061 uint32_t _flags_save_string
= ndr
->flags
;
1062 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1063 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_TargetName
));
1064 if (_ptr_TargetName
) {
1065 NDR_PULL_ALLOC(ndr
, r
->TargetName
);
1066 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->TargetName
, _ptr_TargetName
));
1068 r
->TargetName
= NULL
;
1070 ndr
->flags
= _flags_save_string
;
1072 NDR_CHECK(ndr_pull_NEGOTIATE(ndr
, NDR_SCALARS
, &r
->NegotiateFlags
));
1073 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->ServerChallenge
, 8));
1074 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Reserved
, 8));
1075 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->TargetInfoLen
));
1076 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->TargetNameInfoMaxLen
));
1077 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_TargetInfo
));
1078 if (_ptr_TargetInfo
) {
1079 NDR_PULL_ALLOC(ndr
, r
->TargetInfo
);
1080 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->TargetInfo
, _ptr_TargetInfo
));
1082 r
->TargetInfo
= NULL
;
1084 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
));
1085 NDR_CHECK(ndr_pull_ntlmssp_Version(ndr
, NDR_SCALARS
, &r
->Version
));
1086 NDR_CHECK(ndr_pull_trailer_align(ndr
, 5));
1088 if (ndr_flags
& NDR_BUFFERS
) {
1090 uint32_t _flags_save_string
= ndr
->flags
;
1091 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1092 if (r
->TargetName
) {
1093 uint32_t _relative_save_offset
;
1094 _relative_save_offset
= ndr
->offset
;
1095 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->TargetName
));
1096 _mem_save_TargetName_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1097 NDR_PULL_SET_MEM_CTX(ndr
, r
->TargetName
, 0);
1099 struct ndr_pull
*_ndr_TargetName
;
1100 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_TargetName
, 0, r
->TargetNameLen
));
1101 NDR_CHECK(ndr_pull_string(_ndr_TargetName
, NDR_SCALARS
, &r
->TargetName
));
1102 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_TargetName
, 0, r
->TargetNameLen
));
1104 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_TargetName_0
, 0);
1105 if (ndr
->offset
> ndr
->relative_highest_offset
) {
1106 ndr
->relative_highest_offset
= ndr
->offset
;
1108 ndr
->offset
= _relative_save_offset
;
1110 ndr
->flags
= _flags_save_string
;
1112 if (r
->TargetInfo
) {
1113 uint32_t _relative_save_offset
;
1114 _relative_save_offset
= ndr
->offset
;
1115 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->TargetInfo
));
1116 _mem_save_TargetInfo_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1117 NDR_PULL_SET_MEM_CTX(ndr
, r
->TargetInfo
, 0);
1119 struct ndr_pull
*_ndr_TargetInfo
;
1120 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_TargetInfo
, 0, r
->TargetInfoLen
));
1121 NDR_CHECK(ndr_pull_AV_PAIR_LIST(_ndr_TargetInfo
, NDR_SCALARS
|NDR_BUFFERS
, r
->TargetInfo
));
1122 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_TargetInfo
, 0, r
->TargetInfoLen
));
1124 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_TargetInfo_0
, 0);
1125 if (ndr
->offset
> ndr
->relative_highest_offset
) {
1126 ndr
->relative_highest_offset
= ndr
->offset
;
1128 ndr
->offset
= _relative_save_offset
;
1130 NDR_CHECK(ndr_pull_ntlmssp_Version(ndr
, NDR_BUFFERS
, &r
->Version
));
1132 ndr
->flags
= _flags_save_STRUCT
;
1134 return NDR_ERR_SUCCESS
;
1137 _PUBLIC_
void ndr_print_CHALLENGE_MESSAGE(struct ndr_print
*ndr
, const char *name
, const struct CHALLENGE_MESSAGE
*r
)
1139 ndr_print_struct(ndr
, name
, "CHALLENGE_MESSAGE");
1141 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1142 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1144 ndr_print_string(ndr
, "Signature", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?"NTLMSSP":r
->Signature
);
1145 ndr_print_ntlmssp_MessageType(ndr
, "MessageType", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?NtLmChallenge
:r
->MessageType
);
1146 ndr_print_uint16(ndr
, "TargetNameLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->TargetName
):r
->TargetNameLen
);
1147 ndr_print_uint16(ndr
, "TargetNameMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->TargetNameLen
:r
->TargetNameMaxLen
);
1148 ndr_print_ptr(ndr
, "TargetName", r
->TargetName
);
1150 if (r
->TargetName
) {
1151 ndr_print_string(ndr
, "TargetName", r
->TargetName
);
1154 ndr_print_NEGOTIATE(ndr
, "NegotiateFlags", r
->NegotiateFlags
);
1155 ndr_print_array_uint8(ndr
, "ServerChallenge", r
->ServerChallenge
, 8);
1156 ndr_print_array_uint8(ndr
, "Reserved", r
->Reserved
, 8);
1157 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
);
1158 ndr_print_uint16(ndr
, "TargetNameInfoMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->TargetInfoLen
:r
->TargetNameInfoMaxLen
);
1159 ndr_print_ptr(ndr
, "TargetInfo", r
->TargetInfo
);
1161 if (r
->TargetInfo
) {
1162 ndr_print_AV_PAIR_LIST(ndr
, "TargetInfo", r
->TargetInfo
);
1165 ndr_print_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
);
1166 ndr_print_ntlmssp_Version(ndr
, "Version", &r
->Version
);
1168 ndr
->flags
= _flags_save_STRUCT
;
1172 _PUBLIC_
enum ndr_err_code
ndr_push_LM_RESPONSE(struct ndr_push
*ndr
, int ndr_flags
, const struct LM_RESPONSE
*r
)
1175 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1176 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1177 if (ndr_flags
& NDR_SCALARS
) {
1178 NDR_CHECK(ndr_push_align(ndr
, 1));
1179 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Response
, 24));
1180 NDR_CHECK(ndr_push_trailer_align(ndr
, 1));
1182 if (ndr_flags
& NDR_BUFFERS
) {
1184 ndr
->flags
= _flags_save_STRUCT
;
1186 return NDR_ERR_SUCCESS
;
1189 _PUBLIC_
enum ndr_err_code
ndr_pull_LM_RESPONSE(struct ndr_pull
*ndr
, int ndr_flags
, struct LM_RESPONSE
*r
)
1192 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1193 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1194 if (ndr_flags
& NDR_SCALARS
) {
1195 NDR_CHECK(ndr_pull_align(ndr
, 1));
1196 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Response
, 24));
1197 NDR_CHECK(ndr_pull_trailer_align(ndr
, 1));
1199 if (ndr_flags
& NDR_BUFFERS
) {
1201 ndr
->flags
= _flags_save_STRUCT
;
1203 return NDR_ERR_SUCCESS
;
1206 _PUBLIC_
void ndr_print_LM_RESPONSE(struct ndr_print
*ndr
, const char *name
, const struct LM_RESPONSE
*r
)
1208 ndr_print_struct(ndr
, name
, "LM_RESPONSE");
1210 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1211 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1213 ndr_print_array_uint8(ndr
, "Response", r
->Response
, 24);
1215 ndr
->flags
= _flags_save_STRUCT
;
1219 _PUBLIC_
enum ndr_err_code
ndr_push_LMv2_RESPONSE(struct ndr_push
*ndr
, int ndr_flags
, const struct LMv2_RESPONSE
*r
)
1222 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1223 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1224 if (ndr_flags
& NDR_SCALARS
) {
1225 NDR_CHECK(ndr_push_align(ndr
, 1));
1226 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Response
, 16));
1227 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->ChallengeFromClient
, 8));
1228 NDR_CHECK(ndr_push_trailer_align(ndr
, 1));
1230 if (ndr_flags
& NDR_BUFFERS
) {
1232 ndr
->flags
= _flags_save_STRUCT
;
1234 return NDR_ERR_SUCCESS
;
1237 _PUBLIC_
enum ndr_err_code
ndr_pull_LMv2_RESPONSE(struct ndr_pull
*ndr
, int ndr_flags
, struct LMv2_RESPONSE
*r
)
1240 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1241 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1242 if (ndr_flags
& NDR_SCALARS
) {
1243 NDR_CHECK(ndr_pull_align(ndr
, 1));
1244 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Response
, 16));
1245 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->ChallengeFromClient
, 8));
1246 NDR_CHECK(ndr_pull_trailer_align(ndr
, 1));
1248 if (ndr_flags
& NDR_BUFFERS
) {
1250 ndr
->flags
= _flags_save_STRUCT
;
1252 return NDR_ERR_SUCCESS
;
1255 _PUBLIC_
void ndr_print_LMv2_RESPONSE(struct ndr_print
*ndr
, const char *name
, const struct LMv2_RESPONSE
*r
)
1257 ndr_print_struct(ndr
, name
, "LMv2_RESPONSE");
1259 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1260 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1262 ndr_print_array_uint8(ndr
, "Response", r
->Response
, 16);
1263 ndr_print_array_uint8(ndr
, "ChallengeFromClient", r
->ChallengeFromClient
, 8);
1265 ndr
->flags
= _flags_save_STRUCT
;
1269 static enum ndr_err_code
ndr_push_ntlmssp_LM_RESPONSE(struct ndr_push
*ndr
, int ndr_flags
, const union ntlmssp_LM_RESPONSE
*r
)
1271 if (ndr_flags
& NDR_SCALARS
) {
1272 int level
= ndr_push_get_switch_value(ndr
, r
);
1273 NDR_CHECK(ndr_push_union_align(ndr
, 1));
1276 NDR_CHECK(ndr_push_LM_RESPONSE(ndr
, NDR_SCALARS
, &r
->v1
));
1284 if (ndr_flags
& NDR_BUFFERS
) {
1285 int level
= ndr_push_get_switch_value(ndr
, r
);
1295 return NDR_ERR_SUCCESS
;
1298 static enum ndr_err_code
ndr_pull_ntlmssp_LM_RESPONSE(struct ndr_pull
*ndr
, int ndr_flags
, union ntlmssp_LM_RESPONSE
*r
)
1301 level
= ndr_pull_get_switch_value(ndr
, r
);
1302 if (ndr_flags
& NDR_SCALARS
) {
1303 NDR_CHECK(ndr_pull_union_align(ndr
, 1));
1306 NDR_CHECK(ndr_pull_LM_RESPONSE(ndr
, NDR_SCALARS
, &r
->v1
));
1314 if (ndr_flags
& NDR_BUFFERS
) {
1324 return NDR_ERR_SUCCESS
;
1327 _PUBLIC_
void ndr_print_ntlmssp_LM_RESPONSE(struct ndr_print
*ndr
, const char *name
, const union ntlmssp_LM_RESPONSE
*r
)
1330 level
= ndr_print_get_switch_value(ndr
, r
);
1331 ndr_print_union(ndr
, name
, level
, "ntlmssp_LM_RESPONSE");
1334 ndr_print_LM_RESPONSE(ndr
, "v1", &r
->v1
);
1343 _PUBLIC_
enum ndr_err_code
ndr_push_NTLM_RESPONSE(struct ndr_push
*ndr
, int ndr_flags
, const struct NTLM_RESPONSE
*r
)
1346 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1347 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1348 if (ndr_flags
& NDR_SCALARS
) {
1349 NDR_CHECK(ndr_push_align(ndr
, 1));
1350 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Response
, 24));
1351 NDR_CHECK(ndr_push_trailer_align(ndr
, 1));
1353 if (ndr_flags
& NDR_BUFFERS
) {
1355 ndr
->flags
= _flags_save_STRUCT
;
1357 return NDR_ERR_SUCCESS
;
1360 _PUBLIC_
enum ndr_err_code
ndr_pull_NTLM_RESPONSE(struct ndr_pull
*ndr
, int ndr_flags
, struct NTLM_RESPONSE
*r
)
1363 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1364 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1365 if (ndr_flags
& NDR_SCALARS
) {
1366 NDR_CHECK(ndr_pull_align(ndr
, 1));
1367 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Response
, 24));
1368 NDR_CHECK(ndr_pull_trailer_align(ndr
, 1));
1370 if (ndr_flags
& NDR_BUFFERS
) {
1372 ndr
->flags
= _flags_save_STRUCT
;
1374 return NDR_ERR_SUCCESS
;
1377 _PUBLIC_
void ndr_print_NTLM_RESPONSE(struct ndr_print
*ndr
, const char *name
, const struct NTLM_RESPONSE
*r
)
1379 ndr_print_struct(ndr
, name
, "NTLM_RESPONSE");
1381 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1382 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1384 ndr_print_array_uint8(ndr
, "Response", r
->Response
, 24);
1386 ndr
->flags
= _flags_save_STRUCT
;
1390 static enum ndr_err_code
ndr_push_NTLMv2_CLIENT_CHALLENGE(struct ndr_push
*ndr
, int ndr_flags
, const struct NTLMv2_CLIENT_CHALLENGE
*r
)
1393 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1394 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1395 if (ndr_flags
& NDR_SCALARS
) {
1396 NDR_CHECK(ndr_push_align(ndr
, 4));
1397 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, 1));
1398 NDR_CHECK(ndr_push_uint8(ndr
, NDR_SCALARS
, 1));
1399 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->Reserved1
));
1400 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->Reserved2
));
1401 NDR_CHECK(ndr_push_NTTIME(ndr
, NDR_SCALARS
, r
->TimeStamp
));
1402 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->ChallengeFromClient
, 8));
1403 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->Reserved3
));
1405 uint32_t _flags_save_AV_PAIR_LIST
= ndr
->flags
;
1406 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
1408 struct ndr_push
*_ndr_AvPairs
;
1409 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_AvPairs
, 0, -1));
1410 NDR_CHECK(ndr_push_AV_PAIR_LIST(_ndr_AvPairs
, NDR_SCALARS
|NDR_BUFFERS
, &r
->AvPairs
));
1411 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_AvPairs
, 0, -1));
1413 ndr
->flags
= _flags_save_AV_PAIR_LIST
;
1415 NDR_CHECK(ndr_push_trailer_align(ndr
, 4));
1417 if (ndr_flags
& NDR_BUFFERS
) {
1419 uint32_t _flags_save_AV_PAIR_LIST
= ndr
->flags
;
1420 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
1421 ndr
->flags
= _flags_save_AV_PAIR_LIST
;
1424 ndr
->flags
= _flags_save_STRUCT
;
1426 return NDR_ERR_SUCCESS
;
1429 static enum ndr_err_code
ndr_pull_NTLMv2_CLIENT_CHALLENGE(struct ndr_pull
*ndr
, int ndr_flags
, struct NTLMv2_CLIENT_CHALLENGE
*r
)
1432 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1433 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1434 if (ndr_flags
& NDR_SCALARS
) {
1435 NDR_CHECK(ndr_pull_align(ndr
, 4));
1436 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->RespType
));
1437 NDR_CHECK(ndr_pull_uint8(ndr
, NDR_SCALARS
, &r
->HiRespType
));
1438 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->Reserved1
));
1439 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->Reserved2
));
1440 NDR_CHECK(ndr_pull_NTTIME(ndr
, NDR_SCALARS
, &r
->TimeStamp
));
1441 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->ChallengeFromClient
, 8));
1442 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->Reserved3
));
1444 uint32_t _flags_save_AV_PAIR_LIST
= ndr
->flags
;
1445 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
1447 struct ndr_pull
*_ndr_AvPairs
;
1448 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_AvPairs
, 0, -1));
1449 NDR_CHECK(ndr_pull_AV_PAIR_LIST(_ndr_AvPairs
, NDR_SCALARS
|NDR_BUFFERS
, &r
->AvPairs
));
1450 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_AvPairs
, 0, -1));
1452 ndr
->flags
= _flags_save_AV_PAIR_LIST
;
1454 NDR_CHECK(ndr_pull_trailer_align(ndr
, 4));
1456 if (ndr_flags
& NDR_BUFFERS
) {
1458 uint32_t _flags_save_AV_PAIR_LIST
= ndr
->flags
;
1459 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
1460 ndr
->flags
= _flags_save_AV_PAIR_LIST
;
1463 ndr
->flags
= _flags_save_STRUCT
;
1465 return NDR_ERR_SUCCESS
;
1468 _PUBLIC_
void ndr_print_NTLMv2_CLIENT_CHALLENGE(struct ndr_print
*ndr
, const char *name
, const struct NTLMv2_CLIENT_CHALLENGE
*r
)
1470 ndr_print_struct(ndr
, name
, "NTLMv2_CLIENT_CHALLENGE");
1472 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1473 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1475 ndr_print_uint8(ndr
, "RespType", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?1:r
->RespType
);
1476 ndr_print_uint8(ndr
, "HiRespType", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?1:r
->HiRespType
);
1477 ndr_print_uint16(ndr
, "Reserved1", r
->Reserved1
);
1478 ndr_print_uint32(ndr
, "Reserved2", r
->Reserved2
);
1479 ndr_print_NTTIME(ndr
, "TimeStamp", r
->TimeStamp
);
1480 ndr_print_array_uint8(ndr
, "ChallengeFromClient", r
->ChallengeFromClient
, 8);
1481 ndr_print_uint32(ndr
, "Reserved3", r
->Reserved3
);
1482 ndr_print_AV_PAIR_LIST(ndr
, "AvPairs", &r
->AvPairs
);
1484 ndr
->flags
= _flags_save_STRUCT
;
1488 _PUBLIC_
enum ndr_err_code
ndr_push_NTLMv2_RESPONSE(struct ndr_push
*ndr
, int ndr_flags
, const struct NTLMv2_RESPONSE
*r
)
1491 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1492 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1493 if (ndr_flags
& NDR_SCALARS
) {
1494 NDR_CHECK(ndr_push_align(ndr
, 4));
1495 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Response
, 16));
1496 NDR_CHECK(ndr_push_NTLMv2_CLIENT_CHALLENGE(ndr
, NDR_SCALARS
, &r
->Challenge
));
1497 NDR_CHECK(ndr_push_trailer_align(ndr
, 4));
1499 if (ndr_flags
& NDR_BUFFERS
) {
1500 NDR_CHECK(ndr_push_NTLMv2_CLIENT_CHALLENGE(ndr
, NDR_BUFFERS
, &r
->Challenge
));
1502 ndr
->flags
= _flags_save_STRUCT
;
1504 return NDR_ERR_SUCCESS
;
1507 _PUBLIC_
enum ndr_err_code
ndr_pull_NTLMv2_RESPONSE(struct ndr_pull
*ndr
, int ndr_flags
, struct NTLMv2_RESPONSE
*r
)
1510 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1511 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1512 if (ndr_flags
& NDR_SCALARS
) {
1513 NDR_CHECK(ndr_pull_align(ndr
, 4));
1514 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Response
, 16));
1515 NDR_CHECK(ndr_pull_NTLMv2_CLIENT_CHALLENGE(ndr
, NDR_SCALARS
, &r
->Challenge
));
1516 NDR_CHECK(ndr_pull_trailer_align(ndr
, 4));
1518 if (ndr_flags
& NDR_BUFFERS
) {
1519 NDR_CHECK(ndr_pull_NTLMv2_CLIENT_CHALLENGE(ndr
, NDR_BUFFERS
, &r
->Challenge
));
1521 ndr
->flags
= _flags_save_STRUCT
;
1523 return NDR_ERR_SUCCESS
;
1526 _PUBLIC_
void ndr_print_NTLMv2_RESPONSE(struct ndr_print
*ndr
, const char *name
, const struct NTLMv2_RESPONSE
*r
)
1528 ndr_print_struct(ndr
, name
, "NTLMv2_RESPONSE");
1530 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1531 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
1533 ndr_print_array_uint8(ndr
, "Response", r
->Response
, 16);
1534 ndr_print_NTLMv2_CLIENT_CHALLENGE(ndr
, "Challenge", &r
->Challenge
);
1536 ndr
->flags
= _flags_save_STRUCT
;
1540 _PUBLIC_
enum ndr_err_code
ndr_push_ntlmssp_NTLM_RESPONSE(struct ndr_push
*ndr
, int ndr_flags
, const union ntlmssp_NTLM_RESPONSE
*r
)
1542 if (ndr_flags
& NDR_SCALARS
) {
1543 int level
= ndr_push_get_switch_value(ndr
, r
);
1544 NDR_CHECK(ndr_push_union_align(ndr
, 4));
1550 NDR_CHECK(ndr_push_NTLM_RESPONSE(ndr
, NDR_SCALARS
, &r
->v1
));
1554 NDR_CHECK(ndr_push_NTLMv2_RESPONSE(ndr
, NDR_SCALARS
, &r
->v2
));
1559 if (ndr_flags
& NDR_BUFFERS
) {
1560 int level
= ndr_push_get_switch_value(ndr
, r
);
1569 NDR_CHECK(ndr_push_NTLMv2_RESPONSE(ndr
, NDR_BUFFERS
, &r
->v2
));
1574 return NDR_ERR_SUCCESS
;
1577 _PUBLIC_
enum ndr_err_code
ndr_pull_ntlmssp_NTLM_RESPONSE(struct ndr_pull
*ndr
, int ndr_flags
, union ntlmssp_NTLM_RESPONSE
*r
)
1580 level
= ndr_pull_get_switch_value(ndr
, r
);
1581 if (ndr_flags
& NDR_SCALARS
) {
1582 NDR_CHECK(ndr_pull_union_align(ndr
, 4));
1588 NDR_CHECK(ndr_pull_NTLM_RESPONSE(ndr
, NDR_SCALARS
, &r
->v1
));
1592 NDR_CHECK(ndr_pull_NTLMv2_RESPONSE(ndr
, NDR_SCALARS
, &r
->v2
));
1597 if (ndr_flags
& NDR_BUFFERS
) {
1606 NDR_CHECK(ndr_pull_NTLMv2_RESPONSE(ndr
, NDR_BUFFERS
, &r
->v2
));
1611 return NDR_ERR_SUCCESS
;
1614 _PUBLIC_
void ndr_print_ntlmssp_NTLM_RESPONSE(struct ndr_print
*ndr
, const char *name
, const union ntlmssp_NTLM_RESPONSE
*r
)
1617 level
= ndr_print_get_switch_value(ndr
, r
);
1618 ndr_print_union(ndr
, name
, level
, "ntlmssp_NTLM_RESPONSE");
1624 ndr_print_NTLM_RESPONSE(ndr
, "v1", &r
->v1
);
1628 ndr_print_NTLMv2_RESPONSE(ndr
, "v2", &r
->v2
);
1634 _PUBLIC_
enum ndr_err_code
ndr_push_AUTHENTICATE_MESSAGE(struct ndr_push
*ndr
, int ndr_flags
, const struct AUTHENTICATE_MESSAGE
*r
)
1637 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1638 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
1639 if (ndr_flags
& NDR_SCALARS
) {
1640 NDR_CHECK(ndr_push_align(ndr
, 5));
1641 NDR_CHECK(ndr_push_charset(ndr
, NDR_SCALARS
, "NTLMSSP", 8, sizeof(uint8_t), CH_DOS
));
1642 NDR_CHECK(ndr_push_ntlmssp_MessageType(ndr
, NDR_SCALARS
, NtLmAuthenticate
));
1643 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->LmChallengeResponseLen
));
1644 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->LmChallengeResponseLen
));
1645 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->LmChallengeResponse
));
1646 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->NtChallengeResponseLen
));
1647 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->NtChallengeResponseLen
));
1648 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->NtChallengeResponse
));
1649 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->DomainName
)));
1650 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->DomainName
)));
1652 uint32_t _flags_save_string
= ndr
->flags
;
1653 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1654 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->DomainName
));
1655 ndr
->flags
= _flags_save_string
;
1657 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->UserName
)));
1658 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->UserName
)));
1660 uint32_t _flags_save_string
= ndr
->flags
;
1661 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1662 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->UserName
));
1663 ndr
->flags
= _flags_save_string
;
1665 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->Workstation
)));
1666 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->Workstation
)));
1668 uint32_t _flags_save_string
= ndr
->flags
;
1669 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1670 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->Workstation
));
1671 ndr
->flags
= _flags_save_string
;
1673 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->EncryptedRandomSessionKey
->length
));
1674 NDR_CHECK(ndr_push_uint16(ndr
, NDR_SCALARS
, r
->EncryptedRandomSessionKey
->length
));
1675 NDR_CHECK(ndr_push_relative_ptr1(ndr
, r
->EncryptedRandomSessionKey
));
1676 NDR_CHECK(ndr_push_NEGOTIATE(ndr
, NDR_SCALARS
, r
->NegotiateFlags
));
1677 NDR_CHECK(ndr_push_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
));
1678 NDR_CHECK(ndr_push_ntlmssp_Version(ndr
, NDR_SCALARS
, &r
->Version
));
1679 NDR_CHECK(ndr_push_trailer_align(ndr
, 5));
1681 if (ndr_flags
& NDR_BUFFERS
) {
1682 if (r
->LmChallengeResponse
) {
1683 NDR_CHECK(ndr_push_relative_ptr2_start(ndr
, r
->LmChallengeResponse
));
1685 struct ndr_push
*_ndr_LmChallengeResponse
;
1686 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_LmChallengeResponse
, 0, r
->LmChallengeResponseLen
));
1687 NDR_CHECK(ndr_push_set_switch_value(_ndr_LmChallengeResponse
, r
->LmChallengeResponse
, r
->LmChallengeResponseLen
));
1688 NDR_CHECK(ndr_push_ntlmssp_LM_RESPONSE(_ndr_LmChallengeResponse
, NDR_SCALARS
|NDR_BUFFERS
, r
->LmChallengeResponse
));
1689 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_LmChallengeResponse
, 0, r
->LmChallengeResponseLen
));
1691 NDR_CHECK(ndr_push_relative_ptr2_end(ndr
, r
->LmChallengeResponse
));
1693 if (r
->NtChallengeResponse
) {
1694 NDR_CHECK(ndr_push_relative_ptr2_start(ndr
, r
->NtChallengeResponse
));
1696 struct ndr_push
*_ndr_NtChallengeResponse
;
1697 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_NtChallengeResponse
, 0, r
->NtChallengeResponseLen
));
1698 NDR_CHECK(ndr_push_set_switch_value(_ndr_NtChallengeResponse
, r
->NtChallengeResponse
, r
->NtChallengeResponseLen
));
1699 NDR_CHECK(ndr_push_ntlmssp_NTLM_RESPONSE(_ndr_NtChallengeResponse
, NDR_SCALARS
|NDR_BUFFERS
, r
->NtChallengeResponse
));
1700 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_NtChallengeResponse
, 0, r
->NtChallengeResponseLen
));
1702 NDR_CHECK(ndr_push_relative_ptr2_end(ndr
, r
->NtChallengeResponse
));
1705 uint32_t _flags_save_string
= ndr
->flags
;
1706 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1707 if (r
->DomainName
) {
1708 NDR_CHECK(ndr_push_relative_ptr2_start(ndr
, r
->DomainName
));
1710 struct ndr_push
*_ndr_DomainName
;
1711 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_DomainName
, 0, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->DomainName
)));
1712 NDR_CHECK(ndr_push_string(_ndr_DomainName
, NDR_SCALARS
, r
->DomainName
));
1713 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_DomainName
, 0, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->DomainName
)));
1715 NDR_CHECK(ndr_push_relative_ptr2_end(ndr
, r
->DomainName
));
1717 ndr
->flags
= _flags_save_string
;
1720 uint32_t _flags_save_string
= ndr
->flags
;
1721 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1723 NDR_CHECK(ndr_push_relative_ptr2_start(ndr
, r
->UserName
));
1725 struct ndr_push
*_ndr_UserName
;
1726 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_UserName
, 0, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->UserName
)));
1727 NDR_CHECK(ndr_push_string(_ndr_UserName
, NDR_SCALARS
, r
->UserName
));
1728 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_UserName
, 0, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->UserName
)));
1730 NDR_CHECK(ndr_push_relative_ptr2_end(ndr
, r
->UserName
));
1732 ndr
->flags
= _flags_save_string
;
1735 uint32_t _flags_save_string
= ndr
->flags
;
1736 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1737 if (r
->Workstation
) {
1738 NDR_CHECK(ndr_push_relative_ptr2_start(ndr
, r
->Workstation
));
1740 struct ndr_push
*_ndr_Workstation
;
1741 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_Workstation
, 0, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->Workstation
)));
1742 NDR_CHECK(ndr_push_string(_ndr_Workstation
, NDR_SCALARS
, r
->Workstation
));
1743 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_Workstation
, 0, ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->Workstation
)));
1745 NDR_CHECK(ndr_push_relative_ptr2_end(ndr
, r
->Workstation
));
1747 ndr
->flags
= _flags_save_string
;
1749 if (r
->EncryptedRandomSessionKey
) {
1750 NDR_CHECK(ndr_push_relative_ptr2_start(ndr
, r
->EncryptedRandomSessionKey
));
1752 struct ndr_push
*_ndr_EncryptedRandomSessionKey
;
1753 NDR_CHECK(ndr_push_subcontext_start(ndr
, &_ndr_EncryptedRandomSessionKey
, 0, r
->EncryptedRandomSessionKey
->length
));
1754 NDR_CHECK(ndr_push_DATA_BLOB(_ndr_EncryptedRandomSessionKey
, NDR_SCALARS
, *r
->EncryptedRandomSessionKey
));
1755 NDR_CHECK(ndr_push_subcontext_end(ndr
, _ndr_EncryptedRandomSessionKey
, 0, r
->EncryptedRandomSessionKey
->length
));
1757 NDR_CHECK(ndr_push_relative_ptr2_end(ndr
, r
->EncryptedRandomSessionKey
));
1759 NDR_CHECK(ndr_push_ntlmssp_Version(ndr
, NDR_BUFFERS
, &r
->Version
));
1761 ndr
->flags
= _flags_save_STRUCT
;
1763 return NDR_ERR_SUCCESS
;
1766 _PUBLIC_
enum ndr_err_code
ndr_pull_AUTHENTICATE_MESSAGE(struct ndr_pull
*ndr
, int ndr_flags
, struct AUTHENTICATE_MESSAGE
*r
)
1768 uint32_t _ptr_LmChallengeResponse
;
1769 TALLOC_CTX
*_mem_save_LmChallengeResponse_0
;
1770 uint32_t _ptr_NtChallengeResponse
;
1771 TALLOC_CTX
*_mem_save_NtChallengeResponse_0
;
1772 uint32_t _ptr_DomainName
;
1773 TALLOC_CTX
*_mem_save_DomainName_0
;
1774 uint32_t _ptr_UserName
;
1775 TALLOC_CTX
*_mem_save_UserName_0
;
1776 uint32_t _ptr_Workstation
;
1777 TALLOC_CTX
*_mem_save_Workstation_0
;
1778 uint32_t _ptr_EncryptedRandomSessionKey
;
1779 TALLOC_CTX
*_mem_save_EncryptedRandomSessionKey_0
;
1781 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1782 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
1783 if (ndr_flags
& NDR_SCALARS
) {
1784 NDR_CHECK(ndr_pull_align(ndr
, 5));
1785 NDR_CHECK(ndr_pull_charset(ndr
, NDR_SCALARS
, &r
->Signature
, 8, sizeof(uint8_t), CH_DOS
));
1786 NDR_CHECK(ndr_pull_ntlmssp_MessageType(ndr
, NDR_SCALARS
, &r
->MessageType
));
1787 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->LmChallengeResponseLen
));
1788 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->LmChallengeResponseMaxLen
));
1789 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_LmChallengeResponse
));
1790 if (_ptr_LmChallengeResponse
) {
1791 NDR_PULL_ALLOC(ndr
, r
->LmChallengeResponse
);
1792 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->LmChallengeResponse
, _ptr_LmChallengeResponse
));
1794 r
->LmChallengeResponse
= NULL
;
1796 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->NtChallengeResponseLen
));
1797 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->NtChallengeResponseMaxLen
));
1798 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_NtChallengeResponse
));
1799 if (_ptr_NtChallengeResponse
) {
1800 NDR_PULL_ALLOC(ndr
, r
->NtChallengeResponse
);
1801 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->NtChallengeResponse
, _ptr_NtChallengeResponse
));
1803 r
->NtChallengeResponse
= NULL
;
1805 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->DomainNameLen
));
1806 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->DomainNameMaxLen
));
1808 uint32_t _flags_save_string
= ndr
->flags
;
1809 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1810 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_DomainName
));
1811 if (_ptr_DomainName
) {
1812 NDR_PULL_ALLOC(ndr
, r
->DomainName
);
1813 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->DomainName
, _ptr_DomainName
));
1815 r
->DomainName
= NULL
;
1817 ndr
->flags
= _flags_save_string
;
1819 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->UserNameLen
));
1820 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->UserNameMaxLen
));
1822 uint32_t _flags_save_string
= ndr
->flags
;
1823 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1824 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_UserName
));
1825 if (_ptr_UserName
) {
1826 NDR_PULL_ALLOC(ndr
, r
->UserName
);
1827 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->UserName
, _ptr_UserName
));
1831 ndr
->flags
= _flags_save_string
;
1833 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->WorkstationLen
));
1834 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->WorkstationMaxLen
));
1836 uint32_t _flags_save_string
= ndr
->flags
;
1837 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1838 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_Workstation
));
1839 if (_ptr_Workstation
) {
1840 NDR_PULL_ALLOC(ndr
, r
->Workstation
);
1841 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->Workstation
, _ptr_Workstation
));
1843 r
->Workstation
= NULL
;
1845 ndr
->flags
= _flags_save_string
;
1847 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->EncryptedRandomSessionKeyLen
));
1848 NDR_CHECK(ndr_pull_uint16(ndr
, NDR_SCALARS
, &r
->EncryptedRandomSessionKeyMaxLen
));
1849 NDR_CHECK(ndr_pull_generic_ptr(ndr
, &_ptr_EncryptedRandomSessionKey
));
1850 if (_ptr_EncryptedRandomSessionKey
) {
1851 NDR_PULL_ALLOC(ndr
, r
->EncryptedRandomSessionKey
);
1852 NDR_CHECK(ndr_pull_relative_ptr1(ndr
, r
->EncryptedRandomSessionKey
, _ptr_EncryptedRandomSessionKey
));
1854 r
->EncryptedRandomSessionKey
= NULL
;
1856 NDR_CHECK(ndr_pull_NEGOTIATE(ndr
, NDR_SCALARS
, &r
->NegotiateFlags
));
1857 NDR_CHECK(ndr_pull_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
));
1858 NDR_CHECK(ndr_pull_ntlmssp_Version(ndr
, NDR_SCALARS
, &r
->Version
));
1859 NDR_CHECK(ndr_pull_trailer_align(ndr
, 5));
1861 if (ndr_flags
& NDR_BUFFERS
) {
1862 if (r
->LmChallengeResponse
) {
1863 uint32_t _relative_save_offset
;
1864 _relative_save_offset
= ndr
->offset
;
1865 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->LmChallengeResponse
));
1866 _mem_save_LmChallengeResponse_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1867 NDR_PULL_SET_MEM_CTX(ndr
, r
->LmChallengeResponse
, 0);
1869 struct ndr_pull
*_ndr_LmChallengeResponse
;
1870 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_LmChallengeResponse
, 0, r
->LmChallengeResponseLen
));
1871 NDR_CHECK(ndr_pull_set_switch_value(_ndr_LmChallengeResponse
, r
->LmChallengeResponse
, r
->LmChallengeResponseLen
));
1872 NDR_CHECK(ndr_pull_ntlmssp_LM_RESPONSE(_ndr_LmChallengeResponse
, NDR_SCALARS
|NDR_BUFFERS
, r
->LmChallengeResponse
));
1873 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_LmChallengeResponse
, 0, r
->LmChallengeResponseLen
));
1875 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_LmChallengeResponse_0
, 0);
1876 if (ndr
->offset
> ndr
->relative_highest_offset
) {
1877 ndr
->relative_highest_offset
= ndr
->offset
;
1879 ndr
->offset
= _relative_save_offset
;
1881 if (r
->NtChallengeResponse
) {
1882 uint32_t _relative_save_offset
;
1883 _relative_save_offset
= ndr
->offset
;
1884 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->NtChallengeResponse
));
1885 _mem_save_NtChallengeResponse_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1886 NDR_PULL_SET_MEM_CTX(ndr
, r
->NtChallengeResponse
, 0);
1888 struct ndr_pull
*_ndr_NtChallengeResponse
;
1889 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_NtChallengeResponse
, 0, r
->NtChallengeResponseMaxLen
));
1890 NDR_CHECK(ndr_pull_set_switch_value(_ndr_NtChallengeResponse
, r
->NtChallengeResponse
, r
->NtChallengeResponseLen
));
1891 NDR_CHECK(ndr_pull_ntlmssp_NTLM_RESPONSE(_ndr_NtChallengeResponse
, NDR_SCALARS
|NDR_BUFFERS
, r
->NtChallengeResponse
));
1892 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_NtChallengeResponse
, 0, r
->NtChallengeResponseMaxLen
));
1894 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_NtChallengeResponse_0
, 0);
1895 if (ndr
->offset
> ndr
->relative_highest_offset
) {
1896 ndr
->relative_highest_offset
= ndr
->offset
;
1898 ndr
->offset
= _relative_save_offset
;
1901 uint32_t _flags_save_string
= ndr
->flags
;
1902 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1903 if (r
->DomainName
) {
1904 uint32_t _relative_save_offset
;
1905 _relative_save_offset
= ndr
->offset
;
1906 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->DomainName
));
1907 _mem_save_DomainName_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1908 NDR_PULL_SET_MEM_CTX(ndr
, r
->DomainName
, 0);
1910 struct ndr_pull
*_ndr_DomainName
;
1911 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_DomainName
, 0, r
->DomainNameLen
));
1912 NDR_CHECK(ndr_pull_string(_ndr_DomainName
, NDR_SCALARS
, &r
->DomainName
));
1913 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_DomainName
, 0, r
->DomainNameLen
));
1915 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_DomainName_0
, 0);
1916 if (ndr
->offset
> ndr
->relative_highest_offset
) {
1917 ndr
->relative_highest_offset
= ndr
->offset
;
1919 ndr
->offset
= _relative_save_offset
;
1921 ndr
->flags
= _flags_save_string
;
1924 uint32_t _flags_save_string
= ndr
->flags
;
1925 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1927 uint32_t _relative_save_offset
;
1928 _relative_save_offset
= ndr
->offset
;
1929 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->UserName
));
1930 _mem_save_UserName_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1931 NDR_PULL_SET_MEM_CTX(ndr
, r
->UserName
, 0);
1933 struct ndr_pull
*_ndr_UserName
;
1934 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_UserName
, 0, r
->UserNameLen
));
1935 NDR_CHECK(ndr_pull_string(_ndr_UserName
, NDR_SCALARS
, &r
->UserName
));
1936 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_UserName
, 0, r
->UserNameLen
));
1938 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_UserName_0
, 0);
1939 if (ndr
->offset
> ndr
->relative_highest_offset
) {
1940 ndr
->relative_highest_offset
= ndr
->offset
;
1942 ndr
->offset
= _relative_save_offset
;
1944 ndr
->flags
= _flags_save_string
;
1947 uint32_t _flags_save_string
= ndr
->flags
;
1948 ndr_set_flags(&ndr
->flags
, ndr_ntlmssp_negotiated_string_flags(r
->NegotiateFlags
));
1949 if (r
->Workstation
) {
1950 uint32_t _relative_save_offset
;
1951 _relative_save_offset
= ndr
->offset
;
1952 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->Workstation
));
1953 _mem_save_Workstation_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1954 NDR_PULL_SET_MEM_CTX(ndr
, r
->Workstation
, 0);
1956 struct ndr_pull
*_ndr_Workstation
;
1957 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_Workstation
, 0, r
->WorkstationLen
));
1958 NDR_CHECK(ndr_pull_string(_ndr_Workstation
, NDR_SCALARS
, &r
->Workstation
));
1959 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_Workstation
, 0, r
->WorkstationLen
));
1961 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_Workstation_0
, 0);
1962 if (ndr
->offset
> ndr
->relative_highest_offset
) {
1963 ndr
->relative_highest_offset
= ndr
->offset
;
1965 ndr
->offset
= _relative_save_offset
;
1967 ndr
->flags
= _flags_save_string
;
1969 if (r
->EncryptedRandomSessionKey
) {
1970 uint32_t _relative_save_offset
;
1971 _relative_save_offset
= ndr
->offset
;
1972 NDR_CHECK(ndr_pull_relative_ptr2(ndr
, r
->EncryptedRandomSessionKey
));
1973 _mem_save_EncryptedRandomSessionKey_0
= NDR_PULL_GET_MEM_CTX(ndr
);
1974 NDR_PULL_SET_MEM_CTX(ndr
, r
->EncryptedRandomSessionKey
, 0);
1976 struct ndr_pull
*_ndr_EncryptedRandomSessionKey
;
1977 NDR_CHECK(ndr_pull_subcontext_start(ndr
, &_ndr_EncryptedRandomSessionKey
, 0, r
->EncryptedRandomSessionKeyLen
));
1978 NDR_CHECK(ndr_pull_DATA_BLOB(_ndr_EncryptedRandomSessionKey
, NDR_SCALARS
, r
->EncryptedRandomSessionKey
));
1979 NDR_CHECK(ndr_pull_subcontext_end(ndr
, _ndr_EncryptedRandomSessionKey
, 0, r
->EncryptedRandomSessionKeyLen
));
1981 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_EncryptedRandomSessionKey_0
, 0);
1982 if (ndr
->offset
> ndr
->relative_highest_offset
) {
1983 ndr
->relative_highest_offset
= ndr
->offset
;
1985 ndr
->offset
= _relative_save_offset
;
1987 NDR_CHECK(ndr_pull_ntlmssp_Version(ndr
, NDR_BUFFERS
, &r
->Version
));
1989 ndr
->flags
= _flags_save_STRUCT
;
1991 return NDR_ERR_SUCCESS
;
1994 _PUBLIC_
void ndr_print_AUTHENTICATE_MESSAGE(struct ndr_print
*ndr
, const char *name
, const struct AUTHENTICATE_MESSAGE
*r
)
1996 ndr_print_struct(ndr
, name
, "AUTHENTICATE_MESSAGE");
1998 uint32_t _flags_save_STRUCT
= ndr
->flags
;
1999 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_REMAINING
);
2001 ndr_print_string(ndr
, "Signature", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?"NTLMSSP":r
->Signature
);
2002 ndr_print_ntlmssp_MessageType(ndr
, "MessageType", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?NtLmAuthenticate
:r
->MessageType
);
2003 ndr_print_uint16(ndr
, "LmChallengeResponseLen", r
->LmChallengeResponseLen
);
2004 ndr_print_uint16(ndr
, "LmChallengeResponseMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->LmChallengeResponseLen
:r
->LmChallengeResponseMaxLen
);
2005 ndr_print_ptr(ndr
, "LmChallengeResponse", r
->LmChallengeResponse
);
2007 if (r
->LmChallengeResponse
) {
2008 ndr_print_set_switch_value(ndr
, r
->LmChallengeResponse
, r
->LmChallengeResponseLen
);
2009 ndr_print_ntlmssp_LM_RESPONSE(ndr
, "LmChallengeResponse", r
->LmChallengeResponse
);
2012 ndr_print_uint16(ndr
, "NtChallengeResponseLen", r
->NtChallengeResponseLen
);
2013 ndr_print_uint16(ndr
, "NtChallengeResponseMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->NtChallengeResponseLen
:r
->NtChallengeResponseMaxLen
);
2014 ndr_print_ptr(ndr
, "NtChallengeResponse", r
->NtChallengeResponse
);
2016 if (r
->NtChallengeResponse
) {
2017 ndr_print_set_switch_value(ndr
, r
->NtChallengeResponse
, r
->NtChallengeResponseLen
);
2018 ndr_print_ntlmssp_NTLM_RESPONSE(ndr
, "NtChallengeResponse", r
->NtChallengeResponse
);
2021 ndr_print_uint16(ndr
, "DomainNameLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->DomainName
):r
->DomainNameLen
);
2022 ndr_print_uint16(ndr
, "DomainNameMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->DomainNameLen
:r
->DomainNameMaxLen
);
2023 ndr_print_ptr(ndr
, "DomainName", r
->DomainName
);
2025 if (r
->DomainName
) {
2026 ndr_print_string(ndr
, "DomainName", r
->DomainName
);
2029 ndr_print_uint16(ndr
, "UserNameLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->UserName
):r
->UserNameLen
);
2030 ndr_print_uint16(ndr
, "UserNameMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->UserNameLen
:r
->UserNameMaxLen
);
2031 ndr_print_ptr(ndr
, "UserName", r
->UserName
);
2034 ndr_print_string(ndr
, "UserName", r
->UserName
);
2037 ndr_print_uint16(ndr
, "WorkstationLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?ndr_ntlmssp_string_length(r
->NegotiateFlags
, r
->Workstation
):r
->WorkstationLen
);
2038 ndr_print_uint16(ndr
, "WorkstationMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->WorkstationLen
:r
->WorkstationMaxLen
);
2039 ndr_print_ptr(ndr
, "Workstation", r
->Workstation
);
2041 if (r
->Workstation
) {
2042 ndr_print_string(ndr
, "Workstation", r
->Workstation
);
2045 ndr_print_uint16(ndr
, "EncryptedRandomSessionKeyLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->EncryptedRandomSessionKey
->length
:r
->EncryptedRandomSessionKeyLen
);
2046 ndr_print_uint16(ndr
, "EncryptedRandomSessionKeyMaxLen", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?r
->EncryptedRandomSessionKeyLen
:r
->EncryptedRandomSessionKeyMaxLen
);
2047 ndr_print_ptr(ndr
, "EncryptedRandomSessionKey", r
->EncryptedRandomSessionKey
);
2049 if (r
->EncryptedRandomSessionKey
) {
2050 ndr_print_DATA_BLOB(ndr
, "EncryptedRandomSessionKey", *r
->EncryptedRandomSessionKey
);
2053 ndr_print_NEGOTIATE(ndr
, "NegotiateFlags", r
->NegotiateFlags
);
2054 ndr_print_set_switch_value(ndr
, &r
->Version
, r
->NegotiateFlags
& NTLMSSP_NEGOTIATE_VERSION
);
2055 ndr_print_ntlmssp_Version(ndr
, "Version", &r
->Version
);
2057 ndr
->flags
= _flags_save_STRUCT
;
2061 _PUBLIC_
enum ndr_err_code
ndr_push_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_push
*ndr
, int ndr_flags
, const struct NTLMSSP_MESSAGE_SIGNATURE
*r
)
2063 if (ndr_flags
& NDR_SCALARS
) {
2064 NDR_CHECK(ndr_push_align(ndr
, 4));
2065 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, NTLMSSP_SIGN_VERSION
));
2066 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->RandomPad
));
2067 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->Checksum
));
2068 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SeqNum
));
2069 NDR_CHECK(ndr_push_trailer_align(ndr
, 4));
2071 if (ndr_flags
& NDR_BUFFERS
) {
2073 return NDR_ERR_SUCCESS
;
2076 _PUBLIC_
enum ndr_err_code
ndr_pull_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_pull
*ndr
, int ndr_flags
, struct NTLMSSP_MESSAGE_SIGNATURE
*r
)
2078 if (ndr_flags
& NDR_SCALARS
) {
2079 NDR_CHECK(ndr_pull_align(ndr
, 4));
2080 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->Version
));
2081 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->RandomPad
));
2082 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->Checksum
));
2083 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SeqNum
));
2084 NDR_CHECK(ndr_pull_trailer_align(ndr
, 4));
2086 if (ndr_flags
& NDR_BUFFERS
) {
2088 return NDR_ERR_SUCCESS
;
2091 _PUBLIC_
void ndr_print_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_print
*ndr
, const char *name
, const struct NTLMSSP_MESSAGE_SIGNATURE
*r
)
2093 ndr_print_struct(ndr
, name
, "NTLMSSP_MESSAGE_SIGNATURE");
2095 ndr_print_uint32(ndr
, "Version", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?NTLMSSP_SIGN_VERSION
:r
->Version
);
2096 ndr_print_uint32(ndr
, "RandomPad", r
->RandomPad
);
2097 ndr_print_uint32(ndr
, "Checksum", r
->Checksum
);
2098 ndr_print_uint32(ndr
, "SeqNum", r
->SeqNum
);
2102 _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
)
2105 uint32_t _flags_save_STRUCT
= ndr
->flags
;
2106 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2107 if (ndr_flags
& NDR_SCALARS
) {
2108 NDR_CHECK(ndr_push_align(ndr
, 4));
2109 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, NTLMSSP_SIGN_VERSION
));
2110 NDR_CHECK(ndr_push_array_uint8(ndr
, NDR_SCALARS
, r
->Checksum
, 8));
2111 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->SeqNum
));
2112 NDR_CHECK(ndr_push_trailer_align(ndr
, 4));
2114 if (ndr_flags
& NDR_BUFFERS
) {
2116 ndr
->flags
= _flags_save_STRUCT
;
2118 return NDR_ERR_SUCCESS
;
2121 _PUBLIC_
enum ndr_err_code
ndr_pull_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_pull
*ndr
, int ndr_flags
, struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2
*r
)
2124 uint32_t _flags_save_STRUCT
= ndr
->flags
;
2125 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2126 if (ndr_flags
& NDR_SCALARS
) {
2127 NDR_CHECK(ndr_pull_align(ndr
, 4));
2128 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->Version
));
2129 NDR_CHECK(ndr_pull_array_uint8(ndr
, NDR_SCALARS
, r
->Checksum
, 8));
2130 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->SeqNum
));
2131 NDR_CHECK(ndr_pull_trailer_align(ndr
, 4));
2133 if (ndr_flags
& NDR_BUFFERS
) {
2135 ndr
->flags
= _flags_save_STRUCT
;
2137 return NDR_ERR_SUCCESS
;
2140 _PUBLIC_
void ndr_print_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_print
*ndr
, const char *name
, const struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2
*r
)
2142 ndr_print_struct(ndr
, name
, "NTLMSSP_MESSAGE_SIGNATURE_NTLMv2");
2144 uint32_t _flags_save_STRUCT
= ndr
->flags
;
2145 ndr_set_flags(&ndr
->flags
, LIBNDR_PRINT_ARRAY_HEX
);
2147 ndr_print_uint32(ndr
, "Version", (ndr
->flags
& LIBNDR_PRINT_SET_VALUES
)?NTLMSSP_SIGN_VERSION
:r
->Version
);
2148 ndr_print_array_uint8(ndr
, "Checksum", r
->Checksum
, 8);
2149 ndr_print_uint32(ndr
, "SeqNum", r
->SeqNum
);
2151 ndr
->flags
= _flags_save_STRUCT
;
2155 static enum ndr_err_code
ndr_push_decode_NEGOTIATE_MESSAGE(struct ndr_push
*ndr
, int flags
, const struct decode_NEGOTIATE_MESSAGE
*r
)
2157 if (flags
& NDR_IN
) {
2158 NDR_CHECK(ndr_push_NEGOTIATE_MESSAGE(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.negotiate
));
2160 if (flags
& NDR_OUT
) {
2162 return NDR_ERR_SUCCESS
;
2165 static enum ndr_err_code
ndr_pull_decode_NEGOTIATE_MESSAGE(struct ndr_pull
*ndr
, int flags
, struct decode_NEGOTIATE_MESSAGE
*r
)
2167 if (flags
& NDR_IN
) {
2168 NDR_CHECK(ndr_pull_NEGOTIATE_MESSAGE(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.negotiate
));
2170 if (flags
& NDR_OUT
) {
2172 return NDR_ERR_SUCCESS
;
2175 _PUBLIC_
void ndr_print_decode_NEGOTIATE_MESSAGE(struct ndr_print
*ndr
, const char *name
, int flags
, const struct decode_NEGOTIATE_MESSAGE
*r
)
2177 ndr_print_struct(ndr
, name
, "decode_NEGOTIATE_MESSAGE");
2179 if (flags
& NDR_SET_VALUES
) {
2180 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
2182 if (flags
& NDR_IN
) {
2183 ndr_print_struct(ndr
, "in", "decode_NEGOTIATE_MESSAGE");
2185 ndr_print_NEGOTIATE_MESSAGE(ndr
, "negotiate", &r
->in
.negotiate
);
2188 if (flags
& NDR_OUT
) {
2189 ndr_print_struct(ndr
, "out", "decode_NEGOTIATE_MESSAGE");
2196 static enum ndr_err_code
ndr_push_decode_CHALLENGE_MESSAGE(struct ndr_push
*ndr
, int flags
, const struct decode_CHALLENGE_MESSAGE
*r
)
2198 if (flags
& NDR_IN
) {
2199 NDR_CHECK(ndr_push_CHALLENGE_MESSAGE(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.challenge
));
2201 if (flags
& NDR_OUT
) {
2203 return NDR_ERR_SUCCESS
;
2206 static enum ndr_err_code
ndr_pull_decode_CHALLENGE_MESSAGE(struct ndr_pull
*ndr
, int flags
, struct decode_CHALLENGE_MESSAGE
*r
)
2208 if (flags
& NDR_IN
) {
2209 NDR_CHECK(ndr_pull_CHALLENGE_MESSAGE(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.challenge
));
2211 if (flags
& NDR_OUT
) {
2213 return NDR_ERR_SUCCESS
;
2216 _PUBLIC_
void ndr_print_decode_CHALLENGE_MESSAGE(struct ndr_print
*ndr
, const char *name
, int flags
, const struct decode_CHALLENGE_MESSAGE
*r
)
2218 ndr_print_struct(ndr
, name
, "decode_CHALLENGE_MESSAGE");
2220 if (flags
& NDR_SET_VALUES
) {
2221 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
2223 if (flags
& NDR_IN
) {
2224 ndr_print_struct(ndr
, "in", "decode_CHALLENGE_MESSAGE");
2226 ndr_print_CHALLENGE_MESSAGE(ndr
, "challenge", &r
->in
.challenge
);
2229 if (flags
& NDR_OUT
) {
2230 ndr_print_struct(ndr
, "out", "decode_CHALLENGE_MESSAGE");
2237 static enum ndr_err_code
ndr_push_decode_AUTHENTICATE_MESSAGE(struct ndr_push
*ndr
, int flags
, const struct decode_AUTHENTICATE_MESSAGE
*r
)
2239 if (flags
& NDR_IN
) {
2240 NDR_CHECK(ndr_push_AUTHENTICATE_MESSAGE(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.authenticate
));
2242 if (flags
& NDR_OUT
) {
2244 return NDR_ERR_SUCCESS
;
2247 static enum ndr_err_code
ndr_pull_decode_AUTHENTICATE_MESSAGE(struct ndr_pull
*ndr
, int flags
, struct decode_AUTHENTICATE_MESSAGE
*r
)
2249 if (flags
& NDR_IN
) {
2250 NDR_CHECK(ndr_pull_AUTHENTICATE_MESSAGE(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.authenticate
));
2252 if (flags
& NDR_OUT
) {
2254 return NDR_ERR_SUCCESS
;
2257 _PUBLIC_
void ndr_print_decode_AUTHENTICATE_MESSAGE(struct ndr_print
*ndr
, const char *name
, int flags
, const struct decode_AUTHENTICATE_MESSAGE
*r
)
2259 ndr_print_struct(ndr
, name
, "decode_AUTHENTICATE_MESSAGE");
2261 if (flags
& NDR_SET_VALUES
) {
2262 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
2264 if (flags
& NDR_IN
) {
2265 ndr_print_struct(ndr
, "in", "decode_AUTHENTICATE_MESSAGE");
2267 ndr_print_AUTHENTICATE_MESSAGE(ndr
, "authenticate", &r
->in
.authenticate
);
2270 if (flags
& NDR_OUT
) {
2271 ndr_print_struct(ndr
, "out", "decode_AUTHENTICATE_MESSAGE");
2278 static enum ndr_err_code
ndr_push_decode_NTLMv2_CLIENT_CHALLENGE(struct ndr_push
*ndr
, int flags
, const struct decode_NTLMv2_CLIENT_CHALLENGE
*r
)
2280 if (flags
& NDR_IN
) {
2281 NDR_CHECK(ndr_push_NTLMv2_CLIENT_CHALLENGE(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.challenge
));
2283 if (flags
& NDR_OUT
) {
2285 return NDR_ERR_SUCCESS
;
2288 static enum ndr_err_code
ndr_pull_decode_NTLMv2_CLIENT_CHALLENGE(struct ndr_pull
*ndr
, int flags
, struct decode_NTLMv2_CLIENT_CHALLENGE
*r
)
2290 if (flags
& NDR_IN
) {
2291 NDR_CHECK(ndr_pull_NTLMv2_CLIENT_CHALLENGE(ndr
, NDR_SCALARS
|NDR_BUFFERS
, &r
->in
.challenge
));
2293 if (flags
& NDR_OUT
) {
2295 return NDR_ERR_SUCCESS
;
2298 _PUBLIC_
void ndr_print_decode_NTLMv2_CLIENT_CHALLENGE(struct ndr_print
*ndr
, const char *name
, int flags
, const struct decode_NTLMv2_CLIENT_CHALLENGE
*r
)
2300 ndr_print_struct(ndr
, name
, "decode_NTLMv2_CLIENT_CHALLENGE");
2302 if (flags
& NDR_SET_VALUES
) {
2303 ndr
->flags
|= LIBNDR_PRINT_SET_VALUES
;
2305 if (flags
& NDR_IN
) {
2306 ndr_print_struct(ndr
, "in", "decode_NTLMv2_CLIENT_CHALLENGE");
2308 ndr_print_NTLMv2_CLIENT_CHALLENGE(ndr
, "challenge", &r
->in
.challenge
);
2311 if (flags
& NDR_OUT
) {
2312 ndr_print_struct(ndr
, "out", "decode_NTLMv2_CLIENT_CHALLENGE");
2319 static const struct ndr_interface_call ntlmssp_calls
[] = {
2321 "decode_NEGOTIATE_MESSAGE",
2322 sizeof(struct decode_NEGOTIATE_MESSAGE
),
2323 (ndr_push_flags_fn_t
) ndr_push_decode_NEGOTIATE_MESSAGE
,
2324 (ndr_pull_flags_fn_t
) ndr_pull_decode_NEGOTIATE_MESSAGE
,
2325 (ndr_print_function_t
) ndr_print_decode_NEGOTIATE_MESSAGE
,
2329 "decode_CHALLENGE_MESSAGE",
2330 sizeof(struct decode_CHALLENGE_MESSAGE
),
2331 (ndr_push_flags_fn_t
) ndr_push_decode_CHALLENGE_MESSAGE
,
2332 (ndr_pull_flags_fn_t
) ndr_pull_decode_CHALLENGE_MESSAGE
,
2333 (ndr_print_function_t
) ndr_print_decode_CHALLENGE_MESSAGE
,
2337 "decode_AUTHENTICATE_MESSAGE",
2338 sizeof(struct decode_AUTHENTICATE_MESSAGE
),
2339 (ndr_push_flags_fn_t
) ndr_push_decode_AUTHENTICATE_MESSAGE
,
2340 (ndr_pull_flags_fn_t
) ndr_pull_decode_AUTHENTICATE_MESSAGE
,
2341 (ndr_print_function_t
) ndr_print_decode_AUTHENTICATE_MESSAGE
,
2345 "decode_NTLMv2_CLIENT_CHALLENGE",
2346 sizeof(struct decode_NTLMv2_CLIENT_CHALLENGE
),
2347 (ndr_push_flags_fn_t
) ndr_push_decode_NTLMv2_CLIENT_CHALLENGE
,
2348 (ndr_pull_flags_fn_t
) ndr_pull_decode_NTLMv2_CLIENT_CHALLENGE
,
2349 (ndr_print_function_t
) ndr_print_decode_NTLMv2_CLIENT_CHALLENGE
,
2352 { NULL
, 0, NULL
, NULL
, NULL
, false }
2355 static const char * const ntlmssp_endpoint_strings
[] = {
2356 "ncacn_np:[\\pipe\\ntlmssp]",
2359 static const struct ndr_interface_string_array ntlmssp_endpoints
= {
2361 .names
= ntlmssp_endpoint_strings
2364 static const char * const ntlmssp_authservice_strings
[] = {
2368 static const struct ndr_interface_string_array ntlmssp_authservices
= {
2370 .names
= ntlmssp_authservice_strings
2374 const struct ndr_interface_table ndr_table_ntlmssp
= {
2377 {0x6e746c6d,0x7373,0x700a,{0x00,0x00},{0x00,0x00,0x00,0x00}},
2380 .helpstring
= NDR_NTLMSSP_HELPSTRING
,
2382 .calls
= ntlmssp_calls
,
2383 .endpoints
= &ntlmssp_endpoints
,
2384 .authservices
= &ntlmssp_authservices