Commit Graph

176 Commits

Author SHA1 Message Date
Peter Wu b5d062ba57 Fix buffer overflow in 802.11 decryption
The sha1 function outputs a multiple of 20 bytes while the ptk buffer
has only a size of 64 bytes. Follow the hint in 802.11i-2004, page 164
and use an output buffer of 80 octets.

Noticed when running Wireshark with ASAN, on exit it would try to free a
"next" pointer which was filled with sha1 garbage. It probably got
triggered via 3f8fbb7349 which made
AirPDcap responsible for managing its own memory.

Bug: 10849
Change-Id: I10c1b9c2e224e5571d746c01fc389f86d25994a1
Reviewed-on: https://code.wireshark.org/review/7645
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-03-11 22:47:40 +00:00
Guy Harris 233dc643a6 Remove some apparently-unnecessary includes of emem.h.
Change-Id: Id50ce3e707056cca8f30052f05c451ce431b39b5
Reviewed-on: https://code.wireshark.org/review/6632
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 19:36:36 +00:00
Michael Mann 3f8fbb7349 Remove the last two true calls to se_alloc.
(The other calls are just wrapped in macros)

Change-Id: I6a029dddf7742ba95510ec24cec30553461e48c6
Reviewed-on: https://code.wireshark.org/review/6558
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-16 00:38:36 +00:00
Michael Mann f5c4d06dba Replace some "low hanging fruit" uses of emem.
Most of the remaining ep_ uses are grouped with specific functionality.

Change-Id: I8fa64a17acc6bcdcf6891b2d28715ac0c58f1a4a
Reviewed-on: https://code.wireshark.org/review/6484
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-11 00:27:57 +00:00
Gerald Combs a81f0d1b38 Fix airpdcap debugging code.
Change-Id: Ied1094dd3c6ad176fea830c0857ba43e09d3cb10
Reviewed-on: https://code.wireshark.org/review/6457
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-09 22:17:16 +00:00
Michael Mann 4a5ca5c76e bytes_to_ep_str -> bytes_to_str
Change-Id: Ifcda8328dedec0ef4104c3a124d6246f99493750
Reviewed-on: https://code.wireshark.org/review/6389
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-08 05:43:51 +00:00
Bill Meier 5c529c95c5 Add '*.nativecodeanalysis.xml' to 'clean' targets
Change-Id: I90dbf0b31fc737150a01533763a7869b34c68cb6
Reviewed-on: https://code.wireshark.org/review/6220
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-01-02 01:45:16 +00:00
Dom Gifford f022e15494 Guard against buffer overflow when copying group key bytes into
security association structure.

Change-Id: I2f573a0626bab44aaca1ac6716bf5ac3d6a9b7ed
Reviewed-on: https://code.wireshark.org/review/3553
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-11 16:50:36 +00:00
Dom Gifford 8da72cd43d Fix support for decrypting 802.11 broadcast messages.
A little bit of guess work is involved as the group key can use a
different cipher to the pairwise key, and we are trying to do this
purely based on the EAPOL messages with no prior knowledge of the
associate request. We try to guess the cipher based on the lengths.

Bug:8734
Change-Id: I4c456b45939c00a9d1122406891f704fa037349c
Reviewed-on: https://code.wireshark.org/review/3183
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-08 14:17:11 +00:00
Stig Bjørlykke bd38b3152d Support out-of-source checkapi
Always call $(top_srcdir)/tools/checkAPIs.pl with -sourcedir=$(srcdir)
from Makefile.am to allow out-of-source 'make checkapi'.

Change-Id: I60d7e0079984a8ededdacf4517a0738486fa7973
Reviewed-on: https://code.wireshark.org/review/1294
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-25 04:23:46 +00:00
Alexis La Goutte 7d77d753c6 Continue to remove $Id$ from top of file
(Using sed :sed -i '/^\/\* \$Id\$ \*\//,+0 d') ( /* $Id */ )

Change-Id: I46e928d7f2a307c35876ed5d34cb6b7cccfcd6e9
Reviewed-on: https://code.wireshark.org/review/886
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 18:49:26 +00:00
Alexis La Goutte 757aa33220 Continue to remove $Id$ from top of file
(Using sed : sed -i '/^\# \$Id\$/,+1 d') (start with dash)

Change-Id: Ia4b5a6c2302f6a531f6a86c1ec3a2f8205c8c2dd
Reviewed-on: https://code.wireshark.org/review/881
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-31 18:48:06 +00:00
Alexis La Goutte abc6fb24fa Fix some code remove by 296591399f
(Copyright or info about file...)

Change-Id: I90ba8b1c3ec8406b0c3365a69a8555837fc4bbb1
Reviewed-on: https://code.wireshark.org/review/515
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-05 09:25:47 +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
Bill Meier 11b5c15fdb Remove trailing whitespace
Change-Id: I8116f63ff88687c8db3fd6e8e23b22ab2f759af0
Reviewed-on: https://code.wireshark.org/review/385
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-25 20:46:49 +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
Jakub Zawadzki 5ac6474c94 Rename some of pint.h macros to match common style (bits number on the end).
pntohs  -> pntoh16
   pntohl  -> pntoh32
   pletohs -> pletoh16
   pletohl -> pletoh32
   phtons  -> phton16
   phtonl  -> phton32


svn path=/trunk/; revision=53652
2013-11-29 18:59:06 +00:00
Alexis La Goutte 90c2945adb Fix compilation under Linux (Ubuntu)
airpdcap.c:470:18: error: declaration of 'address' shadows a global declaration [-Werror=shadow]
airpdcap.c:611:18: error: declaration of 'address' shadows a global declaration [-Werror=shadow]

svn path=/trunk/; revision=53216
2013-11-10 10:45:29 +00:00
Jakub Zawadzki 7b64bcf0b8 Move prototype of bytes_to_str, bytes_to_str_punct to correct header.
svn path=/trunk/; revision=53214
2013-11-10 09:44:02 +00:00
Alexis La Goutte 2c3468da11 Fix (-W)documentation error found by Clang
airpdcap.c:131:11: error: parameter 'password' not found in the function declaration [-Werror,-Wdocumentation]
 * @param password [IN] pointer to a password (sequence of between 8 and
          ^~~~~~~~
airpdcap.c:154:11: error: parameter 'password' not found in the function declaration [-Werror,-Wdocumentation]
 * @param password [IN] pointer to a password (sequence of between 8 and
          ^~~~~~~~

svn path=/trunk/; revision=51254
2013-08-10 21:28:01 +00:00
Jeff Morriss 95b4443aeb LIBGCRYPT_CFLAGS is not set in Windows builds, use GNUTLS_CFLAGS instead.
svn path=/trunk/; revision=51108
2013-08-02 00:52:13 +00:00
Jeff Morriss 9d0bcc9d09 Include LIBGCRYPT_CFLAGS in wsutil (but not in epan/crypt).
svn path=/trunk/; revision=51103
2013-08-01 23:56:09 +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 5afbf48723 Update some of the old FSF addresses caught by the new licensecheck buildbot
step.

svn path=/trunk/; revision=48848
2013-04-14 18:55:28 +00:00
Michael Mann 3a48e7e1e2 Bugfix Decryption Key Management dialog, bug 8446 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8446)
Needed to convert use of old IEEE802.11 preference strings to UAT.  Since UAT is self-contained within its own file, the entire preference file doesn't need to be rewritten/saved when UAT values are changed.

svn path=/trunk/; revision=48308
2013-03-15 01:31:53 +00:00
Jaap Keuter 827eb58b04 From David Arnold:
Replace use of INCLUDES with AM_CPPFLAGS in all Makefiles to placate recent autotools.

svn path=/trunk/; revision=48261
2013-03-12 06:53:39 +00:00
Anders Broman c5ee81098c From beroset:
remove C++ incompatibilities

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

svn path=/trunk/; revision=48006
2013-03-02 12:10:56 +00:00
Balint Reczey 1ebdb2e521 Export libwireshark symbols using WS_DLL_PUBLIC define
Also remove old WS_VAR_IMPORT define and related Makefile magic
everywhere in the project.

svn path=/trunk/; revision=47992
2013-03-01 23:53:11 +00:00
Bill Meier a6e56df8b6 it's ==> its & its ==> it's as needed.
svn path=/trunk/; revision=47898
2013-02-26 02:38:52 +00:00
Martin Kaiser 38a73a32f3 include the wsutil/wsgcrypt.h instead of including gcrypt.h directly
svn path=/trunk/; revision=47802
2013-02-21 18:23:29 +00:00
Michael Mann b76078d210 Bugfix crash caused by AirPDcap decryption. Bug 8177 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8177)
svn path=/trunk/; revision=47314
2013-01-27 15:28:55 +00:00
Evan Huus 50efee619e Make airpcap's print_debug_line take const arguments so that it compiles
on newer GCC's when _DEBUG is #defined.

Found while investigating
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8177

svn path=/trunk/; revision=47309
2013-01-26 21:21:25 +00:00
Michael Mann 86d690880f replace "unsigned" datatype with "guint". Some mpeg files needed "unsigned int" instead.
bugs 7825-7827 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7825)

svn path=/trunk/; revision=46928
2013-01-04 05:22:43 +00:00
Anders Broman a6b7e3fba5 From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
airpdcap: For FromDS and ToDS both set use magic

All 802.11 data frames on the AMP link shall be sent with ToDS and FromDS
bits in the Frame Control field both set to one. Currently for this packets
we get different associations for the same EAPOL sequence since addr2 and
addr1 change.

svn path=/trunk/; revision=45923
2012-11-05 11:55:39 +00:00
Anders Broman 45953625a5 From Andrei Emeltchenko:
Add 802.11 AMP LLC/SNAP header

Add LLC/SNAP header specified in BLUETOOTH SPECIFICATION Version 4.0 [Vol 5]
802.11 Protocol Adaptation Layer Functional Specification.
The SNAP header composed of the OUI of the Bluetooth SIG and the protocol
identifier given in spec mentioned shall be used to distinguish AMP 4-way handshake
messages from external security traffic. Decode this traffic as 802.1X authentication.

Part of
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7633

svn path=/trunk/; revision=45920
2012-11-05 10:02:07 +00:00
Jeff Morriss 3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +00:00
Jeff Morriss 4c0b20f3bb (Attempt to) fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7411 :
Use LIBGCRYPT_CFLAGS if we have it.

svn path=/trunk/; revision=44758
2012-09-03 19:53:35 +00:00
Anders Broman 1a8065acdc From Chris Elston:
Split md5_hmac for incremental use 

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

svn path=/trunk/; revision=44710
2012-08-31 09:29:34 +00:00
Anders Broman f32baca6e1 From Chris Elston:
Split sha1_hmac for incremental use.

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

svn path=/trunk/; revision=44709
2012-08-31 09:25:36 +00:00
Chris Maynard cc3c9ba3e5 Allow wpa-psk decryption keys to be successfully entered.
Problems reported on ask.wireshark.org here:
1) http://ask.wireshark.org/questions/13951/invalid-key-format-wireshark-182
2) http://ask.wireshark.org/questions/13688/error-updating-record-invalid-key-format

#BACKPORT (to 1.8)

svn path=/trunk/; revision=44694
2012-08-29 16:15:01 +00:00
Jeff Morriss 1c1db865f6 Don't define HAVE_UMTS_KASUMI to anything unless we actually have it.
Use #ifdef HAVE_UMTS_KASUMI instead of #if HAVE_UMTS_KASUMI

Put $Id$ tag in kasumi.h

svn path=/trunk/; revision=44398
2012-08-09 19:33:36 +00:00
Pascal Quantin 23c35e6d14 Small fixes:
- put back return NULL in line 947 that got removed in r44384: it is mandatory to avoid accessing non initialized variables. Change rlc_channel_assign a bit to fix what was the root cause of this removal (I guess)
- put back add_channel_info in dissect_rlc_am (removed by error?)
- fix some typo errors
- fix indentation a bit

svn path=/trunk/; revision=44393
2012-08-09 18:26:08 +00:00
Anders Broman dff5959253 Add Custom.common to dist.
svn path=/trunk/; revision=44387
2012-08-09 17:12:38 +00:00
Anders Broman efa02ebb7a From Jacob Nordgren and Rishie Sharma:
FP: fixed so hsdsch type 1 also uses communication context id 

Added experimental conditional decryption support.

svn path=/trunk/; revision=44384
2012-08-09 16:42:31 +00:00
Evan Huus a234b68ff0 Fix some system header files that were #included with "" instead of <>.
They made cppcheck unhappy.

svn path=/trunk/; revision=43779
2012-07-18 02:47:56 +00:00
Jakub Zawadzki b18e880040 Update FSF address - part II.
svn path=/trunk/; revision=43538
2012-06-28 23:18:38 +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
Guy Harris faa13e5072 Neither C90 nor C99 explicitly guarantee that a memcpy() call with a
null source argument and a zero count will work; in practice, they
probably will (with a zero count, there's nothing to fetch from the
source),  but the Clang static analyzer still warns about it.

svn path=/trunk/; revision=42305
2012-04-28 02:25:15 +00:00
Jeff Morriss 75c3c92f19 Add a "-build" argument to checkAPIs.pl. Use that argument when building
from makefiles (and thus from the buildbot).

The intention is to be able to tell when a human is running the tool so we
can provide more code-review guidance.

As a starter, enable the "too many proto_tree_add_text() calls" check when
a human is running the tool.

svn path=/trunk/; revision=41943
2012-04-04 20:46:49 +00:00
Anders Broman 84370fffcb Add *.sbr files to the clean target.
svn path=/trunk/; revision=40762
2012-01-29 20:21:30 +00:00