Commit Graph

79 Commits

Author SHA1 Message Date
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Stefan Metzmacher 04bd19d3c2 packet-dcerpc-nt.c: fix a crash bug
Change-Id: Ia8d167afc79c4fa1b2fa05b78152120203462b67
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/362
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-25 17:56:09 +00:00
Evan Huus a6415ece0a Rename a couple of to_str functions to have ep_ in the name. This makes it
obvious that the returned string is ephemeral, and opens up the original names
in the API for versions that take a wmem pool (and thus can work in any scope).

svn path=/trunk/; revision=54249
2013-12-19 15:49:09 +00:00
Guy Harris 068008f04f Use proto_tree_add_item() in preference to fetching the string and
adding it with proto_tree_add_string().  Use tvb_get_string_enc() rather
than tvb_get_unicode_string() to fetch strings.

We assume a UTF-16 encoding for all "Unicode" strings.

Use tvb_strsize() and tvb_unicode_strsize() to get the lengths of
null-terminated strings.

Get rid of unused ett_nt_unicode_string variable.

svn path=/trunk/; revision=54158
2013-12-16 22:39:41 +00:00
Bill Meier 04cdccdb83 - Create/use several extended value_strings
(sort associated value_string arrays as needed);

- Use new VALUE_STRING_LIST mechanism/macros to
  create enums and value_string arrays for:
    WERR_errors, DOS_errors, SRV_errors, and HRD_errors;

- Declare certain global value_string arrays as static (local)
  and use global extended value_strings to reference same;
    (e.g., ms_coiuntry_codes value_string_array)

- Rename SMBE_... defs used in several different value_string arrays
  to prevent potential name collisions:
   ( e.g., for SRV_errors: SMBE_... ==> SMBE_SRV_...)
   Done for value_string arrays: DOS_errors, SRV_errors, HRD_errors;

- WERR_errors value_string array:
    Note that WERR associated defs no longer exist in the latest samba doserr.h.
    (The WERR_errors defs were originally generated from the samba doserr.h).
    For now: WERR_errors kept as is.

- ToDo: Fix PIDL-generated dcerpc dissectors to use NT_errors_ext
        and WERR_errors_ext extended value_strings.

- Add editor modelines to a few files.

- Make whitespace changes.


svn path=/trunk/; revision=53614
2013-11-27 16:30:20 +00:00
Michael Mann e2df7c83cb Move dceprc_procedure_name from packet_info to dcerpc_info. Doesn't appear to be "used" by dissectors, just stored (for help in debugging?).
svn path=/trunk/; revision=53552
2013-11-24 20:55:55 +00:00
Evan Huus 5efc340771 Mark more unused parameters.
svn path=/trunk/; revision=53109
2013-11-06 17:52:11 +00:00
Michael Mann c278a0ac0a SID28 is special kind of SID where no matter what it uses 28 bytes it's used in the DRS protocol. Bug 9337 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9337)
From Matthieu Patou

svn path=/trunk/; revision=53106
2013-11-06 16:30:14 +00:00
Michael Mann 22760b2d2a Remove pinfo->private_data from DCERPC dissectors and instead have dcerpc_info* infomation be passed in as a function parameter. Bug 9387 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9387)
All "generated" source was manually modified (with the power of search/replace), but I believe the "source input" files have been adjusted (checked into revs 53098 and 53099) to reflect the necessary changes (with possible whitespace formatting differences).

The Microsoft compiler doesn't flag "unused function parameters", so I apologize in advance if I may have missed a few.  The "dcerpc_info* di" parameter is used in almost every function.

svn path=/trunk/; revision=53100
2013-11-06 14:31:29 +00:00
Michael Mann 651b858892 Fix compile errors introduced in r52734.
svn path=/trunk/; revision=52735
2013-10-21 15:58:52 +00:00
Michael Mann 598726be02 Datablob size is NDR64/32 dependant. Bug 9301 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9301).
From Matthieu Patou

svn path=/trunk/; revision=52734
2013-10-21 15:50:23 +00:00
Michael Mann 55371ca87d Remove check_col for all non-generated DCE/RPC dissectors.
svn path=/trunk/; revision=52310
2013-10-01 13:02:12 +00:00
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Evan Huus 6df83e8078 Add _g_ to the names of functions that allocate glib memory. This is a bit more
explicit, and frees up the "generic" names (like tvb_memdup) for new signatures
that take the appropriate wmem pool.

Majority of the conversion done with sed.

svn path=/trunk/; revision=52164
2013-09-21 17:04:41 +00:00
Pascal Quantin 074349264e Convert some dissectors to wmem (leaving uat-like memory with emem for now)
svn path=/trunk/; revision=52031
2013-09-14 10:53:29 +00:00
Pascal Quantin 0a17799d61 From Ed Beroset via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 :
Remove C++ incompatibilities from most of the dcerpc code

svn path=/trunk/; revision=48023
2013-03-02 22:54:39 +00:00
Bill Meier 329f6e8cc0 Initialize some hf_... vars to -1;
(Reduces the number of checkhf false positives)

svn path=/trunk/; revision=47310
2013-01-26 21:42:36 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Jakub Zawadzki 835a1a1b9c Fix memleaks (tvb_get_unicode_string())
svn path=/trunk/; revision=44053
2012-07-26 17:26:05 +00:00
Bill Meier 9e7c7e7d10 From Evan Huus: Fix "Useless null checks in packet-dcerpc*"
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7448

svn path=/trunk/; revision=43599
2012-07-07 14:21:20 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Bill Meier f0c3ee5c4a Whitespace cleanup: Indentation, trailing, ...
svn path=/trunk/; revision=42266
2012-04-26 16:05:05 +00:00
Ronnie Sahlberg bd83ae6dbb DCE/RPC: When printing counted strings to the tree, we divided the number of bytes by 2 and thus truncating the string in half for the presentation.
svn path=/trunk/; revision=40226
2011-12-16 03:44:43 +00:00
Bill Meier d7a1840204 Replace use of tvb_get_ephemeral_faked_unicode() by use of tvb_get_ephemeral_unicode_string();
Fix encoding arg as needed.

svn path=/trunk/; revision=39530
2011-10-23 22:58:45 +00:00
Chris Maynard e672fdc60f Since the call to expert_add_info_format() was commented out, 'ti' isn't needed, so get rid of it. Fixes Coverity CID's 1260 and 1261.
svn path=/trunk/; revision=39057
2011-09-19 20:49:28 +00:00
Ronnie Sahlberg 7ec441d440 DCE/RPC: FRSRPC: updates to the FRS dissector
From: Matthieu Patou <mat@matws.net>


svn path=/trunk/; revision=38958
2011-09-10 11:15:20 +00:00
Ronnie Sahlberg 788dc6230a From Matthieu Patou <mat@matws.net>
Add new helper function for DCE/RPC NDR data blobs


svn path=/trunk/; revision=38472
2011-08-11 07:48:02 +00:00
Ronnie Sahlberg c667e67fb7 From Matthieu Patou <mat@matws.net>
Add two helper functions to dissect null terminated ascii and wchar strings in dcerpc



svn path=/trunk/; revision=38471
2011-08-11 07:42:25 +00:00
Guy Harris c34b796445 Add a DREP_LITTLE_ENDIAN for the DCE RPC endianness bit in the data
representation.  Use it rather than a raw 0x10.

Add a DREP_ENC_INTEGER() macro that takes a pointer to the data
representation and returns either ENC_LITTLE_ENDIAN or ENC_BIG_ENDIAN;
use it for the encoding argument to proto_tree_add_item(), rather than
just the AND of drep[0] and DREP_LITTLE_ENDIAN, as it's not a boolean
any more, and for string values we'll be supporting character encodings
as well and thus won't be able to trust that the 0x10 bit will mean
"little endian".

Use ENC_NA for some other encoding values, i.e. for FT_BYTES and the
like.

Fix a couple of places in the DCOM dissector where we were passing the
byte-order bit rather than the field value to
proto_tree_add_uint_format().

Clean up white space.

svn path=/trunk/; revision=38128
2011-07-19 23:02:02 +00:00
Guy Harris b02af4355c Make sure the SID string attached to a dcerpc_call_value has session
duration, just as the dcerpc_call_value itself does.

svn path=/trunk/; revision=37951
2011-07-10 17:57:39 +00:00
Jeff Morriss 0ff5638f37 Replace blurbs that match the name (case insensitive) with NULL.
svn path=/trunk/; revision=34227
2010-09-23 21:46:31 +00:00
Ronnie Sahlberg a06266a983 From: Stefan Metzmacher <metze@samba.org>
fix crash bug in dcerpc nt


svn path=/trunk/; revision=31792
2010-02-04 23:13:05 +00:00
Ronnie Sahlberg 3bb1c2cbd4 From Matthieu Patou
schannel decryption


svn path=/trunk/; revision=30631
2009-10-20 08:44:26 +00:00
Stig Bjørlykke e0fbe7624b Make ett_nt_unicode_string static.
svn path=/trunk/; revision=30507
2009-10-11 14:32:36 +00:00
Ronnie Sahlberg 75b1534c7f more updates to samr to harmonize it with samba
svn path=/trunk/; revision=30354
2009-10-06 08:07:17 +00:00
Ronnie Sahlberg b6479d592c update the string helpers to be ndr64 aware
svn path=/trunk/; revision=30285
2009-10-04 08:11:09 +00:00
Ronnie Sahlberg c0e3180e9b update dissect_ndr_nt_PSID_ARRAY() to be ndr64 aware
svn path=/trunk/; revision=30283
2009-10-04 07:57:45 +00:00
Ronnie Sahlberg 343b961a48 rename dissect_ndr_4or8 to dissect_ndr_uint3264 to match hte name of
the new datatype uint3264.
create a fake guint3264 type as well


svn path=/trunk/; revision=30264
2009-10-03 05:16:51 +00:00
Ronnie Sahlberg ec886a00e2 make dissect_ndr_nt_SID handle ndr64
svn path=/trunk/; revision=30262
2009-10-03 03:50:30 +00:00
Ronnie Sahlberg d69e9a3a05 The dcerpc dissectors used to walk the list of items upward parent by
parent in order to push teh display of extra interesting fields in the 
packet to higher up in the decode tree. This was useful for making sure 
that things like DomainNames etc are clearly visible without having to 
drill down 500 layers of NDR.

This code used to just blindly walk the indicated number of parents, and 
then attach the string to that item.
This relied on the "unsafe" assumption that the topmost item would have 
pointer point to itself, so this was "safe".

This is no longer safe since the root object in the tree now has NULL as 
parent, and thus some of these dcerpc interfaces can now cause a SEGV 
trying to dereference NULL->parent.


I added a macro to safely walk to the parent object, or remain at the 
current object if parent is NULL.



This was a serious bug, where dcerpc traffic could cause a SEGV.
Please merge into all stable versions.





svn path=/trunk/; revision=30208
2009-09-30 07:53:12 +00:00
Stig Bjørlykke b228488bc0 From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
    for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
    FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero

svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
Stig Bjørlykke 58e2d7a0d6 Fix some "format not a string literal and no format arguments" warnings.
svn path=/trunk/; revision=26649
2008-10-31 15:47:47 +00:00
Guy Harris 3ac07269e6 Fix a missed "item" -> "item_local" in the previous checkin.
svn path=/trunk/; revision=25610
2008-06-26 02:29:13 +00:00
Bill Meier ceebccced4 Fix some warnings reported by gcc -Wshadow ...
svn path=/trunk/; revision=25607
2008-06-26 00:16:58 +00:00
Jeff Morriss a215dadd21 pol_value->name was g_malloc()'d which meant we needed to go through the hash table to free them all. But, like in http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1113 the pol_value's themselves are se_ allocated so they have already been freed when we want to traverse them. So, make pol_value->name se_ allocated so we don't have to do any cleanup on the hash table.
svn path=/trunk/; revision=24668
2008-03-17 17:40:54 +00:00
Bill Meier bad9f18d33 Fix (Sun) compiler warnings as reported by David Kirkby: Part 1
svn path=/trunk/; revision=24295
2008-02-09 23:35:28 +00:00
Stig Bjørlykke d5d2e97b47 Fixed some more malloc -> g_malloc, free -> g_free, strdup -> g_strdup.
svn path=/trunk/; revision=24180
2008-01-24 19:30:43 +00:00
Richard van der Hoff e704e4c8c4 From Chris Maynard <christopher.maynard@gtech.com> / Bug 1798: packet-d*.c display filter fields incorrectly named.
svn path=/trunk/; revision=23090
2007-10-08 00:32:03 +00:00
Ronnie Sahlberg 8fde3b7561 rename dcerpc_smb_store_pol_name to dcerpc_store_polhnd_name
rename dcerpc_smb_fetch_pol  to dcerpc_fetch_polhnd_data and also make 
it take an additional parameter to return the "type" of the policy 
handle, if such a type was stored.

extend the pol_value structure used to track policy handles to also 
store a type to represent what created the policy handle
types could be USER/ALIAS/CONNECT/... etc handles returned from the 
SAMR interface

add a new helper function  dcerpc_store_polhnd_type()

track policy handles between request/responses for dcerpc

update the samr.cnf file to make the samr dissectors for
SetSecurity/QuerySecurity dissect the specific bits for the security 
descriptor correctly based on whether the policy handle refers to a 
CONNECT/DOMAIN/USER/ALIAS or GROUP



svn path=/trunk/; revision=22703
2007-08-28 11:45:08 +00:00