Commit graph

678 commits

Author SHA1 Message Date
Alexander Wetzel
cb3dd958af WPA/WPA2 decoding fixes and improvements
- start decoding when we have eapol1+2 packets
  Do not insist on a complete captured handshake, decode what we can.

- more robust way to detect eapol #2 packets
  At least Win 10 is violating the spec on rekey by setting the secure
  bit in #2. Unpatched version shows and handles #2 as #4, breaking
  decoding after rekey.

- fixed eapol rekey key handling
  Inital patch (see https://code.wireshark.org/review/8268)
  is adding redundant keys, since it scans all the time
  and not only once.

- ignore tailing garbage after eapol sections in frame
  See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9065#c8

Included testcase to test decode for incomplete handshakes and eapol2
packets with secure bit set on rekey.

Ping-Bug: 9065
Change-Id: Id775088db9b5aaa80da9efdeed6902d024b5c0cd
Reviewed-on: https://code.wireshark.org/review/11484
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-11-09 11:28:14 +00:00
Guy Harris
ff9f9fc431 Don't include "file.h" if you don't need it.
It ends up dragging in libwireshark headers, which programs not linking
with libwireshark shouldn't do.  In particular, including
<epan/address.h> causes some functions that refer to libwireshark
functions to be defined if the compiler doesn't handle "static inline"
the way GCC does, and you end up requiring libwireshark even though you
shouldn't require it.

Move plurality() to wsutil/str_util.h, so that non-libwireshark code can
get it without include epan/packet.h.  Fix includes as necessary.

Change-Id: Ie4819719da4c2b349f61445112aa419e99b977d3
Reviewed-on: https://code.wireshark.org/review/11545
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-04 08:46:30 +00:00
João Valverde
3df2333155 Remaining ADDRESS macro to address function conversions
Change-Id: I8bc9af431e70243b05f4f0ce8c2b8ee451383788
Reviewed-on: https://code.wireshark.org/review/11463
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-03 12:20:34 +00:00
Michael Mann
6503689958 Add some "protocol placeholders" to remove confusion with Decode As.
Change-Id: Icc4bf0149af81c35bc6b615add473168600468fb
Reviewed-on: https://code.wireshark.org/review/11429
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-30 23:24:09 +00:00
Guy Harris
b6497d44b5 Add a comment giving details on the Centrino stuff.
Change-Id: Ie65c106f62c8d783c1c53d7a9c3f213f49ae0c1b
Reviewed-on: https://code.wireshark.org/review/11445
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-30 18:12:04 +00:00
Jeff Morriss
7f591e4c07 Clean up more unnecessary use of the 'volatile' key word.
Change-Id: I3e72fddc6ed380780d7e2e1c8df87e580138188d
Reviewed-on: https://code.wireshark.org/review/11271
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-26 11:28:41 +00:00
Gerald Combs
86fe2be4dc Use address functions instead of ADDRESS macros in asn1 and epan
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case
equivalents in the asn1 and epan directories.

Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4
Reviewed-on: https://code.wireshark.org/review/11200
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-22 11:45:56 +00:00
Guy Harris
90c4cbef19 If it's used by dissectors, it belongs in to_str.h, not to_str-int.h.
Assuming *any* of the routines that generate printable strings should be
thought of as "for internal use by libwireshark routines only, not by
dissectors", the ones that *are* used by dissectors obviously shouldn't
be.  The ability for dissectors to register address types certainly
expands the list of routines they would use.

Move everything used by dissectors from to_str-int.h into to_str.h, and
have dissectors not include to_str-int.h.

(Perhaps we should just get rid of to_str-int.h altogether.)

Change-Id: I3c583351f038233c9bcd8f9216188f82630267fa
Reviewed-on: https://code.wireshark.org/review/11149
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-19 16:40:43 +00:00
Peter Wu
a7ab4af2ab airpdcap: add free_key_string function, fix memleaks
Do not leak the key and SSID. Note that there are still some leaks in
the GTK UI related to get_wireshark_keys(), but I did not track them
down.

Caught by LeakSanitizer.

Change-Id: I639166e6ea457605d6ae0ebd58e56d7594a7b7db
Reviewed-on: https://code.wireshark.org/review/10860
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-10-09 14:35:41 +00:00
Guy Harris
a368ba551c COMPOSE_FRAME_TYPE(fcf) is stored in frame_type_subtype.
At that point, we've calculated COMPOSE_FRAME_TYPE(fcf) and stored it in
frame_type_subtype; use that variable.

Change-Id: Id15f55e77dd3072fa15f270ec02840b4299bd3a0
Reviewed-on: https://code.wireshark.org/review/10770
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-03 17:50:47 +00:00
Guy Harris
877f450681 Expand some comments.
Fix some indentation while we're at it.

Change-Id: Ic25bebadd8c2c3941e6f965b48e22a6a1aac6168
Reviewed-on: https://code.wireshark.org/review/10769
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-03 17:30:41 +00:00
Guy Harris
605e31987a More formatting cleanups (no space between "no" and comma).
Change-Id: I873756df4f78977bcee416c089537cd238d6104a
Reviewed-on: https://code.wireshark.org/review/10748
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-02 19:32:14 +00:00
Guy Harris
1f355ab1d5 Clean up formatting.
Fix "a ,b" to "a, b" in both code and displayed output.

Indent continuation lines of multi-line statements.

Change-Id: Ic2d96a498fbb716fa2be23bcd94bed14b9df7823
Reviewed-on: https://code.wireshark.org/review/10746
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-02 19:22:52 +00:00
Michael Mann
1c671c5542 Conversation filter address types for IEEE 802.11 should include WLAN Address types
Bug: 11562
Change-Id: I49338e12c80963403c1253ec9251a3a3767f2526
Reviewed-on: https://code.wireshark.org/review/10738
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-10-02 03:21:37 +00:00
Bill Meier
1fb5f8f389 [ieee80211] Fix: "DSCP Range description user priority" off by 1
Bug: 11555
Change-Id: Ic12c7882dbe4f6eca72f7eed3ee8d0e5618afdd8
Reviewed-on: https://code.wireshark.org/review/10695
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-09-30 01:00:20 +00:00
Joerg Mayer
053f53ccd1 Add a hidden item that allows to allow filtering on the station address.
This currently only works for data frames. A Fixme is in place for
managment frames.

Change-Id: I0a72a9a3e40cf8269856fbbcd97b270af422afa2
Reviewed-on: https://code.wireshark.org/review/10322
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2015-08-31 02:52:45 +00:00
Guy Harris
d76718651b Get rid of trailing blanks.
Change-Id: I0b705c924464dcc4987ed0e7c67b106b2b648dce
Reviewed-on: https://code.wireshark.org/review/10289
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-28 19:49:48 +00:00
Guy Harris
da266af710 Don't check the radio information when testing for an HT Control header.
I now read 8.2.4.1.10 "Order field" in 802.11-2012 as saying that, in
management and QoS data frames, the Order bit shouldn't be set for
non-HT, non-VHT frames, so we can just test it for those frame types
without bothering to check the radio metadata to see if the frame is an
HT or VHT frame.

This handles cases where the radio metadata isn't complete, e.g. an HT
frame with a radiotap header but no MCS field.

Handle this for *all* QoS data frames when capturing.

Get rid of the "fixed-length link-layer header" stuff; it's not being
used.

Fix a case where we're appending text to a tree item without a space
separating it from the previous text.

Bug: 11351
Change-Id: I980f5b7509603b0c22c297fddc19434c08817913
Reviewed-on: https://code.wireshark.org/review/10288
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-28 19:46:41 +00:00
tkc
8b4ff246b5 ieee80211: Qos Control bit4 handling: Make the default case as EOSP, to handle TDLS Packets.
When parsing TDLS direct link packets the ToDS: 0 and FromDS:0
so the wireshark treats the 4th bit in QoS Control as "bit4", but it
should be treated as EOSP.

So changed the default case to EOSP and only when TODS is set
treat it as "bit4".

Change-Id: Ie2a73320dc9921aed4547e32836e6cd7d89ef109
Reviewed-on: https://code.wireshark.org/review/10250
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-08-26 11:51:49 +00:00
Guy Harris
5e45269bf6 Explain why the MSDU length field in an A-MSDU is big-endian.
Change-Id: I4a1cfd09395860348d71e9f4c86b6343cfdcd02a
Reviewed-on: https://code.wireshark.org/review/10262
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-25 23:57:10 +00:00
Guy Harris
4fe661da81 Get subset TVBs correctly.
If you know the actual data length, use tvb_new_subset_length(); it will
use that as the *reported* length, which is how it *should* be used, and
will calculate the *captured* length for you as appropriate.

Change-Id: I86dde999f59fdfec58b118729b7b881737983033
Reviewed-on: https://code.wireshark.org/review/10260
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-25 22:40:46 +00:00
Richard Sharpe
edeaae04d9 Remove the search back up the proto tree for the capture frequency that was
being used to determine if we are dissecting 802.11ad in several places.

Since we now have a macro for testing that and the frequency is in the phdr
we really should use that. This also prevents problems during display filter
execution with respect to fields that are only present for 802.11ad.

Change-Id: Id04a31c15b04378b6b0f056baa1f37d94a65b71c
Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-on: https://code.wireshark.org/review/10234
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-25 02:15:23 +00:00
Jeff Morriss
662f4b2f49 Use one variable that was set but not previously used and delete another.
Change-Id: I6bd7a16e3ea97659a0007edfd9f90dbd2060e443
Reviewed-on: https://code.wireshark.org/review/10244
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-08-25 00:28:16 +00:00
Guy Harris
b16cca4714 Some beamforming stuff from 802.11ac.
Extracted from Joerg Mayer's Ixia-derived patch to 1.12 in bug 11464.
Most of the changes there are already in the trunk.

Change-Id: I90ba04e145ffb2b164810320e3510a5bed847ed4
Ping-Bug: 11464
Reviewed-on: https://code.wireshark.org/review/10243
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-24 22:17:25 +00:00
Gerald Combs
2ed3d91b45 Add the WLAN statistics dialog.
Instead of splitting the stats into two lists as with the GTK+ UI, add
everything to an expandable tree. This allows viewing nodes on more than
one network.

Rename the top-level Bluetooth menu item to Wireless and put the WLAN
stats dialog there.

The Qt UI matches SSIDs (WlanNetworkTreeWidgetItem::isMatch) a bit
differently than the GTK+ UI. Try to make the logic as plain as possible
since we'll likely have to update it in the future.

The addition of a custom BSSID address types means that we can't assume
that everything is AT_ETHER. Add routines for checking for broadcast
BSSIDs and comparing only the data portions of addresses.

Move PercentBarDelegate into its own module. Use it in
WlanStatisticsDialog.

Change-Id: Ie4214eb00671a890871380c4a07213ebfb7585c6
Reviewed-on: https://code.wireshark.org/review/10171
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-20 23:12:37 +00:00
Guy Harris
f6fb63005d Fix another typo.
Change-Id: I1fee679b4b0f582806b0e9302c3e404c0222cd6d
Reviewed-on: https://code.wireshark.org/review/9930
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-08 17:05:15 +00:00
Alexis La Goutte
c60c1b91be IEEE802.11: Fix typo
Pseduo -> Pseudo

Change-Id: I34700b3392bfd7e47e79cb2cad0f65a1046a26a2
Reviewed-on: https://code.wireshark.org/review/9925
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-08 17:03:44 +00:00
Bill Meier
7171ee5702 [ieee80211] Rework QoS Capability and QoS info code.
Specifically:
- Replace/remove much of 'dissect_qos_capability()' code to use
  existing 'fixed field' code to dissect QoS_Info field.
  Note: Much of the code added in g40d6131 to dissect the QoS Info
        field duplicated already existing (but unused) "fixed field"
        code to do same.
- Rework some QoS Info field filter names, variable names and
  value-strings to better match the text used in 802.11-2012.

- Rename 'dissect_qos_info()' to 'dissect_wme_qos_info()' to
  reflect the fact that this code is only for the (now preumably obsolete)
  original WME(WMM) specification for the QoS Info field.

Change-Id: Id89780dfe60b2e4c63332bdb946cc29c67b5127a
Reviewed-on: https://code.wireshark.org/review/9903
Petri-Dish: Bill Meier <wmeier@newsguy.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-08-07 15:30:00 +00:00
Bill Meier
dc33bba8a1 [ieee80211] Change one ENC_LITTLE_ENDIAN MAC address to ENC_NA; byte order doesn't
apply to them.

Change-Id: I4b0fcfe5d970877d7f8453e6c6f8c48ee69c2e38
Reviewed-on: https://code.wireshark.org/review/9905
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-08-07 01:52:13 +00:00
Guy Harris
c6889d8a50 Fix some encoding arguments.
802.11 is overwhelmingly little-endian; change all 1-byte fields that
were ENC_BIG_ENDIAN to ENC_LITTLE_ENDIAN.

Change one ENC_BIG_ENDIAN MAC address to ENC_NA; byte order doesn't
apply to them.

The remaining ENC_BIG_ENDIANs should be checked.

Change-Id: I3dc51a5555b99c25dce0d3b7f3be4c441b13d1a3
Reviewed-on: https://code.wireshark.org/review/9890
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-06 02:45:37 +00:00
Guy Harris
f30ac4a41c Fix a bunch of typoes in variable and field names.
Fix spelling, get rid of period at end of some field names.

Change-Id: I1963cdc92657dca8708133796f8835bdffee0c47
Reviewed-on: https://code.wireshark.org/review/9888
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-06 02:08:58 +00:00
Guy Harris
ef0bdbc0da Cleanup a bunch of 802.11ad stuff.
Make all the multi-byte fields, except for OUIs, little-endian -
including fields that contain bitfields.  Make the bits in the bitfields
little-endian as well.

For the "number of taps" bitfields, interpret the values.

Fix a typo ("pseduo" -> "pseudo").

The length of an OCT MMPDU is 16 bits, not 8 bits, and it's not a text
string, it's an octet string.

The Beacon Interval Control is 48 bits, not 64 bits.

Handle the beam refinement UI as a 2-byte field that overlaps with a
4-byte field - *none* of the bitfields align on nice 8-bit boundaries,
so that's the best we can do.

Bug: 11419
Change-Id: Ib00ad030ecb33cf676bec23c05b15a4211c75c07
Reviewed-on: https://code.wireshark.org/review/9886
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-06 01:24:23 +00:00
Bill Meier
e4f418ce7c [ieee80211] Don't call expert_...() under 'if (tree)'
Change-Id: Idcda58191ca664412ef874a69f40eb09a5b38234
Reviewed-on: https://code.wireshark.org/review/9820
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-07-29 23:13:37 +00:00
Richard Sharpe
47c175376b Fix an error where we expect the tagged parameters field to be present even
though the spec (802.11ad-2012) says they are optional.

Communicated to me by the WiFi Alliance. I have captures. Not sure if I can
share them.

Change-Id: Id5998594214ac4b6a1d3baf3cb2f0d4fe6227b40
Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-on: https://code.wireshark.org/review/9785
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-07-25 17:39:16 +00:00
Joerg Mayer
eea54a060d Enable decryption by default
Change-Id: Ife299ec6b56e6a158ed76413d7f2a8e760824a01
Reviewed-on: https://code.wireshark.org/review/9696
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2015-07-18 08:05:28 +00:00
Pascal Quantin
4da081b0d5 IEEE 802.11: tap all packets
And only take into account management, non null data and or extension frames
in WLAN traffic statistics, as previously

Bug: 11318
Change-Id: I32c059a2594331c4e317380b9de43fb582f7f8cb
Reviewed-on: https://code.wireshark.org/review/9566
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-07-10 06:01:31 +00:00
Michael Mann
38e0477a4e Use tfs_defined_not_defined
Change-Id: Id9409109ffe667d1f8b3201792f7b4146b1f73f5
Reviewed-on: https://code.wireshark.org/review/9582
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-10 02:48:54 +00:00
Bill Meier
f96a5923c3 Revert "[ieee80211] Cleanup"
This reverts commit 89c24ee8e8.

Further investigation of unused functions required ....

Change-Id: I0c015cf067eaa0ce5bdafa0bce29bed373e9a82f
Reviewed-on: https://code.wireshark.org/review/9565
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-07-08 21:00:27 +00:00
Bill Meier
89c24ee8e8 [ieee80211] Cleanup
Primarily:
   Call fixed_field functions directly instead of doing a
   linear search by "function number" in a large table
   of dissector addresses to determine the function address
   for each function call.

   As part of this change,  the order of certain fixed_field
   functions was changed to fix any forward references.

Also:
   Spelling
   Whitespace

Change-Id: I9bb7e239086f9b65044929f2cb7e7f9d9b9adaee
Reviewed-on: https://code.wireshark.org/review/9563
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-07-08 20:00:12 +00:00
Bill Meier
e55e785ed6 [ieee80211] Fix proto_tree_add_item() reversed offset,length args
Change-Id: I2bb087138de662fd41301b93ef9804345c0875b8
Reviewed-on: https://code.wireshark.org/review/9521
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-07-06 16:11:18 +00:00
Peter Wu
80f7ee063d Call reassembly_table_destroy for some dissectors
This patch adds reassembly_table_destroy calls as cleanup function for
dissectors which have a simple init routine that just calls
reassembly_table_init (comments are ignored).

The changes were automatically generated using
https://git.lekensteyn.nl/peter/wireshark-notes/diff/one-off/cleanup-rewrite.py?id=4cc0aec05dc67a51926a045e1955b7a956757b5e
(with the if and assignment parsers disabled).

The only difference from the autogenerated output is that the XXX
comments from the init routines in smb-pipe and tds dissectors are kept.

Change-Id: I64aedf7189877247282b30b0e0f83757be6199e7
Reviewed-on: https://code.wireshark.org/review/9222
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-03 23:34:28 +00:00
Guy Harris
363511cb67 Move some frame control field #defines to a header and use them elsewhere.
Move a bunch of #defines that involve the frame control field to
packet-ieee80211.h and have the WLAN statistics tap use them rather than
hardcoded numbers.

Change-Id: I893cc50e546af67c910755357cefd86c39a1c783
Reviewed-on: https://code.wireshark.org/review/9476
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-03 02:51:51 +00:00
Guy Harris
74338f5e5c Set the PHY value when providing our own metadata structure.
Bug: 11319
Change-Id: I8b746f7238729173b2ca23734e9f7fdbbe4f5110
Reviewed-on: https://code.wireshark.org/review/9232
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-30 04:44:34 +00:00
Guy Harris
26a1ccbc05 Handle the VHT flavor of the HT Control field.
The low-order bit of the field indicates whether it's the HT or VHT
version.

Show subfields as part of a 32-bit bitfield; few subfields begin and end
on a byte boundary (the Link Adaptation Control field no longer does so;
its low-order reserved bit became the VHT flag).

Update references to the 11n spec.

Update a comment.

Change-Id: I9fcb99a5517afb319b67d4deb2355c7cb0be73b6
Reviewed-on: https://code.wireshark.org/review/9191
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-27 07:42:05 +00:00
Guy Harris
ac9f64a9e1 Handle a "should not happen" case, to squelch compiler warnings.
Change-Id: Icb3497924c88963688d60a59c5873a271b7e4d21
Reviewed-on: https://code.wireshark.org/review/9187
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-27 04:49:00 +00:00
Guy Harris
b401fb0380 Use the PHY type in the radio information to recognize HT packets.
Rather than having a separate "802.11 HT" dissector, just look for the
802.11n (HT) PHY.

(As a side-effect, This also causes PPI HT frames to have the radio
information dissected by the wlan_radio dissector, as is the case with
other 802.11 frames accompanied by radio information.)

Change-Id: I854c42e19481a17767e64a3b92222b09dbaa02dd
Reviewed-on: https://code.wireshark.org/review/9185
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-27 02:25:37 +00:00
Pascal Quantin
7db3021f59 IEEE 802.11: add an expert info when tag length value is bigger than remaining payload
Bug: 11298
Change-Id: I18082a15fbeaa843099741511292eec19acf94b9
Reviewed-on: https://code.wireshark.org/review/9033
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-06-22 22:45:41 +00:00
Peter Wu
8abe108a3c ieee80211: fix memleak
parse_key_string reads from rec->string and rec->key (without
modifying those parameters), then returns a newly allocated
decryption_key_t struct which is not used except for reading the
type field. Release memory after copying that single field!

Change-Id: Iac19bea23dedb73cab9dd1ea09f98cc83556e96c
Reviewed-on: https://code.wireshark.org/review/9025
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-06-22 21:48:10 +00:00
Guy Harris
2895d58dc3 Call the "802.11 radio information" dissector for radio headers.
Have dissectors of various forms of radio information headers in the
packets fill in a struct ieee_802_11_phdr with radio information as
appropriate, and call the "802.11 radio information" dissector rather
than the raw 802.11 dissector.

This means that the radio information can be found in a
protocol-independent and encapsulation-independent form when you're
looking at the packet; that information can be presented in a form
somewhat easier to read than the raw metadata header format.

It also enables having a single "radio information" tap that allows
statistics to handle all different sorts of radio information
encapsulation.

In addition, it lets us clean up some of the arguments passed to the
common 802.11 dissector routine, by having it pull that information from
the struct ieee_802_11_phdr.

Ensure that the right structure gets passed to that routine, and that
all the appropriate parts of that structure are filled in.

Rename the 802.11 radio protocol to "wlan_radio", rather than just
"radio", as it's 802.11-specific.  Give all its fields "wlan_radio."
names rather than "wlan." names.

Change-Id: I78d79afece0ce0cf5fc17293c1e29596413b31c8
Reviewed-on: https://code.wireshark.org/review/8992
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-20 23:02:21 +00:00
Guy Harris
d9b36c46d0 Pass the 802.11 pseudo-header as an argument.
Rather than accessing it through pinfo->pseudo_header, have it passed as
an argument.

This means we no longer tweak the pseudo-header filled in by libwiretap,
but instead construct our own pseudo-header, which is a bit cleaner.

It also opens up the possibility of other dissectors passing radio
information down to the 802.11 dissector, so it can display it in a
better-organized format than the raw metadata headers for
radiotap/PPI/Prism/AVS/etc., and having some of the options for 802.11
dissection (Atheros padding, Centrino stuff, etc.) also passed in
through that pseudo-header so we have fewer arguments to
dissect_ieee80211_common().

Change-Id: I470300a0407ebf029c542f7ca5878593563a70a9
Reviewed-on: https://code.wireshark.org/review/8980
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-18 20:13:50 +00:00