Commit Graph

241 Commits

Author SHA1 Message Date
Guy Harris a64fc6cf44 Don't check for C89 headers.
1988 called, they want their lack of a C standard back.  We don't need
to check whether we have stdarg.h, stddef.h, stdlib.h, or string.h, as
they're specified by C89 and I don't think there are any platforms we
care about that don't have a C89 environment in which we could be built.

Change-Id: I447551181284fab7722354b62774625ed8ee94bc
Reviewed-on: https://code.wireshark.org/review/7110
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-14 09:10:56 +00:00
Gerald Combs 881ff5df92 Remove gethostbyaddr and gethostbyaddr2.
They've been deprecated for a very long time. Replace them with
getaddrinfo. Note that we might not want to do synchronous name
resolution at all.

Add HAVE_GETADDRINFO to the KfW win-mac.h collision list.

Change-Id: If59ce8a038776eadd6cd1794ed0e2dad8bf8a22c
Reviewed-on: https://code.wireshark.org/review/6958
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-06 08:07:10 +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 d07364d042 Restore #undef HAVE_STDLIB_H and #undef HAVE_STRING_H in kerberos dissector.
These were removed when the kerberos dissector was switched to being a pure ASN.1 dissector (see dea68bf00f).

Change-Id: I04177046250d039a750f4e4e4dd956d8beab23bc
Reviewed-on: https://code.wireshark.org/review/6476
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-11 01:08:41 +00:00
Guy Harris 61c6fb8281 Remove the probes from packet-kerberos.c.
None of HAVE_KERBEROS, HAVE_MIT_KERBEROS or HAVE_HEIMDAL_KERBEROS or
HAVE_LIBNETTLE defined when it's compiled.  So how is HAVE_KERBEROS
getting defined when wireshark-qt.cpp is compiled?

Change-Id: If238ff54aa4f0cda662c7a52d76e33363a77240d
Reviewed-on: https://code.wireshark.org/review/6262
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-03 11:07:26 +00:00
Guy Harris 544ed8adcf Stick some #define probes in on Windows.
Let's try to figure out why, on the 64-bit Windows build,
wireshark-qt.cpp is being compiled to call read_keytab_file() but
packet-kerberos.c is not being compiled to define it.

Change-Id: I782406e2189819d9400b84b6632fe0fb62c5996d
Reviewed-on: https://code.wireshark.org/review/6261
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-03 07:42:17 +00:00
Guy Harris 5eecf81b0c Don't define a stub read_keytab_file() on Windows if we don't have Kerberos.
We don't declare it, so all the DLL export stuff won't work, and we
shouldn't need it, as we shouldn't be calling it if we don't have
Kerberos (we shouldn't support the -K option if we don't have Kerberos,
for example).

Change-Id: I7e7b12aa93c4f31953300ef513fc09a1f55f8aef
Reviewed-on: https://code.wireshark.org/review/6255
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-02 21:17:55 +00:00
Guy Harris 5981dab95b Declare read_keytab_file() in epan/dissectors/packet-kerberos.h.
Don't throw its declaration in file.h, as it's not defined in file.c.
Instead, include it in epan/dissectors/packet-kerberos.h and include
that wherever read_keytab_file() is called.

Yes, that means you also have to include <epan/asn1.h> and, therefore,
you have to include <epan/packet.h>.  Yes, that should be cleaned up,
perhaps by splitting the Kerberos support code into "stuff that handles
encryption keys without any reference to dissection" and "stuff that
does dissection-related work".

Change-Id: Ide5c31e6d85e6011d57202f728dbc656e36138ef
Reviewed-on: https://code.wireshark.org/review/6210
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-01 23:05:57 +00:00
Bill Meier 3d05935f74 kerberos: Re-add needed #include <stdio.h>
Change-Id: I85c0e5f022b5c04df6079e118e376e8d598675aa
Reviewed-on: https://code.wireshark.org/review/6011
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-23 06:03:04 +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
Stephen Fisher b0181288e2 Cast a parameter in the kerberos dissector so it compiles without
warnings on NetBSD.

Change-Id: Id1ab5020fa53656065b0b2438071342eae4f7adb
Reviewed-on: https://code.wireshark.org/review/5987
Petri-Dish: Stephen Fisher <sfisher@sdf.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stephen Fisher <sfisher@sdf.org>
2014-12-22 19:43:30 +00:00
Guy Harris 2f44afef80 Use ENCTYPE_NULL in the krb5_crypto_init() call.
That appears to be a name supplied both by MIT and Heimdal Kerberos.
Using it makes it a bit clearer what the code is doing, and might avoid
type clash warnings if it's the right type (e.g., if it's a member of an
enum, as it is in Heimdal, and the corresponding argument to
krb5_crypto_init() is of the same type, the types will match).

Change-Id: I81b79223f789b8d1ec47180b7636ac1d83e03681
Reviewed-on: https://code.wireshark.org/review/5898
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-20 01:57:03 +00:00
Guy Harris f4ffbbba27 Throw some casts at compiler warnings.
Change-Id: I609fcba0b015599f98edb1b3927edb5684bcf2b1
Reviewed-on: https://code.wireshark.org/review/5887
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-12-19 22:06:47 +00:00
Pascal Quantin 16f38e9ab2 Kerberos: import KRB5_AD_WIN2K_PAC dissection from old non ASN.1 based dissector
Bug: 10539
Change-Id: I06d1179210bdcc63800ef9580bb274c714a77c6e
Reviewed-on: https://code.wireshark.org/review/5761
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-14 18:43:38 +00:00
Stephen Fisher 608688537a Fix some compilation errors (size_t to guint/gint) and an unused parameter
Change-Id: I2d64d840c93f951dd5481ca5950ff5587da6843d
Reviewed-on: https://code.wireshark.org/review/5112
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-04 18:52:52 +00:00
Pascal Quantin 89a95f2205 Add Kerberos 3.2.2 package for Win64
Change-Id: If02469aa1a01972d2032478dce3bf872802f37cb
Reviewed-on: https://code.wireshark.org/review/4661
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-13 20:15:27 +00:00
Pascal Quantin 112c90a04b Kerberos: fix decryption of DCERPC with Kerberos encryption
Bug: 10538
Change-Id: I4e6feaf218da7f977f6c63d8bc204635f387672c
Reviewed-on: https://code.wireshark.org/review/4566
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-09 21:45:18 +00:00
Pascal Quantin 7690afbc54 Kerberos: remove debug logs when loading a keytab
Bug: 10543
Change-Id: I9ea20cd4d046cc072c21fd3f87f6d6be40b08b27
Reviewed-on: https://code.wireshark.org/review/4567
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-09 20:57:56 +00:00
Bill Meier a379ac74d2 Fix spelling: cant-->can't, wont-->won't, etc
Change-Id: Ia6c3e7a25615bf8e052c3bacf096d76df775c9c2
Reviewed-on: https://code.wireshark.org/review/4126
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-16 15:31:58 +00:00
Guy Harris a8523d7df4 At least some compilers don't allow warning pragmas inside functions.
So wrap the entire function in USES_APPLE_DEPRECATED_API/USES_APPLE_RST.

Change-Id: I6ae3e8ecc40bc407e6f7156ccc5d9dd8c51d650d
Reviewed-on: https://code.wireshark.org/review/3885
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-27 22:06:39 +00:00
Guy Harris c7ce0e0c22 Be more selective about turning off deprecation warnings.
Only turn them off in the vicinity of those nasty cross-platform APIs.

(This also checks in the generated Kerberos dissector, which we forgot
to do in the last checkin.)

Change-Id: I5dc9162ff64afe764e37866706590ed2ed965acb
Reviewed-on: https://code.wireshark.org/review/3882
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-27 21:49:02 +00:00
Alexis La Goutte 67682557e6 Kerberos : Fix indent (use tabs) and add modelines info
Change-Id: I7965332ee474d10c90dfb2ef63a66f610cd6fc71
Reviewed-on: https://code.wireshark.org/review/3655
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-18 00:56:56 +00:00
Alexis La Goutte fc752f7047 Fix warning: no previous prototype for ... [-Wmissing-prototypes]
Change-Id: Ic3152356c51ebe554e2356a360df5b0c23d89d63
Reviewed-on: https://code.wireshark.org/review/3632
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-16 11:38:23 +00:00
Michael Mann cd02af56a1 Eliminate (almost all) proto_tree_add_text calls from ASN.1 dissectors.
This mostly involved adding expert info capabilities to many of the dissectors so that they could correctly flag error conditions.

Only remaining proto_tree_add_text calls are in H248.cnf, which has a convoluted way of using hf_ data to make its tree.

Change-Id: I6412150c2ec1977d7fa38f3f0ed416680bdfb141
Reviewed-on: https://code.wireshark.org/review/3500
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-09 01:57:08 +00:00
Evan Huus 980f5f6711 batch of tvb-length conversions
Change-Id: I5e40df8af6841e3dad71c41d7e43c7971611b15f
Reviewed-on: https://code.wireshark.org/review/2473
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-20 05:33:04 +00:00
Pascal Quantin 0a3b1d8beb Kerberos: fix dissection of packets when Record Mark is present
Bug: 10200
Change-Id: Ied8db64120131c029e276d66aeff8b81a45a7286
Reviewed-on: https://code.wireshark.org/review/2447
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-19 19:44:15 +00:00
Michael Mann 14824e6adf Revert "Fixup: tvb_* -> tvb_captured"
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 246fe2ca4c.

Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f
Reviewed-on: https://code.wireshark.org/review/2430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:25:59 +00:00
Pascal Quantin cc37b50334 Get rid of obsolete references to nettle
Bug: 2089
Change-Id: Ie3337a1b750d8d95f6291c77dfd19cd1b0c57e83
Reviewed-on: https://code.wireshark.org/review/2388
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-18 18:03:43 +00:00
Dario Lombardo 246fe2ca4c Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:14:58 +00:00
Bill Meier 40a21bc99c packet-kerberos.c: Use tfs_set_notset in hf[] entry instead of a local version.
Change-Id: I00a3ae7afb46eb50d7477c22cfa340c705cbb34a
Reviewed-on: https://code.wireshark.org/review/1851
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-05-28 21:47:48 +00:00
Bill Meier e5705070c8 packet-klerberos.c: Use typedef (true_false_string) to properly define a true_false_string.
Change-Id: Ic89e5add39b8b0b2c3db254292f12ce6ae25b73c
Reviewed-on: https://code.wireshark.org/review/1844
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-05-28 15:30:12 +00:00
Guy Harris b8f0e8cf03 Eliminate some calls to tvb_get_ptr().
Change-Id: I1c5e10467d68ed7372dfaa9109b350238418ffc1
Reviewed-on: https://code.wireshark.org/review/1645
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-15 02:31:14 +00:00
Pascal Quantin 7acaf8552b Kerberos: ensure that private data elements are stored in separate variables
Bug: 10028

Change-Id: I599cd5475d19b64c0d5b9d31d7054a3befc84af2
Reviewed-on: https://code.wireshark.org/review/1348
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
2014-04-25 14:23:37 +00:00
Pascal Quantin 853e391dfa Kerberos: use dissect_kerberos_ADDR_TYPE (removes an unused function warning)
Change-Id: I87d9c88d9db06c8f7dedd6e39152c39c13f8d32d
Reviewed-on: https://code.wireshark.org/review/1314
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-23 22:12:35 +00:00
Stig Bjørlykke 4eb4bae413 Add check for no kerberos keytab file.
Avoid printf warnings when loading a capture with kerberos packets
when not having configured a keytab file.

Change-Id: I0950daa18c42f4687d29101fac74f6f6bd6071b1
Reviewed-on: https://code.wireshark.org/review/1300
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-23 19:28:24 +00:00
Pascal Quantin abbcaabccc Kerberos: use auto generated code for ADDR-TYPE instead of a hand made value_string array
Change-Id: I74089fe609368fdd582aef1f2cb00a3905e0641b
Reviewed-on: https://code.wireshark.org/review/1301
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-23 15:22:02 +00:00
Pascal Quantin 11b78ffbfa Kerberos: put PDU dissection under Kerberos tree and remove duplicate PDU name
Change-Id: Id4824ad3a7bca1959579e5fd0a17a67c6bcda174
Reviewed-on: https://code.wireshark.org/review/1293
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-23 08:03:57 +00:00
Pascal Quantin 490a8a6148 Kerberos: define HostAddress/addr-type as a FT_UINT32 field
Fixes part of bug 10019

Change-Id: Id367d6c86533c840ea2ff40ef96b1c1854b96150
Reviewed-on: https://code.wireshark.org/review/1288
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-22 22:08:30 +00:00
Stig Bjørlykke 1fb902f217 Use new BER functions in kpasswd.
Added RFC 3244 ChangePasswdData to the kerberos dissector.

This is the last dissector using the "old BER" functions.

Change-Id: I1d79047103c07c268d08e652745391f1ac37c82c
Reviewed-on: https://code.wireshark.org/review/1198
Reviewed-by: Tomáš Kukosa <tomas.kukosa@unify.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-18 21:42:51 +00:00
Alexis La Goutte be76ba5f0d Fix warning found by -Wunused-const-variable (Clang 3.5)
../../asn1/kerberos/packet-kerberos-template.c:1076:27: error: unused variable 'w2k_pac_types' [-Werror,-Wunused-const-variable]
../../asn1/kerberos/packet-kerberos-template.c:1089:27: error: unused variable 'krb5_princ_types' [-Werror,-Wunused-const-variable]
../../asn1/kerberos/packet-kerberos-template.c:1146:27: error: unused variable 'krb5_encryption_types' [-Werror,-Wunused-const-variable]
../../asn1/kerberos/packet-kerberos-template.c:1184:27: error: unused variable 'krb5_checksum_types' [-Werror,-Wunused-const-variable]
../../asn1/kerberos/packet-kerberos-template.c:1222:27: error: unused variable 'krb5_ad_types' [-Werror,-Wunused-const-variable]
../../asn1/kerberos/packet-kerberos-template.c:1239:27: error: unused variable 'krb5_transited_types' [-Werror,-Wunused-const-variable]
../../asn1/kerberos/packet-kerberos-template.c:1244:27: error: unused variable 'krb5_address_types' [-Werror,-Wunused-const-variable]
../../asn1/kerberos/kerberos.cnf:153:27: error: unused variable 'kerberos_Applications_vals' [-Werror,-Wunused-const-variable]

Change-Id: Ie842d236628efb46450f3e6c23b5590b2e622c25
Reviewed-on: https://code.wireshark.org/review/1199
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-04-18 20:12:51 +00:00
AndersBroman dea68bf00f Switch to using the ASN1 based kerberos dissector.
Change-Id: Ib8945cdad149b71e3f79bd88032fd10f55ba556d
Reviewed-on: https://code.wireshark.org/review/1174
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-17 08:29:39 +00:00
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 9db0e02fb3 packet-kerberos: remember in what frame a key was learned
Change-Id: Icd05d4941fdacac44094fafbad07f08ec4cbe976
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/364
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-25 21:47:27 +00:00
Guy Harris 317b828986 Use proto_tree_add_item() or tvb_get_string_enc() instead of
tvb_get_unicode_string().  If there's an indication that the encoding is
UCS-2, use that, otherwise use UTF-16.  (For example, "BMP" stands for
"Basic Multilingual Plane", which is the part of Unicode that can be
encoded in 16 bits, hence UCS-2.)

In the description of the "Use Heuristics for UDP" preference for the
XML dissector, note that it's not just trying to recognize XML in UCS-2,
it's trying to recognize XML in *big-endian* UCS-2.

svn path=/trunk/; revision=54245
2013-12-19 09:19:33 +00:00
Anders Broman e8b935ad6e Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54209
2013-12-18 06:51:09 +00:00
Jakub Zawadzki c45475ab45 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54135
2013-12-15 23:44:12 +00:00
Jörg Mayer 402df00544 Looks like the problem with redefined symbols is not new, it
just got a few new ones.
Add HAVE_STRING_H and HAVE_STDLIB_H to the list.

svn path=/trunk/; revision=53691
2013-12-01 10:10:24 +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
Michael Mann ce62a3c5cc Use ASN.1 private data instead of pinfo->private_data to exchange kerberos callback functions.
svn path=/trunk/; revision=53240
2013-11-10 19:58:03 +00:00