Commit Graph

74 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 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
Guy Harris d04ec412d6 Use FreeRADIUS's warning pragma controls to suppress Apple complaints.
Apple would really rather that you use their Shiny Happy Frameworks
rather than those crufty old cross-platform APIs.  We are a
cross-platform program, and will use platform-specific APIs only if
there's enough benefit to doing so - and, in this case, that means
"using the platform-specific APIs on OS X and the other APIs on other
platforms", so that's two code paths to maintain, so "enough benefit"
has to outweigh the issues with that.

Change-Id: I370ba469a6f5892143d72179d15c9fe22d664fdf
Reviewed-on: https://code.wireshark.org/review/3881
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-27 21:17:37 +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
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 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
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 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
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
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
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
Stefan Metzmacher 98e6bb18d3 asn1/kerberos: remember in what frame a key was learned
Change-Id: I8e64e1d02ee8b4dff3845e1b9ec8f56174e76fbf
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/363
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-25 21:47:10 +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
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
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
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
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
Evan Huus 9fa4a8e6b6 Convert a batch of asn1 dissectors from emem to wmem.
svn path=/trunk/; revision=50057
2013-06-19 20:43:03 +00:00
Michael Mann 2dbf6c59a2 Remove check_col() from ASN.1 dissectors
svn path=/trunk/; revision=49927
2013-06-14 12:44:50 +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
Pascal Quantin c080dd0474 More compilation fixes when having HAVE_KERBEROS
svn path=/trunk/; revision=49385
2013-05-17 19:31:44 +00:00
Pascal Quantin c3836c576e Fix link failure with Windows
svn path=/trunk/; revision=49349
2013-05-16 22:23:16 +00:00
Pascal Quantin 67c9aa88c7 Fix compilation for Linux (defined but not used errors, C++ incompatibilities, shadowed variables)
svn path=/trunk/; revision=49344
2013-05-16 21:16:45 +00:00