2 * Unix SMB/CIFS implementation.
3 * RPC Pipe client / server routines
4 * Copyright (C) Andrew Tridgell 1992-1997,
5 * Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
6 * Copyright (C) Paul Ashton 1997.
7 * Copyright (C) Jeremy Allison 1999.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 #define DBGC_CLASS DBGC_RPC_PARSE
29 /*******************************************************************
30 interface/version dce/rpc pipe identification
31 ********************************************************************/
33 #define TRANS_SYNT_V2 \
36 0x8a885d04, 0x1ceb, 0x11c9, \
39 0x2b, 0x10, 0x48, 0x60 } \
43 #define SYNT_NETLOGON_V2 \
46 0x8a885d04, 0x1ceb, 0x11c9, \
49 0x2b, 0x10, 0x48, 0x60 } \
53 #define SYNT_WKSSVC_V1 \
56 0x6bffd098, 0xa112, 0x3610, \
59 0xf8, 0x7e, 0x34, 0x5a } \
63 #define SYNT_SRVSVC_V3 \
66 0x4b324fc8, 0x1670, 0x01d3, \
69 0xbf, 0x6e, 0xe1, 0x88 } \
73 #define SYNT_LSARPC_V0 \
76 0x12345778, 0x1234, 0xabcd, \
79 0x45, 0x67, 0x89, 0xab } \
83 #define SYNT_LSARPC_V0_DS \
86 0x3919286a, 0xb10c, 0x11d0, \
89 0x4f, 0xd9, 0x2e, 0xf5 } \
93 #define SYNT_SAMR_V1 \
96 0x12345778, 0x1234, 0xabcd, \
99 0x45, 0x67, 0x89, 0xac } \
103 #define SYNT_NETLOGON_V1 \
106 0x12345678, 0x1234, 0xabcd, \
109 0x45, 0x67, 0xcf, 0xfb } \
113 #define SYNT_WINREG_V1 \
116 0x338cd001, 0x2244, 0x31f1, \
119 0x38, 0x00, 0x10, 0x03 } \
123 #define SYNT_SPOOLSS_V1 \
126 0x12345678, 0x1234, 0xabcd, \
129 0x45, 0x67, 0x89, 0xab } \
133 #define SYNT_NONE_V0 \
139 0x00, 0x00, 0x00, 0x00 } \
143 #define SYNT_NETDFS_V3 \
146 0x4fc742e0, 0x4a10, 0x11cf, \
149 0x00, 0x4a, 0xe6, 0x73 } \
153 #define SYNT_ECHO_V1 \
156 0x60a15ec5, 0x4de8, 0x11d7, \
159 0x56, 0xa2, 0x01, 0x82 } \
163 #define SYNT_SHUTDOWN_V1 \
166 0x894de0c0, 0x0d55, 0x11d3, \
169 0x4f, 0xa3, 0x21, 0xa1 } \
173 #define SYNT_SVCCTL_V2 \
176 0x367abb81, 0x9844, 0x35f1, \
179 0x38, 0x00, 0x10, 0x03 } \
184 #define SYNT_EVENTLOG_V0 \
187 0x82273fdc, 0xe32a, 0x18c3, \
190 0x29, 0xdc, 0x23, 0xea } \
194 #define SYNT_UNIXINFO_V0 \
197 0x9c54e310, 0xa955, 0x4885, \
200 0x71, 0x47, 0xdf, 0xa6 } \
204 #define SYNT_NTSVCS_V1 \
207 0x8d9f4e40, 0xa03d, 0x11ce, \
210 0x3e, 0x30, 0x05, 0x1b } \
215 * IMPORTANT!! If you update this structure, make sure to
216 * update the index #defines in smb.h.
219 const struct pipe_id_info pipe_names
[] =
221 /* client pipe , abstract syntax , server pipe , transfer syntax */
222 { PIPE_LSARPC
, SYNT_LSARPC_V0
, PIPE_LSASS
, TRANS_SYNT_V2
},
223 { PIPE_LSARPC
, SYNT_LSARPC_V0_DS
, PIPE_LSASS
, TRANS_SYNT_V2
},
224 { PIPE_SAMR
, SYNT_SAMR_V1
, PIPE_LSASS
, TRANS_SYNT_V2
},
225 { PIPE_NETLOGON
, SYNT_NETLOGON_V1
, PIPE_LSASS
, TRANS_SYNT_V2
},
226 { PIPE_SRVSVC
, SYNT_SRVSVC_V3
, PIPE_NTSVCS
, TRANS_SYNT_V2
},
227 { PIPE_WKSSVC
, SYNT_WKSSVC_V1
, PIPE_NTSVCS
, TRANS_SYNT_V2
},
228 { PIPE_WINREG
, SYNT_WINREG_V1
, PIPE_WINREG
, TRANS_SYNT_V2
},
229 { PIPE_SPOOLSS
, SYNT_SPOOLSS_V1
, PIPE_SPOOLSS
, TRANS_SYNT_V2
},
230 { PIPE_NETDFS
, SYNT_NETDFS_V3
, PIPE_NETDFS
, TRANS_SYNT_V2
},
231 { PIPE_ECHO
, SYNT_ECHO_V1
, PIPE_ECHO
, TRANS_SYNT_V2
},
232 { PIPE_SHUTDOWN
, SYNT_SHUTDOWN_V1
, PIPE_SHUTDOWN
, TRANS_SYNT_V2
},
233 { PIPE_SVCCTL
, SYNT_SVCCTL_V2
, PIPE_NTSVCS
, TRANS_SYNT_V2
},
234 { PIPE_EVENTLOG
, SYNT_EVENTLOG_V0
, PIPE_EVENTLOG
, TRANS_SYNT_V2
},
235 { PIPE_UNIXINFO
, SYNT_UNIXINFO_V0
, PIPE_UNIXINFO
, TRANS_SYNT_V2
},
236 { PIPE_NTSVCS
, SYNT_NTSVCS_V1
, PIPE_NTSVCS
, TRANS_SYNT_V2
},
237 { NULL
, SYNT_NONE_V0
, NULL
, SYNT_NONE_V0
}
240 /****************************************************************************
241 Return the pipe name from the index.
242 ****************************************************************************/
244 const char *cli_get_pipe_name(int pipe_idx
)
246 return &pipe_names
[pipe_idx
].client_pipe
[5];
249 /*******************************************************************
250 Inits an RPC_HDR structure.
251 ********************************************************************/
253 void init_rpc_hdr(RPC_HDR
*hdr
, enum RPC_PKT_TYPE pkt_type
, uint8 flags
,
254 uint32 call_id
, int data_len
, int auth_len
)
256 hdr
->major
= 5; /* RPC version 5 */
257 hdr
->minor
= 0; /* minor version 0 */
258 hdr
->pkt_type
= pkt_type
; /* RPC packet type */
259 hdr
->flags
= flags
; /* dce/rpc flags */
260 hdr
->pack_type
[0] = 0x10; /* little-endian data representation */
261 hdr
->pack_type
[1] = 0; /* packed data representation */
262 hdr
->pack_type
[2] = 0; /* packed data representation */
263 hdr
->pack_type
[3] = 0; /* packed data representation */
264 hdr
->frag_len
= data_len
; /* fragment length, fill in later */
265 hdr
->auth_len
= auth_len
; /* authentication length */
266 hdr
->call_id
= call_id
; /* call identifier - match incoming RPC */
269 /*******************************************************************
270 Reads or writes an RPC_HDR structure.
271 ********************************************************************/
273 BOOL
smb_io_rpc_hdr(const char *desc
, RPC_HDR
*rpc
, prs_struct
*ps
, int depth
)
278 prs_debug(ps
, depth
, desc
, "smb_io_rpc_hdr");
281 if(!prs_uint8 ("major ", ps
, depth
, &rpc
->major
))
284 if(!prs_uint8 ("minor ", ps
, depth
, &rpc
->minor
))
286 if(!prs_uint8 ("pkt_type ", ps
, depth
, &rpc
->pkt_type
))
288 if(!prs_uint8 ("flags ", ps
, depth
, &rpc
->flags
))
291 /* We always marshall in little endian format. */
293 rpc
->pack_type
[0] = 0x10;
295 if(!prs_uint8("pack_type0", ps
, depth
, &rpc
->pack_type
[0]))
297 if(!prs_uint8("pack_type1", ps
, depth
, &rpc
->pack_type
[1]))
299 if(!prs_uint8("pack_type2", ps
, depth
, &rpc
->pack_type
[2]))
301 if(!prs_uint8("pack_type3", ps
, depth
, &rpc
->pack_type
[3]))
305 * If reading and pack_type[0] == 0 then the data is in big-endian
306 * format. Set the flag in the prs_struct to specify reverse-endainness.
309 if (UNMARSHALLING(ps
) && rpc
->pack_type
[0] == 0) {
310 DEBUG(10,("smb_io_rpc_hdr: PDU data format is big-endian. Setting flag.\n"));
311 prs_set_endian_data(ps
, RPC_BIG_ENDIAN
);
314 if(!prs_uint16("frag_len ", ps
, depth
, &rpc
->frag_len
))
316 if(!prs_uint16("auth_len ", ps
, depth
, &rpc
->auth_len
))
318 if(!prs_uint32("call_id ", ps
, depth
, &rpc
->call_id
))
323 /*******************************************************************
324 Reads or writes an RPC_IFACE structure.
325 ********************************************************************/
327 static BOOL
smb_io_rpc_iface(const char *desc
, RPC_IFACE
*ifc
, prs_struct
*ps
, int depth
)
332 prs_debug(ps
, depth
, desc
, "smb_io_rpc_iface");
338 if (!smb_io_uuid( "uuid", &ifc
->uuid
, ps
, depth
))
341 if(!prs_uint32 ("version", ps
, depth
, &ifc
->version
))
347 /*******************************************************************
348 Inits an RPC_ADDR_STR structure.
349 ********************************************************************/
351 static void init_rpc_addr_str(RPC_ADDR_STR
*str
, const char *name
)
353 str
->len
= strlen(name
) + 1;
354 fstrcpy(str
->str
, name
);
357 /*******************************************************************
358 Reads or writes an RPC_ADDR_STR structure.
359 ********************************************************************/
361 static BOOL
smb_io_rpc_addr_str(const char *desc
, RPC_ADDR_STR
*str
, prs_struct
*ps
, int depth
)
366 prs_debug(ps
, depth
, desc
, "smb_io_rpc_addr_str");
371 if(!prs_uint16 ( "len", ps
, depth
, &str
->len
))
373 if(!prs_uint8s (True
, "str", ps
, depth
, (uchar
*)str
->str
, MIN(str
->len
, sizeof(str
->str
)) ))
378 /*******************************************************************
379 Inits an RPC_HDR_BBA structure.
380 ********************************************************************/
382 static void init_rpc_hdr_bba(RPC_HDR_BBA
*bba
, uint16 max_tsize
, uint16 max_rsize
, uint32 assoc_gid
)
384 bba
->max_tsize
= max_tsize
; /* maximum transmission fragment size (0x1630) */
385 bba
->max_rsize
= max_rsize
; /* max receive fragment size (0x1630) */
386 bba
->assoc_gid
= assoc_gid
; /* associated group id (0x0) */
389 /*******************************************************************
390 Reads or writes an RPC_HDR_BBA structure.
391 ********************************************************************/
393 static BOOL
smb_io_rpc_hdr_bba(const char *desc
, RPC_HDR_BBA
*rpc
, prs_struct
*ps
, int depth
)
398 prs_debug(ps
, depth
, desc
, "smb_io_rpc_hdr_bba");
401 if(!prs_uint16("max_tsize", ps
, depth
, &rpc
->max_tsize
))
403 if(!prs_uint16("max_rsize", ps
, depth
, &rpc
->max_rsize
))
405 if(!prs_uint32("assoc_gid", ps
, depth
, &rpc
->assoc_gid
))
410 /*******************************************************************
411 Inits an RPC_CONTEXT structure.
412 Note the transfer pointer must remain valid until this is marshalled.
413 ********************************************************************/
415 void init_rpc_context(RPC_CONTEXT
*rpc_ctx
, uint16 context_id
, RPC_IFACE
*abstract
, RPC_IFACE
*transfer
)
417 rpc_ctx
->context_id
= context_id
; /* presentation context identifier (0x0) */
418 rpc_ctx
->num_transfer_syntaxes
= 1 ; /* the number of syntaxes (has always been 1?)(0x1) */
420 /* num and vers. of interface client is using */
421 rpc_ctx
->abstract
= *abstract
;
423 /* vers. of interface to use for replies */
424 rpc_ctx
->transfer
= transfer
;
427 /*******************************************************************
428 Inits an RPC_HDR_RB structure.
429 Note the context pointer must remain valid until this is marshalled.
430 ********************************************************************/
432 void init_rpc_hdr_rb(RPC_HDR_RB
*rpc
,
433 uint16 max_tsize
, uint16 max_rsize
, uint32 assoc_gid
,
434 RPC_CONTEXT
*context
)
436 init_rpc_hdr_bba(&rpc
->bba
, max_tsize
, max_rsize
, assoc_gid
);
438 rpc
->num_contexts
= 1;
439 rpc
->rpc_context
= context
;
442 /*******************************************************************
443 Reads or writes an RPC_CONTEXT structure.
444 ********************************************************************/
446 BOOL
smb_io_rpc_context(const char *desc
, RPC_CONTEXT
*rpc_ctx
, prs_struct
*ps
, int depth
)
455 if(!prs_uint16("context_id ", ps
, depth
, &rpc_ctx
->context_id
))
457 if(!prs_uint8 ("num_transfer_syntaxes", ps
, depth
, &rpc_ctx
->num_transfer_syntaxes
))
460 /* num_transfer_syntaxes must not be zero. */
461 if (rpc_ctx
->num_transfer_syntaxes
== 0)
464 if(!smb_io_rpc_iface("", &rpc_ctx
->abstract
, ps
, depth
))
467 if (UNMARSHALLING(ps
)) {
468 if (!(rpc_ctx
->transfer
= PRS_ALLOC_MEM(ps
, RPC_IFACE
, rpc_ctx
->num_transfer_syntaxes
))) {
473 for (i
= 0; i
< rpc_ctx
->num_transfer_syntaxes
; i
++ ) {
474 if (!smb_io_rpc_iface("", &rpc_ctx
->transfer
[i
], ps
, depth
))
480 /*******************************************************************
481 Reads or writes an RPC_HDR_RB structure.
482 ********************************************************************/
484 BOOL
smb_io_rpc_hdr_rb(const char *desc
, RPC_HDR_RB
*rpc
, prs_struct
*ps
, int depth
)
491 prs_debug(ps
, depth
, desc
, "smb_io_rpc_hdr_rb");
494 if(!smb_io_rpc_hdr_bba("", &rpc
->bba
, ps
, depth
))
497 if(!prs_uint8("num_contexts", ps
, depth
, &rpc
->num_contexts
))
500 /* 3 pad bytes following - will be mopped up by the prs_align in smb_io_rpc_context(). */
502 /* num_contexts must not be zero. */
503 if (rpc
->num_contexts
== 0)
506 if (UNMARSHALLING(ps
)) {
507 if (!(rpc
->rpc_context
= PRS_ALLOC_MEM(ps
, RPC_CONTEXT
, rpc
->num_contexts
))) {
512 for (i
= 0; i
< rpc
->num_contexts
; i
++ ) {
513 if (!smb_io_rpc_context("", &rpc
->rpc_context
[i
], ps
, depth
))
520 /*******************************************************************
521 Inits an RPC_RESULTS structure.
523 lkclXXXX only one reason at the moment!
524 ********************************************************************/
526 static void init_rpc_results(RPC_RESULTS
*res
,
527 uint8 num_results
, uint16 result
, uint16 reason
)
529 res
->num_results
= num_results
; /* the number of results (0x01) */
530 res
->result
= result
; /* result (0x00 = accept) */
531 res
->reason
= reason
; /* reason (0x00 = no reason specified) */
534 /*******************************************************************
535 Reads or writes an RPC_RESULTS structure.
537 lkclXXXX only one reason at the moment!
538 ********************************************************************/
540 static BOOL
smb_io_rpc_results(const char *desc
, RPC_RESULTS
*res
, prs_struct
*ps
, int depth
)
545 prs_debug(ps
, depth
, desc
, "smb_io_rpc_results");
551 if(!prs_uint8 ("num_results", ps
, depth
, &res
->num_results
))
557 if(!prs_uint16("result ", ps
, depth
, &res
->result
))
559 if(!prs_uint16("reason ", ps
, depth
, &res
->reason
))
564 /*******************************************************************
565 Init an RPC_HDR_BA structure.
567 lkclXXXX only one reason at the moment!
569 ********************************************************************/
571 void init_rpc_hdr_ba(RPC_HDR_BA
*rpc
,
572 uint16 max_tsize
, uint16 max_rsize
, uint32 assoc_gid
,
573 const char *pipe_addr
,
574 uint8 num_results
, uint16 result
, uint16 reason
,
577 init_rpc_hdr_bba (&rpc
->bba
, max_tsize
, max_rsize
, assoc_gid
);
578 init_rpc_addr_str(&rpc
->addr
, pipe_addr
);
579 init_rpc_results (&rpc
->res
, num_results
, result
, reason
);
581 /* the transfer syntax from the request */
582 memcpy(&rpc
->transfer
, transfer
, sizeof(rpc
->transfer
));
585 /*******************************************************************
586 Reads or writes an RPC_HDR_BA structure.
587 ********************************************************************/
589 BOOL
smb_io_rpc_hdr_ba(const char *desc
, RPC_HDR_BA
*rpc
, prs_struct
*ps
, int depth
)
594 prs_debug(ps
, depth
, desc
, "smb_io_rpc_hdr_ba");
597 if(!smb_io_rpc_hdr_bba("", &rpc
->bba
, ps
, depth
))
599 if(!smb_io_rpc_addr_str("", &rpc
->addr
, ps
, depth
))
601 if(!smb_io_rpc_results("", &rpc
->res
, ps
, depth
))
603 if(!smb_io_rpc_iface("", &rpc
->transfer
, ps
, depth
))
608 /*******************************************************************
609 Init an RPC_HDR_REQ structure.
610 ********************************************************************/
612 void init_rpc_hdr_req(RPC_HDR_REQ
*hdr
, uint32 alloc_hint
, uint16 opnum
)
614 hdr
->alloc_hint
= alloc_hint
; /* allocation hint */
615 hdr
->context_id
= 0; /* presentation context identifier */
616 hdr
->opnum
= opnum
; /* opnum */
619 /*******************************************************************
620 Reads or writes an RPC_HDR_REQ structure.
621 ********************************************************************/
623 BOOL
smb_io_rpc_hdr_req(const char *desc
, RPC_HDR_REQ
*rpc
, prs_struct
*ps
, int depth
)
628 prs_debug(ps
, depth
, desc
, "smb_io_rpc_hdr_req");
631 if(!prs_uint32("alloc_hint", ps
, depth
, &rpc
->alloc_hint
))
633 if(!prs_uint16("context_id", ps
, depth
, &rpc
->context_id
))
635 if(!prs_uint16("opnum ", ps
, depth
, &rpc
->opnum
))
640 /*******************************************************************
641 Reads or writes an RPC_HDR_RESP structure.
642 ********************************************************************/
644 BOOL
smb_io_rpc_hdr_resp(const char *desc
, RPC_HDR_RESP
*rpc
, prs_struct
*ps
, int depth
)
649 prs_debug(ps
, depth
, desc
, "smb_io_rpc_hdr_resp");
652 if(!prs_uint32("alloc_hint", ps
, depth
, &rpc
->alloc_hint
))
654 if(!prs_uint16("context_id", ps
, depth
, &rpc
->context_id
))
656 if(!prs_uint8 ("cancel_ct ", ps
, depth
, &rpc
->cancel_count
))
658 if(!prs_uint8 ("reserved ", ps
, depth
, &rpc
->reserved
))
663 /*******************************************************************
664 Reads or writes an RPC_HDR_FAULT structure.
665 ********************************************************************/
667 BOOL
smb_io_rpc_hdr_fault(const char *desc
, RPC_HDR_FAULT
*rpc
, prs_struct
*ps
, int depth
)
672 prs_debug(ps
, depth
, desc
, "smb_io_rpc_hdr_fault");
675 if(!prs_dcerpc_status("status ", ps
, depth
, &rpc
->status
))
677 if(!prs_uint32("reserved", ps
, depth
, &rpc
->reserved
))
683 /*******************************************************************
684 Inits an RPC_HDR_AUTH structure.
685 ********************************************************************/
687 void init_rpc_hdr_auth(RPC_HDR_AUTH
*rai
,
688 uint8 auth_type
, uint8 auth_level
,
690 uint32 auth_context_id
)
692 rai
->auth_type
= auth_type
;
693 rai
->auth_level
= auth_level
;
694 rai
->auth_pad_len
= auth_pad_len
;
695 rai
->auth_reserved
= 0;
696 rai
->auth_context_id
= auth_context_id
;
699 /*******************************************************************
700 Reads or writes an RPC_HDR_AUTH structure.
701 ********************************************************************/
703 BOOL
smb_io_rpc_hdr_auth(const char *desc
, RPC_HDR_AUTH
*rai
, prs_struct
*ps
, int depth
)
708 prs_debug(ps
, depth
, desc
, "smb_io_rpc_hdr_auth");
714 if(!prs_uint8 ("auth_type ", ps
, depth
, &rai
->auth_type
))
716 if(!prs_uint8 ("auth_level ", ps
, depth
, &rai
->auth_level
))
718 if(!prs_uint8 ("auth_pad_len ", ps
, depth
, &rai
->auth_pad_len
))
720 if(!prs_uint8 ("auth_reserved", ps
, depth
, &rai
->auth_reserved
))
722 if(!prs_uint32("auth_context_id", ps
, depth
, &rai
->auth_context_id
))
728 /*******************************************************************
729 Checks an RPC_AUTH_VERIFIER structure.
730 ********************************************************************/
732 BOOL
rpc_auth_verifier_chk(RPC_AUTH_VERIFIER
*rav
,
733 const char *signature
, uint32 msg_type
)
735 return (strequal(rav
->signature
, signature
) && rav
->msg_type
== msg_type
);
738 /*******************************************************************
739 Inits an RPC_AUTH_VERIFIER structure.
740 ********************************************************************/
742 void init_rpc_auth_verifier(RPC_AUTH_VERIFIER
*rav
,
743 const char *signature
, uint32 msg_type
)
745 fstrcpy(rav
->signature
, signature
); /* "NTLMSSP" */
746 rav
->msg_type
= msg_type
; /* NTLMSSP_MESSAGE_TYPE */
749 /*******************************************************************
750 Reads or writes an RPC_AUTH_VERIFIER structure.
751 ********************************************************************/
753 BOOL
smb_io_rpc_auth_verifier(const char *desc
, RPC_AUTH_VERIFIER
*rav
, prs_struct
*ps
, int depth
)
758 prs_debug(ps
, depth
, desc
, "smb_io_rpc_auth_verifier");
762 if(!prs_string("signature", ps
, depth
, rav
->signature
,
763 sizeof(rav
->signature
)))
765 if(!prs_uint32("msg_type ", ps
, depth
, &rav
->msg_type
)) /* NTLMSSP_MESSAGE_TYPE */
771 /*******************************************************************
772 This parses an RPC_AUTH_VERIFIER for schannel. I think
773 ********************************************************************/
775 BOOL
smb_io_rpc_schannel_verifier(const char *desc
, RPC_AUTH_VERIFIER
*rav
, prs_struct
*ps
, int depth
)
780 prs_debug(ps
, depth
, desc
, "smb_io_rpc_schannel_verifier");
783 if(!prs_string("signature", ps
, depth
, rav
->signature
, sizeof(rav
->signature
)))
785 if(!prs_uint32("msg_type ", ps
, depth
, &rav
->msg_type
))
791 /*******************************************************************
792 creates an RPC_AUTH_SCHANNEL_NEG structure.
793 ********************************************************************/
795 void init_rpc_auth_schannel_neg(RPC_AUTH_SCHANNEL_NEG
*neg
,
796 const char *domain
, const char *myname
)
800 fstrcpy(neg
->domain
, domain
);
801 fstrcpy(neg
->myname
, myname
);
804 /*******************************************************************
805 Reads or writes an RPC_AUTH_SCHANNEL_NEG structure.
806 ********************************************************************/
808 BOOL
smb_io_rpc_auth_schannel_neg(const char *desc
, RPC_AUTH_SCHANNEL_NEG
*neg
,
809 prs_struct
*ps
, int depth
)
814 prs_debug(ps
, depth
, desc
, "smb_io_rpc_auth_schannel_neg");
820 if(!prs_uint32("type1", ps
, depth
, &neg
->type1
))
822 if(!prs_uint32("type2", ps
, depth
, &neg
->type2
))
824 if(!prs_string("domain ", ps
, depth
, neg
->domain
, sizeof(neg
->domain
)))
826 if(!prs_string("myname ", ps
, depth
, neg
->myname
, sizeof(neg
->myname
)))
832 /*******************************************************************
833 reads or writes an RPC_AUTH_SCHANNEL_CHK structure.
834 ********************************************************************/
836 BOOL
smb_io_rpc_auth_schannel_chk(const char *desc
, int auth_len
,
837 RPC_AUTH_SCHANNEL_CHK
* chk
,
838 prs_struct
*ps
, int depth
)
843 prs_debug(ps
, depth
, desc
, "smb_io_rpc_auth_schannel_chk");
846 if ( !prs_uint8s(False
, "sig ", ps
, depth
, chk
->sig
, sizeof(chk
->sig
)) )
849 if ( !prs_uint8s(False
, "seq_num", ps
, depth
, chk
->seq_num
, sizeof(chk
->seq_num
)) )
852 if ( !prs_uint8s(False
, "packet_digest", ps
, depth
, chk
->packet_digest
, sizeof(chk
->packet_digest
)) )
855 if ( auth_len
== RPC_AUTH_SCHANNEL_SIGN_OR_SEAL_CHK_LEN
) {
856 if ( !prs_uint8s(False
, "confounder", ps
, depth
, chk
->confounder
, sizeof(chk
->confounder
)) )