Commit Graph

121 Commits

Author SHA1 Message Date
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
Guy Harris d812376fe4 Based on a patch from Jean-Baptiste Marchand, mark stub data as
encrypted if appropriate; this change adds a "show_stub_data()" to
handle that, and that routine also cleans up the stub data display a bit
in some other ways.

svn path=/trunk/; revision=7654
2003-05-08 19:26:08 +00:00
Guy Harris d359286841 Add a pointer to an hf_ value for a "reassembled_in" field (which can be
null) to the "fragment_items" structure, and don't pass that value into
"process_reassembled_data()", just have it use the value in the
"fragment_items" structure passed to it.

Make "process_reassembled_data()" capable of handling reassembly done by
"fragment_add_seq_check()", and use it in the ATP and 802.11 dissectors;
give them "reassembled_in" fields.  Make "process_reassembled_data()"
handle only the case of a completed reassembly (fd_head != NULL) so that
we can use it in those dissectors without gunking the code up too much.

svn path=/trunk/; revision=7513
2003-04-20 11:36:16 +00:00
Guy Harris 90a5d166ff Don't put "[DCE/RPC fragment]" into the Info column if the packet isn't
fragmented.

"PFC_NOT_FRAGMENTED()" is checked early in "dissect_dcerpc_cn_stub()";
there's no need to check it again in either of the code paths after
that, as we know it's true in the first code path and false in the second.

svn path=/trunk/; revision=7460
2003-04-15 08:04:54 +00:00
Ronnie Sahlberg ef8d406bd4 Reassembly of DCE/RPC fragments for Request packets was slightly broken.
Fixed this and rewrote the fragment reassembly routine to make it
cleaner and hopefully easier to read.

svn path=/trunk/; revision=7453
2003-04-14 13:22:13 +00:00
Guy Harris 60b0e61772 Do the same for dissect_ndr_char_cvstring.
svn path=/trunk/; revision=7383
2003-03-31 07:26:18 +00:00
Ronnie Sahlberg b8e3c33edb change dissect_ndr_wchar_cvstring so that it uses the hf_index the dissector has passed to it and not the generic dcerpc_character_buffer.
we need this to be able to filter for various dcerpc related strings such as lsa.domain

svn path=/trunk/; revision=7356
2003-03-17 09:42:12 +00:00
Jörg Mayer 9281a04064 Pointer <--> int converions cause warnings on ia64.
Modified a patch originally contained in the SuSE distro
to do the conversions via glib macros.

svn path=/trunk/; revision=7330
2003-03-10 02:06:33 +00:00
Guy Harris 05c41a279f Use the reported length, not the captured length, as the fragment length
when doing reassembly.

In some additional places, use "tvb_bytes_exist()" to check whether we
have enough data to do reassembly, rather than checking to see if the
frame is short (it might be short but we might still have enough data to
do reassembly).

In DCE RPC, use the fragment length from the header as the number of
bytes of fragment data.

There's no need to check "pinfo->fragmented" before doing reassembly in
the DCERPC-over-SMB-pipes code - either we have all the data or we
don't.

In SNA and WTP reassembly, add a check to make sure we have all the data
to be reassembled.

svn path=/trunk/; revision=7282
2003-03-05 07:17:50 +00:00
Guy Harris e345e5640e Rename "fake_unicode()" to "tvb_fake_unicode()" as it works on a tvbuff,
give it a byte-order argument, and move it to "epan/tvbuff.c".

Use it to handle UCS-2 strings in version 1 of the Service Location
Protocol.  In SRVLOC V1, use registered fields that are already there
for SRVLOC V2, and add some as needed.  Fix some field names.

svn path=/trunk/; revision=7186
2003-02-24 01:22:30 +00:00
Guy Harris 6ce26a1eba Well, perhaps that padding really *is* padding, or maybe it's some other
gunk stuck in there to make NTLMSSP happy (perhaps the encrypted body
length has to be a multiple of 16 bytes or something such as that for
the encryption to work).

No packet in any capture I have appears to be misdissected if you get
rid of the mod 4 stuff, so I'm removing it.

svn path=/trunk/; revision=7181
2003-02-21 04:31:38 +00:00
Guy Harris aa710fd9cd When putting the lowest-level protocol tree item in for a Unicode
string, use the "fake Unicode" value for it.

svn path=/trunk/; revision=7119
2003-02-11 02:18:27 +00:00
Tim Potter 16ccbfd1b3 In dissect_ndr_cvstring(), return string data even if tree == NULL.
svn path=/trunk/; revision=7114
2003-02-10 06:25:10 +00:00
Tim Potter b3760c6e43 Added a comment about the length argument to fake_unicode. It should be
the number of guint16's to convert from unicode.

Allow dissect_ndr_cvstring to return a malloced copy of the string.

svn path=/trunk/; revision=7108
2003-02-10 02:05:24 +00:00
Guy Harris 47be088068 Fix some comments.
svn path=/trunk/; revision=7097
2003-02-07 22:49:35 +00:00
Guy Harris e9f0f4b74f Rename "dissect_ndr_char_string()" and "dissect_ndr_wchar_string()" to
"dissect_ndr_char_cvstring()" and "dissect_ndr_wchar_cvstring()", to
indicate that they're for conformant varying strings.

Rename "dissect_ndr_character_array()" to "dissect_ndr_cvstring()", to
indicate that it's for conformant varying strings.

svn path=/trunk/; revision=7096
2003-02-07 22:44:54 +00:00
Guy Harris 9a348d5736 Rename "dissect_ndr_char_array" and "disect_ndr_wchar_array" to
"dissect_ndr_char_string" and "dissect_ndr_wchar_string", to make it
clearer what it does.

svn path=/trunk/; revision=7095
2003-02-07 22:31:32 +00:00
Guy Harris c8386a5829 Catch ReportedBoundsError when dissecting even non-encrypted stub data,
so that even if the stub data is bad, we still dissect and show the
verifier.

svn path=/trunk/; revision=7092
2003-02-07 19:45:56 +00:00
Guy Harris 579d05d1f3 Fix a typo in the multiple-include protection in "packet-dcerpc-nt.h".
Rename "dissect_ndr_element_array()" to "dissect_ndr_character_array()",
move it out of "packet-dcerpc-nt.c" to "packet-dcerpc.c", and have it
use the standard DCE RPC array max count/offset/count fields rather than
their own private versions of those fields.  Give it an option to create
a subtree, and an argument to specify the field to use for the actual
data buffer, and export it.

Move the routines for handling arrays of "char" and "wchar" as strings
out of "packet-dcerpc-nt.c" to "packet-dcerpc.c".

Add a routine to handle an array of "char" as an opaque blob of bytes.

Use "dissect_ndr_character_array()" to dissect character strings in MAPI
(the strings in question are ASCII, not Unicode), and use the routine to
handle an array of "char" as an opaque blob of bytes to dissect
encrypted data (again, it's bytes, not 16-bit quantities).  Show them as
encrypted data, not unknown data.

Use "dissect_ndr_character_array()" to dissect a form name in
"dissect_form_name()" in the SPOOLSS dissector.

svn path=/trunk/; revision=7091
2003-02-07 08:56:12 +00:00
Tim Potter 11c39f58ab Make the dcerpc.request_in and dcerpc.response_in fields FT_FRAMENUM's.
svn path=/trunk/; revision=7074
2003-02-05 01:23:41 +00:00
Tim Potter 2bccc6dcf0 Replace the 'levels' argument to dissect_ndr_pointer() with a callback
function and a void * callback args.  The callback is executed after
the dissection of the ndr pointer buffer which may be called,
depending on the number of pointers in the structure, after the return
of the dissect_ndr_pointer() call.

The callback function is of type:

void (dcerpc_callback_fnct_t)(packet_info *pinfo, proto_tree *tree,
proto_item *item, tvbuff_t *tvb, int start_offset, int end_offset,
void *callback_args);

where the proto tree and item are the tree and item created by
dissect_ndr_pointer() and the tvb plus offsets are the buffer pointed
to by the pointer.

svn path=/trunk/; revision=7015
2003-01-28 06:17:09 +00:00
Jörg Mayer a245e3742d Add a missing include packet-dcerpc-nt.h
svn path=/trunk/; revision=6999
2003-01-24 21:10:40 +00:00
Tim Potter 2213ef6aaa Perform the initialisation for the NT specific DCERPC dissectors as part
of the DCERPC dissector instead of creating a dummy protocol to hang
the ett and hf values off.

Make the open and close frame values in NT policy handles FT_FRAMENUM's
so the "Go to Corresponding Frame" menu item can be used on them.

svn path=/trunk/; revision=6995
2003-01-24 05:32:54 +00:00
Guy Harris 75dbe3e0b1 Catch ReportedBoundsError exceptions when dissecting decrypted stub
data, as the error could be due to the decryption being bad, and we
should still dissect the authentication data.

svn path=/trunk/; revision=6924
2003-01-14 22:03:33 +00:00
Ronnie Sahlberg a80ddab6fd Update DCERPC so that for (NTLMSSP) PDUs that have been decrypted
we also call the proper DCERPC subdissector.

With this change ethereal will call the SAMR dissector and dissect the
decrypted SAMR packets in devins capture.

svn path=/trunk/; revision=6855
2003-01-06 11:27:03 +00:00
Guy Harris bc0e186eef Fix a braino in a last-minute fix I put into the previous checkin.
svn path=/trunk/; revision=6826
2002-12-31 08:08:19 +00:00
Guy Harris 3a92530a52 From Devin Heitmueller: support for decrypting DCERPC conversations
using NTLMSSP version 1.

Show stub data as such for all requests and replies where we can't
dissect the stub data as a request or reply for some DCERPC-based
protocol.

svn path=/trunk/; revision=6825
2002-12-31 08:05:29 +00:00
Ronnie Sahlberg e4633bc783 Update reassemble.c/show_item and all callers to use FT_FRAMENUM for the list of packets corresponding to a reassembled pdu
svn path=/trunk/; revision=6807
2002-12-19 11:22:38 +00:00
Guy Harris 73a5a10d7a When processing a connection-oriented DCERPC PDU, don't set the columns
until we know that we have the entire PDU - we might not have all of it,
as some of it might be in, for example, a later TCP segment.

svn path=/trunk/; revision=6785
2002-12-14 23:44:48 +00:00
Guy Harris 79275e0079 From Devin Heitmueller:
Minor change to the connection oriented DCE/RPC function calls.
	Now the offset is provided in the call, instead of having a
	hard-coded value in each function.  Also makes the calling
	convention consistent with the datagram equivalents for the
	functions.

	Didn't do it for dissect_dcerpc_cn_auth() yet, as that is a
	special case (and I am in the process of restructuring it to
	make verifier decryption work properly).

svn path=/trunk/; revision=6778
2002-12-11 19:50:24 +00:00
Guy Harris 49157b5f2c It seems pretty clear that a PDU_AUTH3 really is an AUTH3 PDU, and we
know what it is (a PDU for the third stage in a 3-way authentication
handshake, as is done with NTLMSSP authentication, for example) - get
rid of the question mark after "AUTH3".

svn path=/trunk/; revision=6746
2002-12-05 18:26:10 +00:00
Guy Harris a56c79201d Arguments to hash routines are gconstpointer's; assign them to const
pointers.

The first argument to "sscanf()" is a "const char *"; don't cast const
pointers to "char *" when passing them to "sscanf()".

Assign the result of "tvb_get_ptr()" to const pointers, not non-const
pointers.

Make the "pdata" argument to various DCE routines a const pointer.

svn path=/trunk/; revision=6688
2002-11-28 03:57:50 +00:00
Guy Harris 262744d2b2 Dissect NTLMSSP authentication verifiers, as per lkcl's "DCE/RPC over
SMB" book.

svn path=/trunk/; revision=6598
2002-11-10 09:38:22 +00:00
Guy Harris 3b71004a61 In connection-oriented DCE RPC, the authentication data are credentials
only in bind, bind_ack, alter_context, alter_context_response, and auth3
PDUs; they're a verifier of some sort in other PDUs.  The verifier
appears to start with an OID for the real authentication mechanism if
the authentication type is SPNEGO.

svn path=/trunk/; revision=6563
2002-11-05 21:41:27 +00:00
Guy Harris ee0c06e961 Use the full name of the "hf_dcerpc_obj_id" field when formatting the
protocol tree item for it.

Fix a typo.

svn path=/trunk/; revision=6555
2002-11-03 20:34:54 +00:00
Ronnie Sahlberg d5e3008fff From Jean-Baptiste Marchand update the proto_tree_add_ for UUIDs in the
dcerpc layer (and the subdissectors using dissect_ndr_uuid_t()) so that
it is possible to use display filters on these items.

svn path=/trunk/; revision=6547
2002-11-02 22:14:21 +00:00
Guy Harris 35c1970720 From Ronnie Sahlberg: Ethereal support for DCERPCSTAT.
svn path=/trunk/; revision=6499
2002-10-25 01:08:49 +00:00
Guy Harris 07d0032f1c Add a "fragment_add_seq_next()" to reassemble fragments that don't have
sequence numbers or offsets and are thus assumed to be received in order
with no duplicates or dropped fragments (e.g., for NetBIOS Frame, where
802.2 LLC guarantees in-order delivery to NetBIOS with no duplicates or
dropped fragments).

"show_fragment_tree()' and "show_fragment_seq_tree()" don't modify the
"fragment_items" to which the "fit" argument points, so make that
argument a "const fragment_items *".

Make all the "fragment_items" tables "static" (as they're not used
outside the modules defining them) and "const" (as they're not
modified).

Add support for reassembly of NetBIOS fragmented requests and responses.

Get rid of an unnecessary include of "packet-tr.c" in the NetBIOS
dissector, and make its table of dissection function pointers static.

Fix some typos in the AppleTalk and NetBIOS dissectors.

svn path=/trunk/; revision=6491
2002-10-24 06:17:36 +00:00
Guy Harris a71d1d910e From Ronnie Sahlberg: add a tap for statistics for DCERPC interfaces.
svn path=/trunk/; revision=6479
2002-10-23 03:49:13 +00:00
Guy Harris abbd3e0dea From Ronnie Sahlberg: track and display the time between requests and
replies for DCERPC similar to what is already done for ONC-RPC.

svn path=/trunk/; revision=6465
2002-10-22 00:59:25 +00:00
Ronnie Sahlberg 8ca1d857f6 From Jaime Fournier: updates to dcerpc conversation manager
svn path=/trunk/; revision=6339
2002-09-26 06:13:08 +00:00
Guy Harris 3b0ab19194 Dissect the autentication verifier for Kerberos 5 authentication in
connectionless PDUs.

svn path=/trunk/; revision=6240
2002-09-09 22:11:33 +00:00
Tim Potter 0e5cdab1da Auth type 8 is NETLOGON secure channel used for BDC replication.
svn path=/trunk/; revision=6230
2002-09-08 12:04:42 +00:00
Ronnie Sahlberg 957f38e57c From Ulf Lamping, support for ieee float and double types in the dcerpc
dissectors.

svn path=/trunk/; revision=6170
2002-09-03 08:39:16 +00:00
Tim Potter 795a06fa0d snego -> spnego
svn path=/trunk/; revision=6138
2002-08-30 05:13:45 +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 66bc3e597f These guys got lost in a merge. Actually call the gssapi dissector from
the relevant parts of the SMB and DCERPC dissectors.

svn path=/trunk/; revision=6066
2002-08-22 20:04:55 +00:00
Tim Potter 60e4ca9c4f Moved the generic true_false_string saying "Set", "Not set" into
epan/packet.c

It was cut and pasted into seven other dissectors!

svn path=/trunk/; revision=6052
2002-08-21 21:25:23 +00:00