Commit Graph

27 Commits

Author SHA1 Message Date
Guy Harris 857318d3b7 Use "tvb_get_string()" instead of allocating a (len+1)-sized buffer,
"tvb_memcpy()"ing to it, and putting in a null terminator;
"tvb_get_string()" will check whether all bytes of the string are
present before allocating the buffer, so that you don't leak memory if
the copy throws an exception, and don't crash if the length is absurdly
large.

Use "tvb_memdup()" instead of allocating a buffer and "tvb_memcpy()"ing
to it, so that an exception is thrown before you try to allocate the
buffer (for the same reasons as listed above).

Before allocating a buffer used when processing a chunk of data from a
packet, get a pointer to the chunk with "tvb_get_ptr()", or check that
the data is all there with "tvb_ensure_bytes_exist()", so that an
exception is thrown before you try to allocate the buffer (for the same
reasons as listed above).

Fix up the lengths of the tvbuff used when dissecting ONC RPC opaque data
with a particular dissector.

svn path=/trunk/; revision=10236
2004-02-25 09:31:07 +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 3a23c4e4b7 From Jean-Baptiste Marchand: add more MAPI procedure names.
svn path=/trunk/; revision=8769
2003-10-24 00:42:16 +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
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 ef77cb578a In the policy handle hashing, handle more than one policy handle having
the same value, as an open might return handle XXX, handle XXX might
then be closed, and a subsequent handle might return handle XXX, and we
want to keep the two handles distinct to avoid, for example, displaying
handles closed before they're opened.

In policy handle open replies, store the handle name only if the
operation succeeded.  We can now do that without parsing the packet
twice.

Have "dissect_nt_policy_hnd()" optionally return, through a pointer, the
protocol tree item for the handle, so that its caller can decorate the
item with the name of the handle - that's done on opens, where we do
that only if the operation succeeds.

svn path=/trunk/; revision=7787
2003-06-05 04:22:04 +00:00
Guy Harris 9f089e90d8 A quantity dissected as 6 unknown bytes in a logon reply actually
appears to be a 4-byte aligned quantity, with the other 2 bytes
presumably seen by whoever added the code to dissect those 6 bytes
being, most likely, padding to align the 4-byte quantity.

svn path=/trunk/; revision=7660
2003-05-10 02:15:04 +00:00
Tim Potter e447ba4fdf Use new format of dissect_ndr_cvstring() function.
svn path=/trunk/; revision=7110
2003-02-10 02:07:15 +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 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 6b8a47a691 Convert to new DCERPC string handling functions. There are still some
cosmetic bugs to work out though.

svn path=/trunk/; revision=7069
2003-02-03 02:14:01 +00:00
Guy Harris 231f28ce08 Panic if a preference starts with the name of the module to which it
belongs, as that's redundant.

Fix a bunch of cases where that was done, and map the old name to the
new name.

Instead of marking "mtp3.mtp3_standard" as obsolete, map it to
"mtp3.standard".

svn path=/trunk/; revision=7030
2003-01-28 23:56:40 +00:00
Tim Potter 1d6acba45c Convert dissector to callback based version of dissect_ndr_pointer().
Strings that used to call with levels != -1 should call the
callback helper which will append the string to the pointer item.

svn path=/trunk/; revision=7017
2003-01-28 06:39:41 +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
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 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
Ronnie Sahlberg 4c7dd2df0b Fixed bug in MAPI
If we had unreassebled DCERPC PDUs but had
decryption of MAPI enabled we would try to read too much data from the
tvbuff and ethereal would later dump core.

svn path=/trunk/; revision=5673
2002-06-15 22:24:31 +00:00
Guy Harris 392a7dfc04 Get rid of the "data_src" member of the "frame_data" structure; put it
in the "packet_info" structure instead, as we don't need a pointer for
every single frame in the capture file, just for each frame for which we
currently have an open "epan_dissect_t".

svn path=/trunk/; revision=5614
2002-06-04 07:03:57 +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
Ronnie Sahlberg 762981c66a Fix for bug when displaying selected item in hexpanel. 2 bytes too many were
highlited.

svn path=/trunk/; revision=5562
2002-05-25 11:26:30 +00:00
Guy Harris 3e001f70da Throw in a cast to squelch a compiler complaint ("unsigned short" +
"int" constant becomes "int", and comparing that with "unsigned int"
gives a "signed vs. unsigned comparison" warning, even though the "int"
constant in question is positive).

svn path=/trunk/; revision=5559
2002-05-25 10:25:27 +00:00
Ronnie Sahlberg e8a006b280 Some additional decoding of the decrypted MAPI PDU in opcode:2.
Length byte and some sort of trailer identified.

svn path=/trunk/; revision=5558
2002-05-25 09:19:45 +00:00
Ronnie Sahlberg 5887e9a997 MAPI new option. New option to decrypt the MAPI opnum 2 payload.
svn path=/trunk/; revision=5557
2002-05-25 08:41:12 +00:00
Ronnie Sahlberg 96da8b00b7 MAPI Logoff function fully decoded.
Ha, if the other functions are as
easy to figure out i will be a happy boy.

svn path=/trunk/; revision=5533
2002-05-23 12:48:28 +00:00
Ronnie Sahlberg c33e33fb7e Additions to the MAPI dissector. Function 02 for MAPI.
The function request/call are dissected but the main body of the function
in/out parameters consists of a unidimensional conformant and varying array of bytes which content is encrypted/obfuscated.
Whoever can tell me how to decrypt/unobfuscate these bytes will get
a case of VB next time in Sydney.

svn path=/trunk/; revision=5532
2002-05-23 12:23:29 +00:00
Ronnie Sahlberg c01a2aa70b Added stub for MS Exchange MAPI protocol.
If anyone has a better name they are welcome to change it.
Perhaps we can now remove the packet-mapi.c dissector.

svn path=/trunk/; revision=5530
2002-05-23 10:00:19 +00:00