Commit Graph

23 Commits

Author SHA1 Message Date
Guy Harris 57a1514ac7 Cast away the return value of g_strlcpy() and g_strlcat().
Most of the time, the return value tells us nothing useful, as we've
already decided that we're perfectly willing to live with string
truncation.  Hopefully this keeps Coverity from whining that those
routines could return an error code (NARRATOR: They don't) and thus that
we're ignoring the possibility of failure (as indicated, we've already
decided that we can live with string truncation, so truncation is *NOT*
a failure).
2021-04-30 03:19:19 -07:00
Guy Harris a883081b70 Update URLs pointing to the bug database.
Switch from bugs.wireshark.org to the GitLab issues list.
2020-10-03 07:54:12 -07:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Gerald Combs 8d3ac3af86 epan: Convert our PROTO_ITEM_ macros to inline functions.
Convert our various PROTO_ITEM_ macros to inline functions and document
them.

Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c
Reviewed-on: https://code.wireshark.org/review/32706
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04 04:03:38 +00:00
Dario Lombardo fe219637a6 dissectors: use SPDX identifiers.
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a
Reviewed-on: https://code.wireshark.org/review/25756
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12 16:49:58 +00:00
Ahmad Fatoum 9d49e13166 Remove superfluous null-checks before strdup/free
NULL checks were removed for following free functions:

- g_free "If mem is NULL it simply returns"
  https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-free

- g_slist_free(_full)? "NULL is considered to be the empty list"
  https://developer.gnome.org/glib/stable/glib-Singly-Linked-Lists.html

- g_strfreev "If str_array is NULL, this function simply returns."
  https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strfreev

- g_slice_free "If mem is NULL, this macro does nothing."
  https://developer.gnome.org/glib/stable/glib-Memory-Slices.html#g-slice-free

- g_match_info_free "not NULL... otherwise does nothing"
  https://developer.gnome.org/glib/stable/glib-Perl-compatible-regular-expressions.html#g-match-info-free

- dfilter_free defined in Wireshark code. Returns early when passed NULL
  epan/dfilter/dfilter.c

They were also removed around calls to g_strdup where applicable:

- g_strdup "If str is NULL it returns NULL."
  https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strdup

Change-Id: Ie80c2db89bef531edc3aed7b7c9f654e1d654d04
Reviewed-on: https://code.wireshark.org/review/23406
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2017-10-15 12:38:51 +00:00
Erik de Jong f1c75cf6ef Rewrite dissectors to use Libgcrypt functions.
As discussed on the mailinglist, rewriting dissectors to use Libgcrypt
functions as Libgcrypt will be mandatory after change 20030.
Removal of following functions:
- crypt_md4
- crypt_rc4*
- aes_cmac_encrypt_*
- md5_*
- sha1_*
- sha256_*

Further candidates:
- aes_*
- rijndael_*
- ...

Added functions:
- ws_hmac_buffer

Added const macros:
- HASH_MD5_LENGTH
- HASH_SHA1_LENGTH

Changes on epan/crypt/* verified with captures from
https://wiki.wireshark.org/HowToDecrypt802.11
Changes on packet-snmp.c and packet-radius.c verified with captures from
https://wiki.wireshark.org/SampleCapture
Changes on packet-tacacs.c verified with capture from
http://ccie-in-3-months.blogspot.nl/2009/04/decoding-login-credentials-regardless.html

Change-Id: Iea6ba2bf207cf0f1bf2117068fb1abcfeaafaa46
Link: https://www.wireshark.org/lists/wireshark-dev/201702/msg00011.html
Reviewed-on: https://code.wireshark.org/review/20095
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-03-02 23:58:05 +00:00
Dario Lombardo 3cf4f8a823 corosync-totemnet: add shutdown routine.
Change-Id: Ib2e93c012ec0547d4eb5968d1bf47b0e1489f3df
Reviewed-on: https://code.wireshark.org/review/19649
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-20 18:35:02 +00:00
Guy Harris 7cd6906056 Rename tvb_new_subset() to tvb_new_subset_length_caplen().
This emphasizes that there is no such thing as *the* routine to
construct a subset tvbuff; you need to choose one of
tvb_new_subset_remaining() (if you want a new tvbuff that contains
everything past a certain point in an existing tvbuff),
tvb_new_subset_length() (if you want a subset that contains everything
past a certain point, for some number of bytes, in an existing tvbuff),
and tvb_new_subset_length_caplen() (for all other cases).

Many of the calls to tvb_new_subset_length_caplen() should really be
calling one of the other routines; that's the next step.  (This also
makes it easier to find the calls that need fixing.)

Change-Id: Ieb3d676d8cda535451c119487d7cd3b559221f2b
Reviewed-on: https://code.wireshark.org/review/19597
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-10 06:19:37 +00:00
Michael Mann 2eb7b05b8c Convert most UDP dissectors to use "auto" preferences.
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67,
convert dissectors that use "udp.port".

More cleanup done on dissectors that use both TCP and UDP dissector
tables, so that less preference callbacks exist.

Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3
Reviewed-on: https://code.wireshark.org/review/18120
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-13 02:51:18 +00:00
Dario Lombardo a683f28b88 corosync-totemnet: remove dead code (CID 1223483).
Change-Id: I83aaeca7d000a5e328e0aded38093adc45a9d315
Reviewed-on: https://code.wireshark.org/review/16951
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-08-08 10:49:30 +00:00
Michael Mann 9bcac48403 Manually add protocol dependencies derived from find_dissector.
Started by grepping call_dissector_with_data, call_dissector_only and call_dissector and traced the handles passed into them to a find_dissector within the dissector.  Then replaced find_dissector with find_dissector_add_dependency and added the protocol id from the dissector.
"data" dissector was not considered to be a dependency.

Change-Id: I15d0d77301306587ef8e7af5876e74231816890d
Reviewed-on: https://code.wireshark.org/review/14509
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20 12:48:48 +00:00
Michael Mann 443a7ed259 new_create_dissector_handle -> create_dissector_handle for dissector directory.
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now.

Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f
Reviewed-on: https://code.wireshark.org/review/12484
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:37:36 +00:00
Guy Harris acf7985f73 Define the SHA-1 digest length in wsutil/sha1.h and use it.
Hopefully that'll make it a little easier to make sure that we're not
overflowing arrays.

Change-Id: I770df045ef9a45fd486c1271ea424b3334bb39d2
Reviewed-on: https://code.wireshark.org/review/8370
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-09 23:36:11 +00:00
Bill Meier 1725eee48e Use ENC_BIG_ENDIAN when fetching FT_U?INT8 fields ...
Change-Id: Ie8cb993bb9dd3e8dbfa1876a4e731bca10ee0507
Reviewed-on: https://code.wireshark.org/review/5754
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-13 21:59:55 +00:00
Bill Meier bfe3706035 Always put editor-modelines at the end of the file ...
... to ensure that there are no potential issues with respect to
editors limiting the number of lines scanned at the end of the file
when checking for editor modelines.

Change-Id: Ic85cbb108bb5159d6ec4116fea11f5eebb4e44a4
Reviewed-on: https://code.wireshark.org/review/4688
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-14 20:08:29 +00:00
Alexis La Goutte 5833d6be14 Corosync : fix encoding args (for proto_tree_add_item)
Change-Id: I908046c04df7f7218627330f64040fafbce6739e
Reviewed-on: https://code.wireshark.org/review/3689
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-18 11:27:54 +00:00
Alexis La Goutte 3f7b762e90 Fix warning: no previous prototype for ... [-Wmissing-prototypes]
Change-Id: I4e3e6ffbdae988a37904cba4d43dc5a1c5f66ed6
Reviewed-on: https://code.wireshark.org/review/3633
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-16 11:39:38 +00:00
Joerg Mayer 8702a6b827 Remove some unneeded includes
Change-Id: I4327ead0451244daa0d876ae3a770cbbf80760c8
Reviewed-on: https://code.wireshark.org/review/2590
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-06-23 23:19:28 +00:00
Evan Huus ee2885f9e8 add cast to fix buildbot
Change-Id: I945830a6dd9c34adf9802fa9e9948e2e90d8aba8
Reviewed-on: https://code.wireshark.org/review/2476
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-20 06:14:16 +00:00
Evan Huus 0c3e1a243b Add casting and license info to fix buildbots
Change-Id: Iea53b17480d758c16822d80778fa4f186a188a91
Reviewed-on: https://code.wireshark.org/review/2470
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-19 23:55:47 +00:00
Evan Huus 7398779206 rename variable to avoid shadow warning
Change-Id: I5934120da2dddf9076972ea3a471191f7dc9596a
Reviewed-on: https://code.wireshark.org/review/2434
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-19 18:27:52 +00:00
Michael Mann 53594f34e4 Dissectors for totemnet and totemsrp protocols implemented in corosync cluster engine. Bug 3232.
From Masatake YAMATO

changes in patch3 (Masatake YAMATO):

  * Fix a typo(s/Sequnce/Sequence/)
  * Use variable len instead of a number literal
  * Put _U_ marker to length parameter of dissect_corosync_totemsrp_ip_address
  * Use tvb_report_length instread of tvb_length

changes in patch5 (Masatake YAMATO):

  * packet-corosync-totemsrp.c: Adapt to new dissector_try_heuristic interface

    + pass hdtbl_entry argument to dissector_try_heuristic.

  * packet-corosync-totemnet.c: Initialize corosync_totemnet_port to 5405

changes in patch6 (Masatake YAMATO):

  * packet-corosync-totemsrp.c: Use tvb_reported_length instead of tvb_length.
  * packet-corosync-totemsrp.c: Remove unnecessary trailing space in string literals.

  * packet-corosync-totemnet.c: Remove SVN Id tag in a comment.

changes in patch8 (Masatake YAMATO):

  * packet-corosync-totemnet.c: Remove SVN Id tag in comment(again).
  * packet-corosync-totemsrp.c: Use val_to_str_const instead of val_to_str.

changes in patch9 (Masatake YAMATO):

  * wsutil/sober128.[ch]: New files derived from packet-corosync-totemnet.c.
    Decryption code is moved here.
  * packet-corosync-totemnet.c: Remove all decryption code from this file.

Change-Id: Id832d9c5ce1be1668c857c9bbf39e8a84c31880c
Reviewed-on: https://code.wireshark.org/review/725
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-19 18:23:09 +00:00