Commit Graph

86 Commits

Author SHA1 Message Date
Stig Bjørlykke c3b54a3378 Removed a "statement not reached" warning.
svn path=/trunk/; revision=26478
2008-10-16 13:35:35 +00:00
Gerald Combs b9fac8aa8a Fetch the key length using pntohs. Initialize and check its length.
svn path=/trunk/; revision=26115
2008-09-02 17:26:24 +00:00
Bill Meier afd857957a Fix a few Emacs "file variables" to have "safe" values.
That is: indent-tabs-mode: tabs --> indent-tabs-mode: t
Also: fix a typo: set-tabs-mode --> indent-tabs-mode

svn path=/trunk/; revision=26113
2008-09-02 11:17:03 +00:00
Gerald Combs ab689cc334 Add another buffer length check to group key decryption.
svn path=/trunk/; revision=26071
2008-08-25 15:26:15 +00:00
Gerald Combs f31f3f6d14 Fix a couple of crashes in WPA group key decryption.
svn path=/trunk/; revision=26070
2008-08-25 15:22:48 +00:00
Gerald Combs b5a8677250 Add WPA group key decryption from Brian Stormont, via bug 1420:
Although this patch successfully recognizes group keys and decrypts packets
properly using the group key, there is a limitation.  If an AP is using key
rotation, clicking on individual packets in a trace may not properly decrypt a
packet encrypted with a group key.  This is because the current structure used
in Wireshark only supports one active unicast and one active group key.  If a
new key has been seen, but you are looking at a packet encrypted with an older
key, it will not decrypt.  The summary lines, however, do show the packets
properly decrypted.

I've written up a much longer and more detailed explanation in a comment in the
code, along with a proposed idea for a solution, plus a clunky work-around in
the GUI when using the current code.

I also suspect there might still be a problem with decrypting TKIP groups keys
that are sent using WPA2 authentication.  In the most common operation, if you
are using WPA2, you'll also be using AES keys. It's not a common AP
configuration to use WPA2 with TKIP. In fact, most APs don't seem to support
it.  Since it is an uncommon setup, I haven't put aside the time to test this
patch against such an AP.   I do have access to an AP that supports this, so
when I have the time I'll test it and if needed, will submit another patch to
handle that odd-ball condition.

From me:

Remove the decrypt element of s_rijndael_ctx (which was unused, as indicated
in the comments).
Preserve the GPL licensing text in several files (which the patch shouldn't
have removed).
Remove changes that added whitespace.
Convert C++-style comments to C-style.
Update to include recent SVN changes (e.g. renaming variables named "index").
Remove extraneous printf's.
Define DEBUG_DUMP in airpdcap_debug.h.
Comment out some instances of DEBUG_DUMP.
Change malloc/free to g_malloc/g_free.
Use g_memdup instead of allocating and copying.
Use gint16 instead of INT16 in airpdcap_rijndael.c.
Add Brian to AUTHORS.


svn path=/trunk/; revision=25879
2008-07-30 22:32:21 +00:00
Guy Harris a04774395f Add Makefile.common files for epan/dfilter and epan/ftypes.
Add checkapi rules to Makefile.am files.

svn path=/trunk/; revision=25656
2008-07-02 01:44:30 +00:00
Guy Harris b6e20d89be Put printf into a separate "termoutput" API group. For most files,
check for it - but not for TShark plugins, as they are expected to
print to the standard output.

svn path=/trunk/; revision=25653
2008-07-01 21:13:32 +00:00
Guy Harris dc7ae72983 Fix another variable named "index".
svn path=/trunk/; revision=25581
2008-06-24 18:10:57 +00:00
Guy Harris 710ccf240c Rename a local variable in a macro to avoid collisions with regular
variables.

svn path=/trunk/; revision=25553
2008-06-23 21:08:58 +00:00
Guy Harris 11848b9efe Rename a variable to avoid collisions with the old V7 index() function,
still declared by <string.h> on some platforms (at least the way we
compile, with all sorts of non-ANSI C/non-POSIX stuff added).

svn path=/trunk/; revision=25551
2008-06-23 21:06:42 +00:00
Anders Broman 36d89bb79c Fix some of the Errors/warnings detected by checkapi.
svn path=/trunk/; revision=25368
2008-05-23 05:55:34 +00:00
Anders Broman 63c5c71cf8 Remove:
#ifdef NEED_G_ASCII_STRCASECMP_H
#include "g_ascii_strcasecmp.h"
#endif

svn path=/trunk/; revision=24859
2008-04-09 05:36:08 +00:00
Stephen Fisher 726a1caaf1 - Remove GLIB1 code
- Change ugly GLIB version checking statements to GLIB_CHECK_VERSION
- Remove ws_strsplit files because we no longer need to borrow GLIB2's
  g_strsplit code for the no longer supported GLIB1 builds


svn path=/trunk/; revision=24829
2008-04-07 05:22:54 +00:00
Gerald Combs b0f634c396 If we haven't found a handshake packet, say so.
svn path=/trunk/; revision=24605
2008-03-11 18:32:20 +00:00
Gerald Combs 9d2533aa25 Change the BSD-licensed written by CACE to BSD+GPL.
svn path=/trunk/; revision=24599
2008-03-10 17:20:15 +00:00
Gerald Combs 2cc71b9b66 Move the contents of AirPDcapCleanKeys() into AirPDcapInitContext()
and call AirPDcapInitContext() where we were previously calling
AirPDcapCleanKeys(). If we're resetting our keys, we should reset our
SA list and other associated data as well.

svn path=/trunk/; revision=24562
2008-03-05 00:57:30 +00:00
Ronnie Sahlberg 722ab30a62 we must include config.h or else NEED_G_ASCII_STRCASECMP_H will never be
defined

we must also include g_ascii_strcasecmp.h from the parent directory


svn path=/trunk/; revision=23634
2007-11-28 01:20:46 +00:00
Guy Harris 9c89cdaaa3 strcasecmp(), strncasecmp(), g_strcasecmp(), and g_strncasecmp() delenda
est.  Use g_ascii_strcasecmp() and g_ascii_strncasecmp(), and supply our
own versions if they're missing from GLib (as is the case with GLib
1.x).

In the code to build the list of named fields for Diameter, don't use
g_strdown(); do our own g_ascii_-style upper-case to lower-case mapping
in the hash function and use g_ascii_strcasecmp() in the compare
function.

We do this because there is no guarantee that toupper(), tolower(), and
functions that use them will, for example, map between "I" and "i" in
all locales; in Turkish locales, for example, there are, in both
upper case and lower case, versions of "i" with and without a dot, and
the upper-case version of "i" is "I"-with-a-dot and the lower-case
version of "I" is "i"-without-a-dot.  This causes strings that should
match not to match.

This finishes fixing bug 2010 - an earlier checkin prevented the crash
(as there are other ways to produce the same crash, e.g. a bogus
dictionary.xml file), but didn't fix the case-insensitive string matching.

svn path=/trunk/; revision=23623
2007-11-27 18:52:51 +00:00
Gerald Combs 6327c19912 From Christopher McKenzie: Zero out our SAs before we use them.
Remove an unneeded for loop in AirPDcapCleanKeys(), and make it static.

svn path=/trunk/; revision=23314
2007-10-31 00:15:17 +00:00
Sake Blok 6bec9d3d9e From tmiller@hcjbtech.org : Spelling error on GDS DB protocol dissector: "Buffer lenght:"
(recursively grepped through the source and corrected all occurences, even 
the ones just in comments)



svn path=/trunk/; revision=23211
2007-10-16 23:42:33 +00:00
Gerald Combs d75af45adc Make the WPA passphrase a percent-escaped string. Constify and GLib-ize
some variables.

svn path=/trunk/; revision=22210
2007-06-27 19:02:58 +00:00
Gerald Combs 4944cdc899 A recent checkin broke wpa-psk keys; fix it.
svn path=/trunk/; revision=22169
2007-06-23 00:00:57 +00:00
Gerald Combs 7efcc33a1e In packet-ieee802.11.c, fix a serious preference bug introduced in the
last checkin.  In airpcap.c, appease the toolbar code by returning a
lower-case, non-separated WEP key.

svn path=/trunk/; revision=22152
2007-06-21 20:22:56 +00:00
Gerald Combs 249a747c51 Be less restrictive about WEP key preferences. Use hex_str_to_bytes to
process WEP keys.  Allow the "wep:" prefix for WEP keys even when
HAVE_AIRPDCAP isn't defined.  Add a NULL pointer check to
hex_str_to_bytes().  Fixes bug 1584.

Fixup indentation.

svn path=/trunk/; revision=22151
2007-06-21 17:49:03 +00:00
Gerald Combs c992e2a3c5 Be a little less picky about EAPOL packet lengths. Someone sent in a
capture that has extra data in the 4th handshake message.

svn path=/trunk/; revision=22138
2007-06-18 21:58:34 +00:00
Gerald Combs 1d567d6e6b The 802.11 dissector calculates the header size, so pass that value to
the WEP/WPA decryption code instead of re-calculating it.  Fixes bug
1639.

Remove fcsPresent, radiotapPresent, and associated code from airpdcap.c
since they were always FALSE.  Glib-ize some data types.  Fixup white
space.

Update the release notes.

svn path=/trunk/; revision=22104
2007-06-14 22:09:14 +00:00
Bill Meier a6dab6d644 (Minor) Use _WIN32 (instead of WIN32) like the rest of Wireshark
svn path=/trunk/; revision=22030
2007-06-03 16:07:07 +00:00
Gerald Combs 7c8bb268ca The fix for ad-hoc WEP decryption in r21814 broke WPA. Replace it with
a better fix.  Clean up whitespace while we're at it.

svn path=/trunk/; revision=21847
2007-05-20 22:40:35 +00:00
Gerald Combs 86865b0fb8 Try WEP decryption before WPA. This keeps us from returning
prematurely if we have an IBSS frame.

svn path=/trunk/; revision=21814
2007-05-17 17:14:39 +00:00
Guy Harris 1b2cecda53 Need to include <epan/pint.h> to get pletohl() defined.
svn path=/trunk/; revision=21544
2007-04-23 22:34:31 +00:00
Guy Harris d6fc852779 byteReverse assumes its argument is aligned on a 32-bit boundary; make
it a pointer to a guint32.  Also, use pletohl() to fetch a 32-bit
little-endian quantity.

svn path=/trunk/; revision=21542
2007-04-23 21:23:30 +00:00
Guy Harris 5a4771d9cb The "in" array in an MD5 context is expected to be aligned on a 4-byte
boundary; make it an array of 16 guint32's rather than 64 guint8's, to
ensure that, and add now-necessary casts and remove now-unnecessary
casts.

(Missed on the previous checkin.)

svn path=/trunk/; revision=21541
2007-04-23 21:12:04 +00:00
Guy Harris 0acc6bc5b8 The "in" array in an MD5 context is expected to be aligned on a 4-byte
boundary; make it an array of 16 guint32's rather than 64 guint8's, to
ensure that, and add now-necessary casts and remove now-unnecessary
casts.

svn path=/trunk/; revision=21540
2007-04-23 20:47:07 +00:00
Guy Harris 8e32c1e739 Get rid of no-longer-needed, and warning-generated, casts.
svn path=/trunk/; revision=21536
2007-04-23 18:30:29 +00:00
Guy Harris cdb59eed63 Make Mk16_le() work on both big-endian and little-endian processors and
on processors that don't support unaligned loads - just use pletohs().

svn path=/trunk/; revision=21534
2007-04-23 18:11:12 +00:00
Guy Harris 877db595ff Don't assume byte pointers can be safely cast to more aligned pointers;
the compiler now warns of that.

svn path=/trunk/; revision=21530
2007-04-23 17:33:29 +00:00
Guy Harris 552fff182e Don't assume a pointer to UCHAR is necessarily aligned; that now
generates a warning.

svn path=/trunk/; revision=21528
2007-04-23 16:41:31 +00:00
Guy Harris 065be642f4 Get rid of some const warnings.
Use the "pnto" macros to fetch 16-bit quantities from a buffer - not
only do they have the right casts to avoid const warnings, they also
work even on platforms (such as SPARC) where you can't dereference
unaligned pointers without a trap.

Similarly, compare a possibly-unaligned (we make no alignment guarantees
in Wireshark) 16-bit quantity against 0 a byte at a time.

svn path=/trunk/; revision=21507
2007-04-22 18:26:45 +00:00
Guy Harris 6327554e6c Check the GLib version number, not the GTK+ version number; it's GLib we
care about, and this code doesn't use GTK+, so it doesn't include any
GTK+ headers and therefore doesn't get the GTK+ version number defined.

svn path=/trunk/; revision=21506
2007-04-22 18:04:52 +00:00
Ronnie Sahlberg 7a97135752 GString.len has changed signednedd between gtk1 and gtk2
this will hopefully again compile under both gtk1 and 2


svn path=/trunk/; revision=21499
2007-04-22 15:22:53 +00:00
Jörg Mayer 7b20d35047 Fix a signedness warning.
svn path=/trunk/; revision=21497
2007-04-22 11:51:36 +00:00
Ronnie Sahlberg 99bc488535 fix the sign of a variable to prevent a singed/unsigned warning during
compiling


svn path=/trunk/; revision=21494
2007-04-22 09:58:12 +00:00
Sebastien Tandel 84e1cfee7f delete Td4 as it is used only in rijndaelDecrypt and rijndaelDecryptRound not
present in the wireshark code

svn path=/trunk/; revision=21429
2007-04-14 11:55:19 +00:00
Jörg Mayer cee590823d - Add Makefile.common to EXTRA_DIST (spotted by Christopher Maynard)
- Replaced spaces at beginning of line by tab

svn path=/trunk/; revision=21267
2007-03-29 07:41:54 +00:00
Jeff Morriss 13942d6fa3 Don't #define bzero and bcopy to be memset and memcpy on Windows, just use memset and memcpy instead.
svn path=/trunk/; revision=21201
2007-03-26 03:59:09 +00:00
Stephen Fisher 62f88a4a04 From Sebastien Tandel:
(Temporarily disable the warnings as errors default on Unix to get
to get the buildbots and people with gcc40 going again until those
additional warnings gcc40 generates can be fixed-I'm working on it
ASAP)

   Patch for configure.in which disables by default the treatment of
warnings as errors.
It can be enabled with './configure --with-warnings-as-errors'.
The macro will test first if GCC is present. If it's the case,
HAVE_WARNINGS_AS_ERRORS is defined. All the USING_GCC have been replaced
by HAVE_WARNINGS_AS_ERRORS.
With this switch, people won't suffer from unexpected warnings when
downloading svn sources during the transition time ;)


svn path=/trunk/; revision=21153
2007-03-23 17:49:59 +00:00
Stephen Fisher 84c5becd89 Add -Werror for gcc to a few more directories and fix a few warnings
svn path=/trunk/; revision=21129
2007-03-22 23:24:13 +00:00
Ulf Lamping dcb1e1bdfd add "treat warnings as errors" flag(s)
svn path=/trunk/; revision=21125
2007-03-22 22:54:00 +00:00
Luis Ontanon 69e27560c2 From: Sebastien Tandel
And here is the patch to change guint -> guint32 in the hmac function.


svn path=/trunk/; revision=21037
2007-03-16 21:22:35 +00:00