Commit Graph

53 Commits

Author SHA1 Message Date
moshekaplan cd7026951b Fix a lot of typos and misspellings
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3
Reviewed-on: https://code.wireshark.org/review/13069
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-08 20:04:56 +00:00
Pascal Quantin f02d9b4613 C12.22: fix compilation without Libgcrypt
Change-Id: I9ef842b4ed543cfbd199e49496bc01a09f71404b
Reviewed-on: https://code.wireshark.org/review/13039
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-01-04 11:31:40 +00:00
Guy Harris 1b444a7e5d ifdef out the decryption code and preferences if LIBGCRYPT isn't defined.
Change-Id: Idf4f1e461d3bc6e85f2760488ad566a4cd70c5ea
Reviewed-on: https://code.wireshark.org/review/12999
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-01 20:48:27 +00:00
Michael Mann a391a70b3b "new" dissector API -> dissector API for ASN.1 dissectors.
Change-Id: I7b794cba2feda2cae40411e2b1cb9fb091d08220
Reviewed-on: https://code.wireshark.org/review/12480
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 03:12:23 +00:00
Pascal Quantin aa3870f54d C12.22: check c1222_baseoid_len before doing a memcpy
Should fix the following runtime error reported by Joerg:
../../asn1/c1222/packet-c1222-template.c:1427:3: runtime error: null pointer passed as argument 1, which is declared to never be null
../../asn1/c1222/packet-c1222-template.c:1427:3: runtime error: null pointer passed as argument 2, which is declared to never be null

Change-Id: I2f952815ed81e47b504e6479835a357b7656828e
Reviewed-on: https://code.wireshark.org/review/8251
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-05-01 07:59:20 +00:00
AndersBroman 5fa267e870 REplace deprecated API tvb_length -> tvb_reported_length
Change-Id: I6090055a9c31f6787626b810de655d1cc71b99de
Reviewed-on: https://code.wireshark.org/review/8002
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-09 12:03:23 +00:00
Guy Harris 859511db14 Make UAT record update callbacks return a success/failure indication.
Have them return TRUE on success and FALSE on failure.  Check the return
value rather than whether the error string pointer is null or not.

Change-Id: I800a03bcd70a6bbb7b217cf7c4800e9cdcf2189c
Reviewed-on: https://code.wireshark.org/review/7222
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-18 00:41:09 +00:00
Hadriel Kaplan ceb8d954d2 Lua: Expose tcp_dissect_pdus() to Lua
Provide a way for Lua-based dissectors to invoke tcp_dissect_pdus()
to make TCP-based dissection easier.

Bug: 9851
Change-Id: I91630ebf1f1fc1964118b6750cc34238e18a8ad3
Reviewed-on: https://code.wireshark.org/review/6778
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-01-27 15:14:12 +00:00
Michael Mann e333e4c90f Convert OID APIs to use wmem.
There are a few oid functions that are only called in oids_test.c.  I'll presume the APIs are used in proprietary dissectors rather than just remove them.

Change-Id: I4595e00f93bf9ab8cf2493fe0432b91960f55a3f
Reviewed-on: https://code.wireshark.org/review/6592
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-19 02:52:11 +00:00
Guy Harris bc23f79729 UAT error string pointers should not be const pointers.
UAT error strings are usually allocated by g_strdup() or
g_strdup_printf(), and must ultimately be freed by the caller.

Make the pointer-to-error-string-pointer arguments to various functions
be "char **", not "const char **".

Fix cases that finds where a raw string was being used, as that won't
work if you try to free it; g_strdup() it instead.

Add a missing free of an error string.

Remove some no-longer-necessary casts.

Remove some unnecessary g_strdup()s (the string being handed to it was
already g_malloc()ated).

Change some variable declarations to match.

Put in XXX comments for some cases where the error string is just freed,
without being shown to the user.

Change-Id: I40297746a2ef729c56763baeddbb0842386fa0d0
Reviewed-on: https://code.wireshark.org/review/6525
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-13 20:20:03 +00:00
Michael Mann 64a7bac641 tvb_bytes_to_ep_str -> tvb_bytes_to_str
Change-Id: I79c613cbdd8dc939dd4c29ebc477fb6eefd5bfc4
Reviewed-on: https://code.wireshark.org/review/6371
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-07 18:16:23 +00:00
Bill Meier dd859eada4 asn1 generated dissectors: cleanup #include usage
Change-Id: I36b2731d67f9345d2fd0c23800bba7d2be94c387
Reviewed-on: https://code.wireshark.org/review/6008
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-23 05:39:00 +00:00
Alexis La Goutte 5248c0df21 Fix unknown command tag name [-Wdocumentation-unknown-command]
Change-Id: I6c2564a86e13d9321001856ba1f51681a9f20976
Reviewed-on: https://code.wireshark.org/review/5979
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-12-22 15:24:28 +00:00
Stig Bjørlykke 4e1b5ea866 ASN1: Register PDU-dissectors as NEW
Change-Id: I1a317b19d8076588c9305dae6287bb80cc14da64
Reviewed-on: https://code.wireshark.org/review/4494
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-10-13 11:24:07 +00:00
Evan Huus 5ed05dd747 batch of manual tvb_length conversions
Change-Id: Ib3a1ddc4342a7a8648d6ed8bfcb35aa229c56a27
Reviewed-on: https://code.wireshark.org/review/2445
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 19:55:31 +00:00
Pascal Quantin d0ac937567 Revert "Update ASN.1 source files with the API changes done in g021e7af"
This reverts commit e308e7c4de.

Change-Id: I079616d63f643f79f1bc03ef5fdf724f36df4071
Reviewed-on: https://code.wireshark.org/review/2435
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-19 18:42:28 +00:00
Pascal Quantin 248a503a97 Update ASN.1 source files with the API changes done in g971ffd6
Change-Id: Iac4952f64622cd28941f582adf54ecf7843f8c28
Reviewed-on: https://code.wireshark.org/review/2395
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-18 18:05:57 +00:00
Pascal Quantin e308e7c4de Update ASN.1 source files with the API changes done in g021e7af
Change-Id: I52ecfccbce423206242e3cf99401a8c9e1655d88
Reviewed-on: https://code.wireshark.org/review/2385
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-18 16:15:42 +00:00
Bill Meier 1dff4e309d Remove trailing whitespace from asn1 .cnf & template.[hc] files. Regenerate dissectors.
Change-Id: I0e779b2ac2f608356649c5bbfca438141070dea4
Reviewed-on: https://code.wireshark.org/review/412
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-26 19:38:21 +00:00
Jeff Morriss 8c608e6e82 Remove $Id$ from the ASN.1 dissectors and regenerate them.
Change-Id: Ie476c6f82f318188b41ed922b92c6fec119ea954
Reviewed-on: https://code.wireshark.org/review/244
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-02-18 03:05:28 +00:00
Stig Bjørlykke 3ba10a7051 Apply g4cc69483 to asn1 templates.
Change-Id: Id44ef17e7293be5d713c5e9e5d55b25194b46016
Reviewed-on: https://code.wireshark.org/review/86
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-02-03 10:05:25 +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
Anders Broman acf2fed688 - Forward declaration of register functions.
svn path=/trunk/; revision=53901
2013-12-10 06:01:16 +00:00
Michael Mann 8081cf1d90 Add data parameter to tcp_dissect_pdus() as well as convert it to using "new" style dissectors.
Now that "bytes consumed" can be determined, should tcp_dissect_pdus() take advantage of that?

Should tcp_dissect_pdus return length (bytes consumed)?  There are many dissectors that just call tcp_dissect_pdus() then return tvb_length(tvb).  Seems like that could all be rolled into one.

svn path=/trunk/; revision=53198
2013-11-09 17:46:28 +00:00
Evan Huus 95f484a91e Add a very small hack to make the UAT update callback error string freeable, and
convert all existing UAT update callbacks to use glib memory instead of
ephemeral memory for that string.

UAT code paths are entirely distinct from packet dissection, so using ephemeral
memory was the wrong choice, because there was no guarantees about when it would
be freed.

The move away from emem still needs to be propogated deeper into the UAT code
itself at some point.

Net effect: remove another bunch of emem calls from dissectors, where replacing
with wmem would have caused assertions.

svn path=/trunk/; revision=52854
2013-10-25 22:14:25 +00:00
Bill Meier f6e09faa2d From Ed Beroset: add modelines and fix irregular indenting;
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9273

This patch adds modelines and cleans up the irregular indentation of
this dissector's code.  The only other change was in
asn1/c1222/packet-c1222-template.c to consolidate an #ifdef that had a
redundant #endif (line 812) and subsequent reopening #ifdef (line
824).  The only thing between them was comments, so the span of the
original #ifdef (line 644) was simply extended by eliminating those
two lines.

The purpose for this patch is to make the file easier to edit and
understand in advance of more substantive patches later.  This patch
is intended to be easy to review by having only non-substantive
changes.


svn path=/trunk/; revision=52636
2013-10-16 00:57:28 +00:00
Evan Huus f29544f9df Add a call to tvb_ensure_bytes_exist before we allocate memory based on our
offset+size, prevents attempts to allocate outrageous memory, fixing
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9260

svn path=/trunk/; revision=52503
2013-10-10 17:44:55 +00:00
Evan Huus a50dee3286 From Ed Beroset via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9246
Fix memory leaks and bad memory accesses in c1222 dissector.

From me: use realloc in a handoff function since it may get called multiple
times, and we only need the latest.

svn path=/trunk/; revision=52497
2013-10-10 16:18:49 +00:00
Michael Mann 94f0e1fe21 Fully support relative AP-titles in C12.22. Bug 9196 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9196)
From Ed Beroset

svn path=/trunk/; revision=52394
2013-10-06 02:42:14 +00:00
Anders Broman 408ba7bade From beroset@mindspring.com:
c1222 dissector has wrong tag value for BER-encoding of calling_AE_qualifier

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9193

svn path=/trunk/; revision=52225
2013-09-26 21:15:44 +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
Michael Mann 00dd0adc0d expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51851
2013-09-09 00:28:48 +00:00
Alexis La Goutte 467ece42b3 Fix (-W)documentation error found by Clang
../../asn1/c1222/packet-c1222-template.c:348:15: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param pinfo
   ~~~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:349:14: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param tree
   ~~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:350:16: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param length
   ~~~~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:351:16: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param offset
   ~~~~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:758:11: error: parameter 'keybuf' not
      found in the function declaration [-Werror,-Wdocumentation]
 * \param keybuf is updated with a copy of the key data if successful lookup.
          ^~~~~~
../../asn1/c1222/packet-c1222-template.c:758:11: note: did you mean 'keybuff'?
 * \param keybuf is updated with a copy of the key data if successful lookup.
          ^~~~~~
          keybuff
../../asn1/c1222/packet-c1222-template.c:879:13: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param tvb
   ~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:880:16: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param offset
   ~~~~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:881:13: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param len
   ~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:882:15: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param pinfo
   ~~~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:883:14: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param tree
   ~~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:1023:13: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param tvb
   ~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:1024:15: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param pinfo
   ~~~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:1025:14: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param tree
   ~~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:1047:15: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param pinfo
   ~~~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:1048:13: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param tvb
   ~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:1049:16: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param offset
   ~~~~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:1068:13: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param tvb
   ~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:1069:15: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param pinfo
   ~~~~~~~~~~~^
../../asn1/c1222/packet-c1222-template.c:1070:14: error: empty paragraph passed
      to '\param' command [-Werror,-Wdocumentation]
 * \param tree
   ~~~~~~~~~~^

svn path=/trunk/; revision=51272
2013-08-10 21:30:38 +00:00
Jeff Morriss 2df54da6e2 Move a bunch of the crypt modules and pint.h into wsutil.
This means wsutil now links against libcrypt.

Protect a bunch of the crypt header files from multiple inclusion.

svn path=/trunk/; revision=51100
2013-08-01 23:34:47 +00:00
Guy Harris b2475c1c29 Squelch some warnings that show up with, for example, the GCC 4.2.1 that
comes with Xcode 3.2.6 (it's not a real problem, but that requires more
flow analysis than that version of the compiler does, apparently).

svn path=/trunk/; revision=50419
2013-07-06 19:34:21 +00:00
Michael Mann 225698ef0b Fix display filter errors caught by checkfiltername.pl
svn path=/trunk/; revision=50399
2013-07-06 02:53:45 +00:00
Pascal Quantin 1bb2081fd2 From Ed Beroset via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8746 :
Add procedure numbers to C12.22 dissection

svn path=/trunk/; revision=49775
2013-06-04 20:21:17 +00:00
Jeff Morriss 29d51623c2 From Ed Beroset via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8762 :
Remove dead code (condition can never happen).

svn path=/trunk/; revision=49743
2013-06-04 01:38:53 +00:00
Michael Mann 7fe5422c4b Convert ASN.1 dissectors to use filterable expert info.
NOTE: Kerberos ASN.1 template was updated, but not generated to source.

svn path=/trunk/; revision=49707
2013-06-03 03:42:36 +00:00
Anders Broman e9f90d8c42 Make C12.22 work over UDP.
svn path=/trunk/; revision=49104
2013-05-01 08:34:40 +00:00
Guy Harris 29715ccc8f How can I get a new tvbuff that starts at an offset within a given
tvbuff and runs to the end of the tvbuff?  Let me count the ways....

Replace a bunch of different ways of doing that (some incorrect, in that
they're not properly handling tvbuffs where the captured and reported
lengths are different) with tvb_new_subset_remaining().

svn path=/trunk/; revision=47751
2013-02-19 23:17:07 +00:00
Michael Mann fd44f9a339 Remove C++ incompatibilities in c1222 dissector.
Also addresses an implicit cast in the epan/uat.h file

Bug 8342 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8342)

svn path=/trunk/; revision=47721
2013-02-17 22:15:16 +00:00
Jeff Morriss 3551a86c36 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45015
2012-09-20 01:29:52 +00:00
Chris Maynard a592bd657c tvb_length_remaining() can return -1, so don't assign its return value to an unsigned integer. Fixes Coverity CID 281367: Improper use of negative value.
svn path=/trunk/; revision=43698
2012-07-13 21:03:54 +00:00
Guy Harris 659cf0527a UATs could be put into "categories". The categories were defined only
implicitly by the #define name and string they were defined to; not all
UATs neatly fit into any of the categories, so some of them were put
into categories that weren't obviously correct for them, and one - the
display filter macro UAT - wasn't put into any category at all (which
caused crashes when editing them, as the GUI code that handled UAT
changes from a dialog assumed the category field was non-null).

The category was, in practice, used only to decide, in the
aforementioned GUI code, whether the packet summary pane needed to be
updated or not.  It also offered no option of "don't update the packet
summary pane *and* don't redissect anything", which is what would be
appropriate for the display filter macro UAT.

Replace the category with a set of fields indicating what the UAT
affects; we currently offer "dissection", which applies to most UATs
(any UAT in libwireshark presumably affects dissection at a minimum) and
"the set of named fields that exist".  Changing any UAT that affects
dissection requires a redissection; changing any UAT that affects the
set of named fields that exist requires a redissection *and* rebuilding
the packet summary pane.

Perhaps we also need "filtering", so that if you change a display filter
macro, we re-filter, in case the display is currently filtered with a
display filter that uses a macro that changed.

svn path=/trunk/; revision=43603
2012-07-08 01:00:46 +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
Chris Maynard 8fd9342f7d tvb_length_remaining() can return a negative number, so be sure to handle it. Fixes Coverity CID 281367.
svn path=/trunk/; revision=42840
2012-05-25 00:29:46 +00:00
Guy Harris 25917db46e Get rid of remaining Booleans-as-encoding-arguments in
proto_tree_add_bitmask() calls.

svn path=/trunk/; revision=42568
2012-05-11 08:10:42 +00:00
Stig Bjørlykke 1301b98e25 Use _U_ for unused arguments.
svn path=/trunk/; revision=41478
2012-03-11 12:00:00 +00:00