Commit graph

66 commits

Author SHA1 Message Date
Guy Harris
6e57154948 Put Unicode strings into the protocol tree with the appropriate protocol
tree item, not with hf_nt_str.  Get rid of hf_nt_str, as it's no longer
used.

Put ASCII strings into the protocol tree only once.

svn path=/trunk/; revision=6910
2003-01-11 08:22:39 +00:00
Guy Harris
62c48557e5 Get rid of an extra "." at the end of the name of the "nt.str" field.
svn path=/trunk/; revision=6908
2003-01-11 07:48:22 +00:00
Tim Potter
56b60052cd Convert some incidental prs_* calls to dissect_dcerpc_*
equivalents.

svn path=/trunk/; revision=6898
2003-01-11 04:35:57 +00:00
Guy Harris
69ab206a89 From Devin Heitmueller: make the RC4 support stateful.
svn path=/trunk/; revision=6777
2002-12-11 19:31:02 +00:00
Guy Harris
6005765a80 Values in Microsoft protocols that don't have their byte order specified
by DCE RPC are usually little-endian; fix a bunch of
"proto_tree_add_item()" calls (most are for byte-array or string fields,
so the byte order doesn't make a difference, but one is a number).

Put an item into the protocol tree for the encrypted NT password block.

Mallocate the buffer for the Unicode version of the password, rather
than assuming it'll fit in 256 bytes.

"g_malloc()" never returns NULL - it either allocates memory or aborts -
so don't check for a mallocation failure.

Don't try to decrypt the NT password block if we don't have a password.

svn path=/trunk/; revision=6731
2002-12-03 01:20:56 +00:00
Guy Harris
dd8f630768 From Devin Heitmueller:
add MD4 and RC4 crypto support;

	use it to decrypt the NT password encryption block in
	UnicodeChangePassword2.

svn path=/trunk/; revision=6727
2002-12-03 00:37:27 +00:00
Guy Harris
c6bcd3eb0d From Devin Heitmueller: show proper field names for SAMR
UnicodeChangePassword2.

svn path=/trunk/; revision=6603
2002-11-10 20:17:52 +00:00
Ronnie Sahlberg
d8e1d2987a Bugfixes for two SAMR dissectors.
svn path=/trunk/; revision=6599
2002-11-10 09:49:38 +00:00
Richard Sharpe
d49f9bf4d7 Add some fixes from Albert Chin
svn path=/trunk/; revision=6134
2002-08-30 02:08:50 +00:00
Jörg Mayer
7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Tim Potter
50b37822a0 Some cleanups and fixes from Guy:
- combine proto_tree_add_text() and proto_tree_append_text() calls in the
   access mask dissector

 - make the specific access bits dissector functions return void instead of
   an offset

I think Samba has the create user reply wrong.  There is perhaps a uint32
marked as unknown that shouldn't be there.  Removing this parses all the
captures I have.

svn path=/trunk/; revision=6057
2002-08-22 01:13:13 +00:00
Tim Potter
bc792aa9a4 Call dissect_nt_access_mask() instead of dissect_ndr_uint32()
svn path=/trunk/; revision=6054
2002-08-21 21:31:15 +00:00
Tim Potter
5770e384a0 The unknown uint32 in create user2 reply is an access granted mask.
Assign some names to policy handles generated by open/create domain/user/group.

svn path=/trunk/; revision=5987
2002-08-13 07:59:33 +00:00
Tim Potter
f92f7de8e3 Fix a return code in samr_dissect_query_information_domain_reply()
svn path=/trunk/; revision=5965
2002-08-07 01:04:51 +00:00
Richard Sharpe
fc7030bc24 Update packet-dcerpc-samr.{c,h} to fix the names for the functions we now
know are SamrConnect, SamrConnect2, SamrConnect3 and SamrConnect4.

Thanks to Jim McDonnough and Tod Sabin.

svn path=/trunk/; revision=5960
2002-08-06 21:58:09 +00:00
Guy Harris
ff49944dcd From Joerg Mayer: add #includes of "snprintf.h" in modules that used
"snprintf()" but weren't including "snprintf.h".

svn path=/trunk/; revision=5887
2002-07-16 22:50:48 +00:00
Richard Sharpe
c4e5391585 A small patch from Andrew Bartlett.
svn path=/trunk/; revision=5826
2002-07-06 17:44:47 +00:00
Tim Potter
4f61c39615 Fix up is_open and is_close arguments to dissect_nt_policy_hnd
calls in SAMR dissector.

svn path=/trunk/; revision=5809
2002-07-02 02:33:07 +00:00
Tim Potter
6d6dce305d Change each DCERPC dissector to pass in a hf value on initialisation
for a value_string that corresponds to that dissectors opnums.  Pass
in -1 if no such table is available.

svn path=/trunk/; revision=5749
2002-06-24 00:03:18 +00:00
Tim Potter
501daf1770 Removed some trailing commas from various DCERPC dissectors.
svn path=/trunk/; revision=5604
2002-05-31 00:31:13 +00:00
Ronnie Sahlberg
259903dc66 Changed toplevel REF pointer dissection to create a subtree. Not creating a subtree was a design mistake which caused ugliness in the unicode string str dissector and in other places.
Dissectors will temporarily have less pretty output for topleve ref pointers until their output is retuned.

svn path=/trunk/; revision=5573
2002-05-27 09:50:58 +00:00
Guy Harris
6a79ad7e91 In "dissect_nt_policy_hnd()":
add arguments to specify whether the policy handle is being
	opened or closed, and don't set the "open frame" for the handle
	unless it's being opened and don't set the "close frame" for the
	handle unless it's being closed;

	store the policy handle before fetching it, so that an open or
	close is marked appropriately in the protocol tree on the first
	pass;

	if the policy handle has a name associated with it, put that
	name into the top-level item for the policy handle.

In "packet-dcerpc-spoolss.c":

	get rid of aun unused variable;

	make "setjob_commands[]" static, as it's not used outside
	"packet-dcerpc-spoolss.c";

	put a "VALS()" call around the reference to "setjob_commands",
	to squelch compiler warnings;

	give the SPOOLSS return code field the appropriate
	"value_string" array.

svn path=/trunk/; revision=5448
2002-05-11 22:29:43 +00:00
Guy Harris
5f3ec8a741 Put in a comment noting that the previous change came from a real
capture, so if an IDL disagrees, the IDL is wrong.

svn path=/trunk/; revision=5428
2002-05-09 09:54:13 +00:00
Guy Harris
94f3f3479e As Ronnie Sahlberg notes, the problem is that the QueryDomainInfo
response starts with a UNIQUE pointer to a DOMAIN_INFO, not with a REF
pointer to a DOMAIN_INFO - and also not with a UNIQUE pointer to a
DOMAIN_INFO REF pointer; fix the code to match that.

svn path=/trunk/; revision=5427
2002-05-09 09:49:34 +00:00
Guy Harris
c5312df095 In at least one capture, a QueryDomainInfo response starts with what is,
I guess, a UNIQUE pointer to a DOMAIN_INFO REF pointer; dissect it as
such.

svn path=/trunk/; revision=5426
2002-05-09 08:36:45 +00:00
Ronnie Sahlberg
dad31088e2 Several bugfixes for SAMR
svn path=/trunk/; revision=5413
2002-05-07 11:26:46 +00:00
Tim Potter
afa61bda6e Remove unused function.
Dissect a status code at the end of GetAliasMem reply instead of uint32.

svn path=/trunk/; revision=5401
2002-05-05 23:48:19 +00:00
Guy Harris
16d52f4f29 From Joerg Mayer: mark unused arguments as such.
svn path=/trunk/; revision=5380
2002-05-04 09:05:44 +00:00
Guy Harris
da74615c79 Get rid of some unused arguments, and mark some others as unused.
Remove the declaration of "dissect_nt_sid()" from
"packet-dcerpc-samr.c"; get it by including "packet-smb-common.h",
instead.

svn path=/trunk/; revision=5313
2002-04-30 11:03:08 +00:00
Tim Potter
63aaa78222 Use the string in the DCERPC sub-dissector array instead of providing
another one in the COL_INFO field.

svn path=/trunk/; revision=5300
2002-04-30 01:44:35 +00:00
Guy Harris
7cfa480fdd Un-#if out "samr_dissect_get_alias_membership_response()", to serve as a
reminder to check whether "samr_dissect_get_alias_membership_reply()"
should dissect the uint32 at the end as an NT status.

Un-#if out "samr_dissect_context_handle_SID()", to serve as a reminder
to figure out whether it should be deleted or used.

Get rid of "samr_dissect_get_user_groups_rqst()" - it's identical to
"samr_dissect_get_groups_for_user_rqst()", but isn't being used.

svn path=/trunk/; revision=5295
2002-04-29 10:30:18 +00:00
Guy Harris
9a80f0a521 Removal (or, at least, #ifdeffing out) of unused variables and
functions, from David Frascone.

svn path=/trunk/; revision=5288
2002-04-29 08:20:18 +00:00
Guy Harris
99af2a9798 Fix "samr_dissect_query_information_alias_reply()" to dissect the
ALIAS_INFO structure before the status.

svn path=/trunk/; revision=5215
2002-04-22 02:04:37 +00:00
Guy Harris
2233aa8f3e Fix an error in the "dcerpc_samr_dissectors[]" table.
Rename "samr_dissect_enum_dom_alias_rqst()" and
"samr_dissect_enum_dom_alias_reply()" to
"samr_dissect_enum_dom_aliases_rqst()" and
"samr_dissect_enum_dom_aliases_reply()", to match the name of the RPC
that they dissect.

Rename the routines used to dissect the unknown 0x2f requests and replies
along the lines of the names of the routines for other unknown requests
and replies, and change the Info column information in that fashion as
well.

Dissect the USER_INFO structure in the QueryUserInfo response.

svn path=/trunk/; revision=5211
2002-04-22 00:09:21 +00:00
Guy Harris
92e27e03c1 Add a "proto_register_dcerpc_smb()" which registers ett_ values for
"packet-dcerpc-nt.c", and registers "dcerpc_smb_init()" as an
initialization routine.  Take the ett_ registration out of the latter
routine, and also take out the "do this only once" stuff.

Get rid of the initialization routines for netlogon, samr, and spoolss;
they just call "dcerpc_smb_init()", which is now an initialization
routine of its own.

The policy hash initialization should be done before every capture, so
it should be done in an initialization routine, and should not do any
"do this only once" stuff.  It should also be called only once before
every capture, rather than 3 times.

The ett_ initialization should, however, be done at the same time all
other ett_ initialization is done - at protocol registration time - so
it should be done in a "proto_register_" routine.

This fixes a bug I saw wherein

	1) the tree for Unicode strings was open by default

and

	2) if you closed one and then exited, Ethereal would crash.

The problem is that "proto_register_subtree_array()" doesn't expand the
array, it just bumps the number of registered ett_ values; the array is
allocated in "proto_init()".  As such, if you register ett_ values with
"proto_register_subtree_array()" *after* "proto_init()" is called - and,
even for the first capture, initialization routines are called after
"proto_init()" is called - you will get ett_ numbers that go past the
number of elements in the array.

Move the declaration of "ett_nt_unicode_string" to "packet-dcerpc-nt.h",
as it's exported from "packet-dcerpc-nt.c".

Get rid of the declaration of "dcerpc_smb_init()" in
"packet-dcerpc-nt.h", and make it static, as it's no longer called from
outside "packet-dcerpc-nt.c".

svn path=/trunk/; revision=5196
2002-04-18 00:29:17 +00:00
Tim Potter
c45862ed49 Display rids for open user, group, alias in COL_INFO.
Give query user info its own dissector.

svn path=/trunk/; revision=5192
2002-04-17 11:32:24 +00:00
Tim Potter
6156156841 Prettification of SAMR dissector - display short names in COL_INFO.
svn path=/trunk/; revision=5191
2002-04-17 11:17:43 +00:00
Tim Potter
8241e67243 Use policy handle hash code in DCERPC/SMB SAMR dissector.
Start to move some common stuff into packet-dcerpc-nt.[ch]

svn path=/trunk/; revision=5176
2002-04-17 07:52:26 +00:00
Tim Potter
0f7ea5950d Display non-zero return codes in COL_INFO.
svn path=/trunk/; revision=5170
2002-04-16 02:02:04 +00:00
Tim Potter
a2364e52b8 #include <string.h> to quieten compiler warning.
svn path=/trunk/; revision=5013
2002-03-25 04:02:37 +00:00
Guy Harris
02115cdb39 Fix "dissect_ndr_nt_UNICODE_STRING_str()" so that the "di->levels" value
is decremented after every level is appended to, so that it correctly
specifies the number of levels up the tree to which to append stuff.

Fix some arguments to various printing routines to specify the correct
level.  This includes making "dissect_ndr_nt_UNICODE_STRING()" add 1 to
the level argument it's passed before passing it on to
"dissect_ndr_pointer()".

Add a "netlogon_dissect_UNICODE_STRING()" routine to put the fields of a
bunch of NDR_POINTER_REF UNICODE_STRING values into subtrees.

Fix the labels passed as arguments in a bunch of "dissect_ndr_pointer()"
calls.

svn path=/trunk/; revision=5011
2002-03-24 12:25:40 +00:00
Ronnie Sahlberg
7791aabe52 Added a value_string for the countreis which have their MS contry code listed
at www.unicode.org and made samr and netlogon use it.

svn path=/trunk/; revision=4943
2002-03-14 10:04:02 +00:00
Ronnie Sahlberg
81f29c2ce5 Final patch in preparing for NETLOGON dissector.
Exported some functions from packet-dcerpc-samr.c and added two
more functions the netlogon dissector will need.

svn path=/trunk/; revision=4921
2002-03-11 00:28:21 +00:00
Ronnie Sahlberg
7900235dad Move the STRING dissector to packet-dcerpc-nt.c and add one more parameter
to make it more similar to the UNICODE_STRING dissector.

svn path=/trunk/; revision=4920
2002-03-11 00:15:20 +00:00
Ronnie Sahlberg
f060b0c68c Rename samr_dissect_LOGON_HOURS() to dissect_ndr_nt_LOGON_HOURS() and
export it to other modules.
NETLOGON dissector (and others) will need this function.

svn path=/trunk/; revision=4919
2002-03-11 00:00:15 +00:00
Ronnie Sahlberg
853654f2f3 Moved dissect_ndr_nt_NTTIME() from packet-dcerpc-samr.c to packet-dcerpc-nt.c
since this function will be used by other NT services as well such as NETLOGON.

svn path=/trunk/; revision=4918
2002-03-10 23:24:48 +00:00
Guy Harris
ce5c18736d Don't use "proto_tree_add_string_format()" when
"proto_tree_add_string()" will suffice.

svn path=/trunk/; revision=4913
2002-03-10 22:04:25 +00:00
Guy Harris
bf1c8de997 Use "dissect_ndr_nt_UNICODE_STRING_str()", not
"dissect_ndr_nt_UNICODE_STRING_string()", in
"samr_dissect_connect2_server()"; that eliminates an unnecessary extra
level of protocol tree.

That removes the last call to "dissect_ndr_nt_UNICODE_STRING_string()";
eliminate that routine.

In "dissect_ndr_nt_UNICODE_STRING()", initially create the subtree with
the name of the field as a string, so that if an exception is thrown
before the name is set, the subtree won't show up as blank when
displayed or printed.  Also pass in the name to "dissect_ndr_pointer()",
so the same happens for subtrees below it.  Append only the string data,
not its name, to items up the tree, as the name was put in when the item
was created.  Also, when adding a colon before the string, put a space
after the colon, as is done elsewhere in Ethereal.

When appending additional strings, put the blank before the new string,
not after it.

In "dissect_ndr_nt_STRING()", put the subtree into the string with the
name of the field, rather than just "String".  Pass in that name to
"dissect_ndr_pointer()", so subtrees below it get a name when they're
initially created.

Get rid of colons in the name string passed to "dissect_ndr_pointer()"
in some calls.  Supply a non-null name string in more calls to
"dissect_ndr_pointer()", and fix some calls to pass in the name of the
field being handed to "dissect_ndr_pointer()".

There's no need to fetch the entire "header_field_info" structure for a
protocol field in order to get the field's name - just use
"proto_registrar_get_name()" to get the name.

Use a length of -1, not 0, when creating a subtree whose length will be
set when the dissection of the items under the subtree is complete; that
way, if an exception is thrown while dissecting the items - which means
the item goes past the end of the tvbuff - the item will refer to all
data to the end of the tvbuff, rather than referring to nothing.

Fix a typo in the name of the "hf_samr_unknown_string" field.

svn path=/trunk/; revision=4912
2002-03-10 21:30:11 +00:00
Ronnie Sahlberg
a4b87ac09d Rename function and variables for dissecting an NT service Account Control
bitmap and make the function not static.
This bitmap is present in other RPC protocols for NT services as well
besides SAMR.

svn path=/trunk/; revision=4889
2002-03-06 10:01:17 +00:00
Ronnie Sahlberg
6723d26565 Moved dissector for UNICODE_STRING structure from packet-dcerpc-samr.c to packet-dcerpc-nt.c since this is a structure that is common to all NT services and not only SAMR.
svn path=/trunk/; revision=4888
2002-03-06 08:58:01 +00:00