diff options
author | Luke Leighton <lkcl@samba.org> | 1998-10-14 06:29:20 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1998-10-14 06:29:20 +0000 |
commit | 69f5f9f88935de1f63ffc9aa19c0629b395e66e6 (patch) | |
tree | a7fc3653694e18a2232e1e635688dbfc0e06302f /source/rpc_parse | |
parent | bff457b4a469c03977683c4521464c41f74db1ae (diff) | |
download | samba-69f5f9f88935de1f63ffc9aa19c0629b395e66e6.tar.gz samba-69f5f9f88935de1f63ffc9aa19c0629b395e66e6.tar.xz samba-69f5f9f88935de1f63ffc9aa19c0629b395e66e6.zip |
dce/rpc
Diffstat (limited to 'source/rpc_parse')
-rw-r--r-- | source/rpc_parse/parse_rpc.c | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/source/rpc_parse/parse_rpc.c b/source/rpc_parse/parse_rpc.c index 6b4deb00cf1..f9745da4b4d 100644 --- a/source/rpc_parse/parse_rpc.c +++ b/source/rpc_parse/parse_rpc.c @@ -462,7 +462,8 @@ creates an RPC_HDR_AUTH structure. ********************************************************************/ void make_rpc_hdr_auth(RPC_HDR_AUTH *rai, uint8 auth_type, uint8 auth_level, - uint8 stub_type_len) + uint8 stub_type_len, + uint32 ptr) { if (rai == NULL) return; @@ -471,7 +472,7 @@ void make_rpc_hdr_auth(RPC_HDR_AUTH *rai, rai->stub_type_len = stub_type_len; /* 0x00 */ rai->padding = 0; /* padding 0x00 */ - rai->unknown = 0x0014a0c0; /* non-zero pointer to something */ + rai->unknown = ptr; /* non-zero pointer to something */ } /******************************************************************* @@ -532,8 +533,8 @@ void make_rpc_auth_ntlmssp_neg(RPC_AUTH_NTLMSSP_NEG *neg, neg->neg_flgs = neg_flgs ; /* 0x00b2b3 */ - make_str_hdr(&neg->hdr_myname, len_myname+1, len_myname+1, 0x20); - make_str_hdr(&neg->hdr_domain, len_domain+1, len_domain+1, 0x20 + len_myname+1); + make_str_hdr(&neg->hdr_domain, len_domain, len_domain, 0x20 + len_myname); + make_str_hdr(&neg->hdr_myname, len_myname, len_myname, 0x20); fstrcpy(neg->myname, myname); fstrcpy(neg->domain, domain); @@ -551,11 +552,38 @@ void smb_io_rpc_auth_ntlmssp_neg(char *desc, RPC_AUTH_NTLMSSP_NEG *neg, prs_stru prs_uint32("neg_flgs ", ps, depth, &(neg->neg_flgs)); - smb_io_strhdr("hdr_myname", &(neg->hdr_myname), ps, depth); - smb_io_strhdr("hdr_domain", &(neg->hdr_domain), ps, depth); + if (ps->io) + { + uint32 old_offset; + + /* reading */ + + ZERO_STRUCTP(neg); + + smb_io_strhdr("hdr_domain", &(neg->hdr_domain), ps, depth); + smb_io_strhdr("hdr_myname", &(neg->hdr_myname), ps, depth); + + old_offset = ps->offset; + + ps->offset = neg->hdr_myname .buffer + 0x1c; + prs_uint8s(True , "myname", ps, depth, (uint8*)neg->myname , MIN(neg->hdr_myname .str_str_len, sizeof(neg->myname ))); + old_offset += neg->hdr_myname .str_str_len; + + ps->offset = neg->hdr_domain .buffer + 0x1c; + prs_uint8s(True , "domain", ps, depth, (uint8*)neg->domain , MIN(neg->hdr_domain .str_str_len, sizeof(neg->domain ))); + old_offset += neg->hdr_domain .str_str_len; + + ps->offset = old_offset; + } + else + { + /* writing */ + smb_io_strhdr("hdr_domain", &(neg->hdr_domain), ps, depth); + smb_io_strhdr("hdr_myname", &(neg->hdr_myname), ps, depth); - prs_string("domain", ps, depth, neg->domain, neg->hdr_domain.str_str_len-1, sizeof(neg->domain)); - prs_string("myname", ps, depth, neg->myname, neg->hdr_myname.str_str_len-1, sizeof(neg->myname)); + prs_uint8s(True , "myname", ps, depth, (uint8*)neg->myname , MIN(neg->hdr_myname .str_str_len, sizeof(neg->myname ))); + prs_uint8s(True , "domain", ps, depth, (uint8*)neg->domain , MIN(neg->hdr_domain .str_str_len, sizeof(neg->domain ))); + } } /******************************************************************* |