Commit Graph

168 Commits

Author SHA1 Message Date
Ulf Lamping 8ef8186f5d tag some protocol items as generated
svn path=/trunk/; revision=10811
2004-05-07 11:07:53 +00:00
Guy Harris 3621c52cc4 Display a server boot time of 0 as "Unknown" (as that's what's sent when
the client sends its first PDU to the server, and when the endpoint
mapper sends back an error PDU on behalf of the server, because they
don't know the server's boot time - it's unlikely that the server was
booted precisely at January 1, 1970, 00:00:00 GMT).

Clean up some white space.

svn path=/trunk/; revision=10784
2004-05-04 06:14:51 +00:00
Ulf Lamping 0c339ea7ae some additional output while reassembling fragments,
to give the user better information about the fragmenting going on,
some other minor changes

svn path=/trunk/; revision=10681
2004-04-24 16:47:47 +00:00
Ronnie Sahlberg 7836c1f62e update to netlogon to dissect the timestamps in VALIDATION_UAS_INFO
update to dcerpc time_t dissector to print the string "No time specified" when the seconds field is 0xffffffff

svn path=/trunk/; revision=10678
2004-04-23 23:31:52 +00:00
Ronnie Sahlberg 0b4fc266f0 we need to export init_ndr_pointer_list() from packet-dcerpc so that
we can manually call functions to dissect NDR encoded structures without going through the DCERPC interface.

There are NDR encoded blobs that are not encapsulated inside DCERPC
such as in kerberos  and those dissectors need this.

svn path=/trunk/; revision=10321
2004-03-05 23:09:32 +00:00
Jörg Mayer 670677c36f Yaniv Kaul: show interface names - win32 only
svn path=/trunk/; revision=10291
2004-03-03 22:47:17 +00:00
Guy Harris b87cde6b8d From Jaime Fournier:
The UNKUUID col_info update was only working as
	dcerpc_try_handoff() would fail to find the subdissector, and
	thus did not clobber it with col_add_str().  It is now in the
	right place to determine a UUID that was either not found, or is
	disabled.  The boolean dcerpc.unknown_if_id is now only set on
	cases where the handoff fails.  This has been tested, and the
	boolean now works as it should, and is not set for ALL packets
	as it was in the old location.

svn path=/trunk/; revision=10163
2004-02-21 09:57:15 +00:00
Ulf Lamping d59b60246d using G_MAXFLOAT and G_MAXDOUBLE,
DCERPC is talking about a response, not a reply

svn path=/trunk/; revision=10096
2004-02-18 19:44:51 +00:00
Guy Harris 1d522e02d1 From Jaime Fournier: add a hidden FT_BOOLEAN variable that's present if
the interface UUID in a datagram call is unknown.

Clean up white space a bit.

svn path=/trunk/; revision=10084
2004-02-18 05:55:15 +00:00
Jörg Mayer 3e2633a0f4 char *drep -> guint8 *drep
svn path=/trunk/; revision=9735
2004-01-19 20:10:37 +00:00
Guy Harris 556c517b88 From Jamie Fournier: don't show UNKUUID information for fragments for
known dissectors.

svn path=/trunk/; revision=9208
2003-12-08 20:58:01 +00:00
Guy Harris 186bd3bab6 From Jaime Fournier: show the RPC version of the unknown interface in
the Info column.

svn path=/trunk/; revision=9081
2003-11-25 08:19:33 +00:00
Guy Harris 7cca92712d From Jamie Fournier: add the UUID to the Info column for datagram calls.
svn path=/trunk/; revision=9054
2003-11-21 04:01:48 +00:00
Guy Harris 7bd2e232a9 Export "protocol_t" as an opaque type.
Make "proto_is_protocol_enabled()" and "proto_get_protocol_short_name()"
take a "protocol_t *" as an argument, so they don't have to look up the
"protocol_t" - this will probably speed them up considerably, and
they're called on almost every dissector handoff.

Get rid of a number of "proto_is_protocol_enabled()" calls that aren't
necessary (dissectors called through handles, including those called
through dissector tables, or called as heuristic dissectors, aren't even
called if their protocol isn't enabled).

Change some direct dissector calls to go through handles.

svn path=/trunk/; revision=8979
2003-11-16 23:17:27 +00:00
Guy Harris ca5235bc35 From Jaime Fournier: get rid of space in field name.
svn path=/trunk/; revision=8958
2003-11-13 23:13:51 +00:00
Guy Harris 6dc9df36f6 Put stub data back where it was in the tree before.
svn path=/trunk/; revision=8947
2003-11-12 09:00:27 +00:00
Guy Harris 656d9c0333 Update a comment.
Catch another case where we need to check for a null decrypted_tvb.

svn path=/trunk/; revision=8894
2003-11-06 09:13:26 +00:00
Ronnie Sahlberg 25911d8c86 Bugfix for dcerpc parsing of encrypted short packets.
Sometimes if we cant decrypt a DCERPC packet decrypted_tvb is NULL.

do not pass a NULL pointer to show_stub_data() since this will dump
core.

svn path=/trunk/; revision=8890
2003-11-06 07:44:13 +00:00
Guy Harris 81d8b5dcf2 Fix a call to "dissect_dcerpc_cn()" to handle the new return value.
svn path=/trunk/; revision=8761
2003-10-23 07:14:21 +00:00
Guy Harris ab536b6af8 Catch exceptions in "dissect_dcerpc_cn_bs()", so that if we get an
exception dissecting stuff past the DCE RPC header, we still drive on
and dissect the next PDU, if any.

svn path=/trunk/; revision=8760
2003-10-23 05:58:57 +00:00
Guy Harris a6aa843aa5 Get rid of the "offset" argument to "dcerpc_try_handoff()" - it's always
0.

In "dcerpc_try_handoff()", remove the authentication padding from the
stub data handed to the subdissector - that's not really stub data for
the subdissector, and it should throw an exception if the request or
response would go into the authentication padding.  Don't even try to
dissect the remaining stub data if the authentication padding value
consumes all the stub data or would consume even more than that.

Show any "Long frame" data before the authentication padding, and show
the authentication padding as the stuff at the very end of the stub
data, after the "Long frame" data.

Catch all exceptions when dissecting authentication information, so that
even if it's bad or we don't have all of it, we still dissect the stub
data.

Try dissecting authentication trailer information even if we don't have
all of it in the tvbuff - we want an exception to be thrown if we don't.
Don't try to dissect it if it eats into the stub data, however.

Don't bother catching exceptions in "dissect_auth_verf()" - we now
always catch exceptions in above it in the DCE RPC dissector call tree.

Use CATCH_ALL and "show_exception()" when calling the sub-dissector for
a connection-oriented PDU; that means we won't have to worry about
adding new exception types unless they're types that we should rethrow.

svn path=/trunk/; revision=8759
2003-10-23 05:23:41 +00:00
Guy Harris 83980ea4ff From Yaniv Kaul: if there's more than one context item in a BIND PDU, show
the number of context items before showing the first one.

svn path=/trunk/; revision=8753
2003-10-22 21:26:40 +00:00
Guy Harris 04674dc949 Catch exceptions when dissecting a verifier, so we still dissect the
stub data even if there's a problem dissecting the verifier.

Show stub data as "Encrypted stub data" if it's encrypted, "Decrypted
stub data" if it was encrypted but we decrypted it, and "Stub data" if
it wasn't encrypted.

Don't attempt to decrypt data unless it was encrypted (i.e., the
authentication level is "Packet privacy".

Get rid of "decrypted_data" member of "packet_info" structure - we don't
need it any more.

svn path=/trunk/; revision=8743
2003-10-21 07:17:16 +00:00
Guy Harris a5287eb7d2 "dce_try_handoff()" isn't necessarily passed a non-null "auth_info"
argument - don't dereference it if it's null.

svn path=/trunk/; revision=8685
2003-10-14 00:45:54 +00:00
Ronnie Sahlberg e3da788a2a Updated the DCERPC service response time to also offer the menu to
Filter, Find and Colorize selected procedures
in the same way as SMB and ONC-RPC already does.

svn path=/trunk/; revision=8667
2003-10-10 11:11:37 +00:00
Ronnie Sahlberg e140f2858c Change dissect_deferred_pointer()
from being Ordo(n^2) into being Ordo(n)

Makes it slightly faster when n (the number of pointers) is >10.000

The mother of all dcerpc packets (containing one array of >10.000 pointers)
was a bit slow.

It is still slow but at least completes in out lifetime.

svn path=/trunk/; revision=8647
2003-10-08 12:29:52 +00:00
Tim Potter 2d33b62811 This commit refactors the dcerpc authentication subdissectors for
handling encrypted request/response PDUs.  Instead of having
dissection function pointers which perform both decryption and
dissection, the function pointers now only decrypt the DCERPC fragment
payload.  Dissection is handled by the dcerpc_try_handoff() function
(with DCERPC fragment reassembly if necessary).

Details:

 - Move the dcerpc_auth_info struct into dcerpc.h as it is now used in
   the function prototype for the decryption function handlers.

 - decode_encrypted_data() was refactored to take a boolean request
   parameter instead of passing the DCERPC PDU packet type.

 - A tvbuff_t * data field was added to dcerpc_auth to hold the
   verifier.  This is passed as an argument to the decryption function
   handlers.

 - Dissection of verifiers in request and response PDUs was moved to
   before the payload.

 - The dissect_dcerpc_cn_stub() function was refactored to perform
   the decryption process and hand decrypted data to the reassembly
   code instead of performing the decryption after reassembly.

 - Removed references to decrypted_info_t as it's not necessary
   anymore.

Code was tested using encrypted and unencrypted fragmented PDUs.
Before this commit ethereal could not dissect unencrypted (!)
fragmented PDUs correctly.

svn path=/trunk/; revision=8546
2003-09-26 06:30:13 +00:00
Tim Potter 6a389c8bd1 Use zero to mean we haven't seen any authentication level information
in dcerpc_auth_info since auth_level is an unsigned type.  Zero is
not a valid authentication level anyway (s13.1.2.1, p611 CAE spec).

Remove two inscrutable debugging comments that don't seem to mean anything.

svn path=/trunk/; revision=8545
2003-09-26 04:43:05 +00:00
Tim Potter f051c17afb Put the presentation context list and transfer syntax list of a dcerpc
bind request into some subtrees to make things look a bit nicer.

svn path=/trunk/; revision=8497
2003-09-19 05:30:01 +00:00
Ronnie Sahlberg 9428cb362e Do not take the pointer to a stack object and pass it to the tap system.
The tap listener will try to parse this pointer at a much later stage where the stack frame where this object lived will have dissapeared and possible got overwritten.

best that can happen is that service response times for dcerpc interfaces is screwed up
more probable is that we get a coredump

svn path=/trunk/; revision=8455
2003-09-11 10:31:01 +00:00
Tim Potter 4ccbfa3edc Guy suggested that the dcerpc opnum value_string code could be simplified
somewhat.  Now the dynamic initialisation of the value_string is contained
in the value_string_from_subdissectors() function instead of being
distributed amongst the dcerpc dissectors.

svn path=/trunk/; revision=8123
2003-08-04 02:49:04 +00:00
Guy Harris 75595b049d From Devin Heitmueller: include the authentication padding in the stub
data when decrypting it, as, at least for NTLMSSP encryption, the stub
*and* the authentication padding are encrypted as a single lump.

svn path=/trunk/; revision=8058
2003-07-21 09:10:00 +00:00
Guy Harris 42d9c722d7 Alter_context is sort of like Bind, and its authentication stubs are
dissected like those on Binds; the same is true for their corresponding
acks.

svn path=/trunk/; revision=8043
2003-07-18 06:07:14 +00:00
Guy Harris 19302f6d59 Squelch a (potentially-valid) compiler warning.
svn path=/trunk/; revision=8027
2003-07-16 05:26:19 +00:00
Tim Potter 8b89bd76ee Move all DCERPC authentication/encryption dissection code from packet-dcerpc.c
to the dissector that handles the particular authentication flavour.  This
gets rid of a couple of ugly switch statements and allows other authentication
modules to be written easily.

svn path=/trunk/; revision=8026
2003-07-16 04:20:33 +00:00
Tim Potter 623f5b865d Dynamically create DCERPC opnum value_strings from the subdissector
list rather than duplicating this information in the dissector.  Some
of the opnum strings were starting to get out of date as developers
forgot to update the information in both places.

svn path=/trunk/; revision=7936
2003-06-26 04:30:31 +00:00
Guy Harris 30a40860d4 Squelch a compiler warning (for something that's potentially a real
problem).

svn path=/trunk/; revision=7901
2003-06-19 10:01:49 +00:00
Gerald Combs e0cc9121ab Initialize di.hf_index in dissect_dcerpc_cn_rqst(). Alan Hood sent me a
fuzz-generated packet that made it all the way to proto_registrar_get_name()
without hf_index being initialized.

svn path=/trunk/; revision=7899
2003-06-19 01:22:03 +00:00
Tim Potter 24d1d3a828 Remove silly dcerpc_smb_check_long_frame() function and all calls to it.
A much better place to do this is after the subdissector function has
been called in dcercp_try_handoff().

svn path=/trunk/; revision=7895
2003-06-17 05:29:46 +00:00
Guy Harris ee97ce3196 Add new routines:
tvb_get_string() - takes a tvbuff, an offset, and a length as
	arguments, allocates a buffer big enough to hold a string with
	the specified number of bytes plus an added null terminator
	(i.e., length+1), copies the specified number of bytes from the
	tvbuff, at the specified offset, to that buffer and puts in a
	null terminator, and returns a pointer to that buffer (or throws
	an exception before allocating the buffer if that many bytes
	aren't available in the tvbuff);

	tvb_get_stringz() - takes a tvbuff, an offset, and a pointer to
	a "gint" as arguments, gets the size of the null-terminated
	string starting at the specified offset in the tvbuff (throwing
	an exception if the null terminator isn't found), allocates a
	buffer big enough to hold that string, copies the string to that
	buffer, and returns a pointer to that buffer and stores the
	length of the string (including the terminating null) in the
	variable pointed to by the "gint" pointer.

Replace many pieces of code allocating a buffer and copying a string
with calls to "tvb_get_string()" (for one thing, "tvb_get_string()"
doesn't require you to remember that the argument to
"tvb_get_nstringz0()" is the size of the buffer into which you're
copying the string, which might be the length of the string to be copied
*plus 1*).

Don't use fixed-length buffers for null-terminated strings (even if the
code that generates those packets has a #define to limit the length of
the string).  Use "tvb_get_stringz()", instead.

In some cases where a value is fetched but is only used to pass an
argument to a "proto_tree_add_XXX" routine, use "proto_tree_add_item()"
instead.

svn path=/trunk/; revision=7859
2003-06-12 08:33:32 +00:00
Guy Harris 9d24268f8f As "tvb_strneql()" and "tvb_memeql()" now just return -1, rather than
throwing an exception, if the bytes to be compared aren't available in
the tvbuff, we don't need to check for their existence before calling
those routines.

svn path=/trunk/; revision=7826
2003-06-10 05:53:33 +00:00
Guy Harris 53c2e25a9f There can be more than one DCE RPC call per frame, e.g. there can be
multiple NetBIOS-over-TCP session service messages in a TCP segment, and
they can contain the final portions of different DCERPC calls.  Don't
assume a frame number is sufficient to identify DCE RPC calls.

svn path=/trunk/; revision=7777
2003-06-04 05:41:37 +00:00
Guy Harris bc24ddab67 Put back the stuff for connection-oriented data to show fragment data as
"Fragment data (N bytes)" if we aren't dissecting it.

svn path=/trunk/; revision=7751
2003-05-27 09:22:27 +00:00
Guy Harris 456be7de63 Null-terminate ASCII string values in "dissect_ndr_cvstring()".
svn path=/trunk/; revision=7744
2003-05-26 21:58:45 +00:00
Tim Potter e75d49c848 Fix typo in name of ett for krb5 auth verifier.
svn path=/trunk/; revision=7721
2003-05-23 05:11:03 +00:00
Tim Potter 2ef11527a3 Move dissection of NETLOGON secure channel auth verifier into
packet-dcerpc-netlogon.c

svn path=/trunk/; revision=7670
2003-05-15 04:58:53 +00:00
Tim Potter 602a62e38a Dissect authentication data for netlogon secure channel bind and bind acks.
Also, recommit a change lost in the hardware failure which was to note the
type of a DCE/RPC fragment when noting it in COL_INFO.  A fragment can be
either a first, middle, last or whole (first+last) fragment.

svn path=/trunk/; revision=7666
2003-05-15 01:59:23 +00:00
Richard Sharpe 337963a73a Re-commit stuff that was lost...
This contains an initial break-out of the verifier for secure-channel and
maybe more ...

svn path=/trunk/; revision=7665
2003-05-14 22:09:52 +00:00
Guy Harris fa51805340 Have "dissect_ndr_cvstring()" set the length of the top-level item to
cover all the parts of the item, rather than just making it be 0.

svn path=/trunk/; revision=7661
2003-05-10 02:29:44 +00:00
Guy Harris 01e6542ed5 Use "tvb_ensure_bytes_exist()" to cause an exception to be thrown
*before* attempting to allocate a buffer for a string, if the copy into
the buffer will thrown an exception; that prevents us from

	1) leaking memory if we can allocate the buffer (we'd throw an
	   exception before we freed the buffer);

	2) crashing if we can't allocate the buffer because the length
	   is bogus and large.

svn path=/trunk/; revision=7658
2003-05-10 01:57:53 +00:00