Commit Graph

287 Commits

Author SHA1 Message Date
Mikael Kanstrup e4bfd8b19e dot11decrypt: Silent Coverity Scan out-of-bounds access error
Coverity Scan reports an out-of-bounds acccess on memcopy from addr1
of 802.11 mac header. This out-of-bounds access is a controlled access
knowing that addr2 and addr3 is located in memory right after addr1.
Type cast to a guint8 pointer to indicate that there's no fix length.
This should silent the Coverity Scan error reported.

Coverity CID 1460754

Change-Id: Ief2280f1b686deebf3aba74f19a5730c66d4d313
Reviewed-on: https://code.wireshark.org/review/36706
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-05 08:30:35 +00:00
Mikael Kanstrup 9bd47b765d dot11decrypt: Fix a resource leak on error path
Coverity CID 1450217

Change-Id: I51a3c3cca5c3850a2f8e9de5b4cca9f0efaca4a8
Reviewed-on: https://code.wireshark.org/review/36705
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-05 08:30:30 +00:00
Alexis La Goutte 52ae96e360 dot11decrypt_util.c: fix no previous prototype for function
dot11decrypt_util.c:34:6: warning: no previous prototype for ‘dot11decrypt_construct_aad’ [-Wmissing-prototypes]

Change-Id: Ideda2d18de88aed9d3fd045a02ead6446b0dbfce
Reviewed-on: https://code.wireshark.org/review/36653
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-02 07:43:49 +00:00
Alexis La Goutte 52a782d653 dot11crypt_system(.h): fix Wdocumentation
dot11decrypt_system.h:274:11: warning: parameter 'decrypt_data' not found in the function declaration [-Wdocumentation]
dot11decrypt_system.h:277:11: warning: parameter 'decrypt_len' not found in the function declaration [-Wdocumentation]
dot11decrypt_system.h:279:11: warning: parameter 'key' not found in the function declaration [-Wdocumentation]

Change-Id: I9a0d1dd29ddd130b9425a38645777e4eb05e9fa3
Reviewed-on: https://code.wireshark.org/review/36540
Reviewed-by: Mikael Kanstrup <mikael.kanstrup@sony.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-23 08:47:37 +00:00
Mikael Kanstrup 3e9ce48d24 dot11decrypt: Fix decryption of MFP enabled connections
MFP enabled connections with SHA-256 key management (IEEE 802.11w) use
EAPOL key version == 3. This case was missing making decryption of such
connections fail. Allow key version 3 to handle these too.

Change-Id: If9e3fcc5c3bbfb46e82b39dfed5b2a74787a4f16
Reviewed-on: https://code.wireshark.org/review/36534
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-23 08:45:57 +00:00
Mikael Kanstrup 16c315ca32 dot11decrypt: Let libgcrypt handle AES unwrap
From version 1.5.0 of libgcrypt there's support for AES unwrap. Use the
libcrypt function when available.

While at it also make AES_unwrap a static function of dot11decrypt.c

Change-Id: I4f69a766df3ea19ce25122e8d2fd1086f440995b
Reviewed-on: https://code.wireshark.org/review/36431
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-15 14:55:01 +00:00
Mikael Kanstrup cf4c0552e7 ieee80211: GCMP decryption support
Add support for decrypting GCMP/GCMP-256 encrypted IEEE 802.11 traffic

Bug: 16197
Change-Id: I907d772665141c8be10a9f4a187bd76594c8d2e4
Reviewed-on: https://code.wireshark.org/review/36346
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2020-03-14 17:53:36 +00:00
Mikael Kanstrup 598839ff10 dot11decrypt: Make ccmp_construct_aad an internal utility function
The function to construct AAD is same for both CCMP and GCMP so move
it to a new internal utility c file for later use by both
implementations.

Change-Id: I8c8ffe0f492d5860e2bcd266b4d936383598b47e
Reviewed-on: https://code.wireshark.org/review/36358
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-14 07:37:31 +00:00
Mikael Kanstrup eed31f13be ieee80211: Add CCMP-256 decryption support
Add support for decrypting CCMP-256 encrypted IEEE 802.11 traffic

Bug: 16197
Change-Id: I0c9ee09e5b71cb02e6d2381049fd5bbb02686f7f
Reviewed-on: https://code.wireshark.org/review/36344
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-14 06:53:13 +00:00
Mikael Kanstrup 14bc684b18 dot11decrypt: Use libgcrypt's CCMP decryption ability
Simplify the CCMP decryption implementation by letting libgcrypt
handle decryption, authentication and integrity check. This aims
to simplify the implementation in preparation for CCMP-256
decryption support where changes to the CCMP decryption implementation
is anyway needed.

Even though performance optimization was not the target for this
change it appears decryption speed is improved as well.

Change-Id: I6c36315291672f6313c9303ab8e50afb87aea9ce
Reviewed-on: https://code.wireshark.org/review/36343
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-14 06:52:51 +00:00
Mikael Kanstrup d24a11ee2e dot11decrypt: Avoid unecessary memmove
When decrypting a frame the decryption occurs in a temporary buffer.
After successful decryption the decrypted frame is first copied back,
then a memmove operation is used to remove the CCMP header mid frame.

As the mac header is not encrypted there's no need to copy that part
back again after decryption. This means there's no mid frame data
that must be removed. Instead just copy the relevant portion and
save one memmove operation.

Change-Id: I24b938a6f5fac5a23cd0132aefe9ce258b352ef8
Reviewed-on: https://code.wireshark.org/review/36342
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-09 06:26:16 +00:00
Mikael Kanstrup a413802052 dot11decrypt: Remove unnecessary offset parameter
The offset parameter to functions Dot11DecryptWepMng and Dot11DecryptRsnaMng
is always same as mac_header_len so not needed anymore.

Change-Id: I298e207c9317051b634aabd3f6a0e0921687b4d4
Reviewed-on: https://code.wireshark.org/review/36341
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-09 06:25:45 +00:00
Mikael Kanstrup c6dff594b9 dot11decrypt: Fix MIC calc for HMAC-SHA384
The temporary buffer to store calculated mic is too short to keep
the message digest when using HMAC-SHA384 algo. HMAC-SHA384 yields
a message digest of 48 bytes so increase buffer size to make room
for the largest possible value.

Ping-Bug: 16197
Change-Id: I36fd094c39ce77329fb303fa181d286be694ae65
Reviewed-on: https://code.wireshark.org/review/35067
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-14 08:27:54 +00:00
Mikael Kanstrup b07dada4c9 dot11decrypt: Fix KDF for larger PTK derivation
The key derivation function (Dot11DecryptRsnaKdfX) used for
deriving PTK use some hard coded hash length values making
it fail to generate full / correct PTK for 704 bit long PTK.
Fix by replacing hard coded values with acutal hash length
values.

Ping-Bug: 16197
Change-Id: I48847cdb019672dde76174efb0f17514c58ace51
Reviewed-on: https://code.wireshark.org/review/35066
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-14 08:27:44 +00:00
Mikael Kanstrup 5915613879 dot11decrypt: Support 384 bit long PMK
With AKMS 00-0F-AC:12 a 384 bit long PMK shall be used. To be able
to support key derivation and decryption from this larger sized
PMK the user PSK / PMK key input validation code is updated as well
as the various places where a hard coded PMK size is used.

Ping-Bug: 16197
Change-Id: I39c9337e8a84095246e3db5ef33dc96fb78e5dc3
Reviewed-on: https://code.wireshark.org/review/35065
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-14 08:27:37 +00:00
Mikael Kanstrup 7638ea013d dot11decrypt: Dynamic sized TK, KEK, KCK, PTK
Use AKM, cipher suite and group cipher suite from RSNA to determine
key lenghts and offsets. This allows keys of different lengths
for PTK derivation, MIC validation etc.

Ping-Bug: 16197
Change-Id: I9a721fb9811db89357218b50a2a107cf945d3dae
Reviewed-on: https://code.wireshark.org/review/35064
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-14 08:27:29 +00:00
Mikael Kanstrup 96971a33a3 dot11decrypt: Support dynamic MIC lengths
Not all AKMS use same MIC length. Last part to support both 16 byte
24 byte long MIC is to actually make use of the now known in mic
length in MIC check / validation function. Instead of hardcoded
length use the length in eapol_parsed struct received from
dissector.

Ping-Bug: 16197
Change-Id: I6585b7a54de4def9e5ff846c19f12059b90ffdf6
Reviewed-on: https://code.wireshark.org/review/35063
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-14 08:27:20 +00:00
Mikael Kanstrup 820e1c9bee dot11decrypt: Export Dot11DecryptDecryptKeyData function
Simplify the still quite complex Dot11DecryptScanEapolForKeys function
and further reduce frame parsing inside Dot11Decrypt engine. This is
done by breaking out the EAPOL keydata decryption step into a new
function Dot11DecryptDecryptKeyData to be called from dissector.

After this Dot11DecryptScanEapolForKeys can now focus on one
task, to scan for keys in (unencrypted) EAPOL key frames.

With keydata decryption step separated from the broadcast
key parsing step the dissectors' GTK parsing can replace
the Dot11Decrypt internal RSN GTK TAG parsing.

Change-Id: I3b89f40586b8b7dbe2ff74cfc30761010d5b80bc
Reviewed-on: https://code.wireshark.org/review/35022
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-14 08:26:00 +00:00
Mikael Kanstrup 4222603a50 dot11decrypt: Introduce Dot11DecryptGroupHandshake function
Break out the group handshake parsing from Dot11DecryptScanEapolForKeys
to a separate function. With this Dot11DecryptScanEapolForKeys logics
is simplified to either handle 4-way handshake or group handshake
message.

Change-Id: I2714d26623812066c888f7fea4b21eb03f22e510
Reviewed-on: https://code.wireshark.org/review/35021
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-14 08:25:34 +00:00
Mikael Kanstrup 3fdabc62d4 dot11decrypt: Let dissector parse eapol frames
To be able to support authentication key management suites that use
different MIC, PMK, PTK lengths the engine would need to be extended
to support parsing EAPOL Key frames with variable field lengts. Though
as the IEEE 802.11 dissector already support this the alternative
(implemented in this patch) is to remove the EAPOL frame parsing inside
the engine and have the dissector feed it with a struct of parsed
fields instead.

For this a new type DOT11DECRYPT_EAPOL_PARSED is exported and
dot11decrypt now expects dissector to fill this struct with parsed
EAPOL fields before calling Dot11DecryptScanEapolForKeys.

Dissection of EAPOL fields is scattered over several functions in the
dissector code so parsed fields are temporarily stored in proto data
and then gathered before fed into dot11decrypt engine.

Change-Id: Ic6aeb4900f373dcde1ea3f1f0f24df2ae827576e
Reviewed-on: https://code.wireshark.org/review/35020
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-14 08:25:13 +00:00
Mikael Kanstrup 2ecb2828a8 dot11decrypt: Let dissector feed engine with EAPOL key message type
EAPOL key message type is known by dissector so no need for dot11decrypt
to parse frames to determine this. Instead feed engine with message
type from dissector. With this some code duplication can be avoided.

Change-Id: Icfd119186ebab5b0db29968df3eb94275d921e76
Reviewed-on: https://code.wireshark.org/review/34929
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-04 17:54:16 +00:00
Mikael Kanstrup 0ec8bd50c7 dot11decrypt: Separate key extraction step from decryption step
As a step towards removing the parsing of frames inside dot11decrypt
engine separate the key extraction step from the decryption step.

Two new functions for extracting keys are now provided by the
do11decrypt engine. One to be called for EAPOL key frames that
will extract and feed the engine with keys present in 4-way handshake
and group handshake messages. And one to be called for TDLS action
frames to extract keys and feed the engine with keys during TDLS
session establishement.

The old Dot11DecryptPacketProcess function called for all 802.11
frames is simplified and now only has one purpose. To decrypt
encrypted packets. Hence renamed to Dot11DecryptDecryptPacket.

Change-Id: Idb38d538f435ec352c6bbb200a09bc2a2347c42e
Reviewed-on: https://code.wireshark.org/review/34928
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-04 17:54:10 +00:00
Mikael Kanstrup e60b8d1eb1 dot11decrypt: Shorten the debug macros
The debug log macros are really long and require function name as
one parameter. This makes debug log lines either too wide or span
several lines of source code. Shorten the macro defines and make
use of G_STRFUNC to avoid manual function name entries in code.

NOTE: A bonus of removing all the manual function name entries is
that browsing/searching the code for function names is much easier.

Change-Id: Ia643f56df76e4a1b01ee6e6818cd61ec01047d33
Reviewed-on: https://code.wireshark.org/review/34927
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-11-03 17:20:46 +00:00
Alexander Wetzel e7acb32a5a ieee80211: Extended Key ID support
Support Extended Key ID for Individually Addressed Frames from
IEEE 802.11 - 2016.

Extended Key ID allows unicast (PTK) keys to also use key ID 1 and has
an additional RSN attribute "KeyID" in EAPOL #3.

Add the additional attribute KeyID to the RSN parser, stop assuming
unicast keys are only using key ID 0 and add a test case to verify
Extended Key ID parsing and decoding.

Change-Id: I43005c74df561be5524fa3738149781f50dafa14
Reviewed-on: https://code.wireshark.org/review/34883
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2019-11-02 11:40:57 +00:00
Mikael Kanstrup 74bccadff2 dot11crypt: Fix crash on failure finding GTK in decrypted frame
If GTK cannot be found inside a successfully decrypted wireless frame
the dot11crypt engine returns incorrect decrypted data length of 0
bytes. As the IEEE802.11 dissector does not check the length of the
decrypted frame the number of bytes allocated and copied to wmem ends
up being a negative number (i.e. a huge unsigned number). This results
in a SIGSEGV crash while copying data.

Fix this both by returning a correct length from dot11crypt engine
and add extra an protection to the IEEE802.11 dissector if the length
for any (other) reason still would end up being a negative number.

Bug: 16058
Change-Id: I9d0d1cf50498dece2e008222eebbb3edc8f10159
Reviewed-on: https://code.wireshark.org/review/34558
Petri-Dish: Pascal Quantin <pascal@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2019-09-18 16:01:09 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Martin Kaiser 72cd130f01 dot11decrypt: fix a used-but-marked-unused warning
dot11decrypt.c:1686:46: error: 'group_cipher' was marked unused but was used
      &group_cipher, &cipher, &akm);

Change-Id: Ie7b9eba44eaf9bf160ca6eb6bb7373b7ba3fd8cb
Reviewed-on: https://code.wireshark.org/review/33371
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-05-26 19:04:36 +00:00
Mikael Kanstrup e64976d33a ieee80211: Fix some coverity scan issues
Fix coverity scan issues:
- Insecure data handling (CID 1444231)
- Unchecked return value (CID 1444234)

Introduced by:
    9cf77ec5e1 ieee80211: Support decrypting WPA3-Personal / SAE captures

Change-Id: I8eb581750d2b0519f03f92873433f79409b0386b
Reviewed-on: https://code.wireshark.org/review/32546
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-04-10 02:20:04 +00:00
Mikael Kanstrup 4b814187ac ieee80211: Fix WPA1 decryption
PTK key derivation algorithm for WPA1 uses SHA1 not MD5.
MD5 is used for MIC only.

To avoid regression also add a decrypt test for WPA1 with
GTK rekeying.

Change-Id: Iabcf40c2f74d5dbc1d72cba0718c77020d97f61f
Fixes: v3.1.0rc0-342-g9cf77ec5e1 ("ieee80211: Support decrypting WPA3-Personal / SAE captures")
Reviewed-on: https://code.wireshark.org/review/32691
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-04-03 15:25:54 +00:00
Mikael Kanstrup 94461234f9 ieee80211: Support decrypting OWE captures
Add support for decryping OWE (Opportunistic Wireless Encryption)
captures.

Ping-Bug: 15621
Change-Id: I223fd0cd96260408bce2b5d7661f216c351da8a8
Reviewed-on: https://code.wireshark.org/review/32524
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-03-26 08:56:03 +00:00
Alexis La Goutte 551fb916bc ieee80211: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: Ie03b269c67a31638b5fd8e709ea839456db41fbf
Reviewed-on: https://code.wireshark.org/review/32551
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Mikael Kanstrup <mikael.kanstrup@sony.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-03-24 09:26:46 +00:00
Mikael Kanstrup 9cf77ec5e1 ieee80211: Support decrypting WPA3-Personal / SAE captures
Add support for decrypting IEEE 802.11 WPA3-Personal / SAE traffic.

SAE uses AES encryption but a different key derivation function (KDF)
making Wireshark fail to decrypt such captures. Also both KDF and
decryption method is determined based only on EAPOL key description
version. This is not enough to figure out that SAE is being used.

Implement the alternative KDF needed to derive valid PTK. Also
implement a function to parse pairwise + group cipher suites and
auth key management type from RSNE tag. Using this new function
together with a number of new cipher and AKM lookup functions
correct KDF for SAE can be selected.

Bug: 15621
Change-Id: I8f6c917af1c9642c276a244943dd35f850ee3757
Reviewed-on: https://code.wireshark.org/review/32485
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-03-21 12:13:58 +00:00
Michael Mann e797e75174 Include epan header files in VS solution.
Add header files lists to add_library() so that Visual Studio can pick them
up and include them in a "Header Files" folder for easier navigation within
Visual Studio.

Change-Id: I7cd8e39550f4db67eed8205593060ae8b4a5b1b9
Reviewed-on: https://code.wireshark.org/review/31289
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2019-02-18 00:49:51 +00:00
Gerald Combs 8c22c5bade Fix some spelling errors found by Lintian.
Change-Id: If6fc3aab7ad4fc634567121f7b9541bc6f6c5766
Reviewed-on: https://code.wireshark.org/review/30926
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-05 18:58:19 +00:00
Mikael Kanstrup 341c3f3c62 ieee80211: Avoid decrypting packets two times
Encrypted packets were decrypted two times. One time to scan for
new keys. If no keys were found the decrypted data was simply
discarded. Then later on the packet was decrypted again for
dissection.

Avoid decrypting packets two times by storing the result from first
decryption if no key was found. Skip the second attempt.

Note though that in the special case where a key was actually found
inside an encrypted packet the decryption will still be performed
twice. First time decrypt, discover the key, and return the EAPOL
keydata. Second time decrypt and return the decrypted frame.

Change-Id: I1acd0060d4e1f351fb15070f8d7aa78c0035ce39
Reviewed-on: https://code.wireshark.org/review/30568
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-14 05:03:54 +00:00
Mikael Kanstrup 61ccf52107 ieee80211: Decrypt and dissect EAPOL keydata
Decrypt EAPOL keydata information and have it dissected with the
ieee80211 dissector.

This is achieved by letting the Dot11Decrypt engine retrieve the EAPOL
keydata decrypted while extracting the GTK during 4-way handshake.
The ieee80211 dissector then stores the decrypted data in packet proto
data so that the wlan_rsna_eapol subdissector can retrieve it for
dissection.

Change-Id: I2145f47396cf3261b40e623fddc9ed06b3d7e72b
Reviewed-on: https://code.wireshark.org/review/30530
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-14 05:03:08 +00:00
Anders Broman 791a9a9b8e Remove obsolete files.
Change-Id: Ibc2f20a895f7aaf4fc5988eb8814124a68dd886e
Reviewed-on: https://code.wireshark.org/review/30583
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2018-11-12 22:52:25 +00:00
Mikael Kanstrup 54c966b986 dot11decrypt: Create RC4 decryption and key copy helper functions
In preparation for decrypting and dissecting EAPOL keydata in
ieee80211 dissector move the RC4 decryption and key copy into
separate helper functions.

Change-Id: I13f3e981038f48526032e263b6eb3c9e3496abbe
Reviewed-on: https://code.wireshark.org/review/30546
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-09 05:51:22 +00:00
Alexis La Goutte 3d5b268323 dot11decrypt(crypt): Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: I33c6e456bc8c4bae47f4df1457799cb0d09b520f
Reviewed-on: https://code.wireshark.org/review/28289
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2018-06-15 15:19:33 +00:00
Guy Harris 69ad89caa9 Make sure *both* sides are unsigned.
Change-Id: Id25ea93aee888eda665f52da4c00d75970ee69e8
Reviewed-on: https://code.wireshark.org/review/28253
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-06-12 23:05:01 +00:00
Guy Harris 0cc092d4b1 Try again to fix the signed vs. unsigned comparison warning.
Change-Id: I97dae4b6325fe5fe952c579e1d1ab3f0b37f461a
Reviewed-on: https://code.wireshark.org/review/28249
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-06-12 22:38:59 +00:00
Guy Harris 96c4655ae0 Fix signed vs. unsigned comparison warning.
(In retrospect, signed offsets probably were the wrong choice; we
rarely, if ever, use them to signify offsets from the end of the packet.
Let's not do so any more in the future.)

Change-Id: I7ace539be8bf927e21148c34b71e9c2b7535581e
Reviewed-on: https://code.wireshark.org/review/28245
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-06-12 22:14:19 +00:00
Guy Harris 871e964627 Add some length checks, remove a DISSECTOR_ASSERT().
Do more checks to make sure we don't run past the end of the data we're
handed, and don't do a DISSECTOR_ASSERT(), as there may well be packets
that don't have enough data to pass the assertion - that was causing
some errors to show up in the 2.6 buildbot when doing 802.11 decryption
tests.  Those errors should instead be reported as "sorry, we can't do
decryption" errors by the decryption code.

(XXX - the 802.11 *dissector* should probably be extracting the relevant
fields and doing the relevant checks, and hand the data to the
decryption code, so that we don't duplicate 802.11 frame parsing with
code that might not do as much necessary work as the 802.11 dissector.)

Tweak some comments while we're at it.

Change-Id: I1d230e07cec2fca8c23f265b5875a0bf83f79432
Reviewed-on: https://code.wireshark.org/review/28240
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-06-12 21:31:35 +00:00
Peter Wu f440561b8c dot11crypt: add bounds check for TDLS elements
Fixes a buffer overrun (read) of at most 255 bytes which could occur
while processing FTE in Dot11DecryptTDLSDeriveKey.

While at it, according to 802.11-2016 9.4.1.9, "A status code of
SUCCESS_POWER_SAVE_MODE also indicates a successful operation.". No idea
when it makes a difference, but let's implement it too.

Bug: 14686
Change-Id: Ia7a41cd965704a4d51fb5a4dc4d01885fc17375c
Fixes: v2.1.0rc0-1825-g6991149557 ("[airpdcap] Add support to decrypt TDLS traffic")
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8189
Reviewed-on: https://code.wireshark.org/review/27618
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-18 04:13:14 +00:00
Dario Lombardo 4a156da068 Remove autotools build system.
It has been replaced by cmake.

Change-Id: I83a5eddb8645dbbf6bca9f026066d2e995d8e87a
Reviewed-on: https://code.wireshark.org/review/26969
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-18 03:46:17 +00:00
Dario Lombardo 446d9486ae spdx: convert files with multiple licenses.
Change-Id: Iac29428b5a6d26896e559f06acf202f03fa8ec90
Reviewed-on: https://code.wireshark.org/review/26366
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-09 12:13:23 +00:00
Dario Lombardo fe71e26af2 spdx: more licenses converted.
Change-Id: I3861061ec261e63b23621799e020e811ed78a343
Reviewed-on: https://code.wireshark.org/review/26333
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-07 15:56:44 +00:00
Dario Lombardo 5e03b4e342 dot11decrypt: free memory on exit (found by clang).
Change-Id: I1af895accdd52fe64fc156905c549e719aaba304
Reviewed-on: https://code.wireshark.org/review/26182
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-03-04 11:43:06 +00:00
Gerald Combs e73e3580f6 Rename airpdcap to dot11decrypt.
Our 802.11 decryption code isn't tied to any specific product. Change
the file and API names to dot11decrypt.

Change-Id: I14fd951be3ae9b656a4e1959067fc0bdcc681ee2
Reviewed-on: https://code.wireshark.org/review/26058
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-02-24 11:56:18 +00:00
Gerald Combs 9c5803ff76 Airpdcap: Add length checks.
Make sure we don't underflow length values.

Bug: 14442
Change-Id: I71baac428ba3b07fe4cd5a7f60fbe2a957ac460e
Reviewed-on: https://code.wireshark.org/review/25937
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-02-21 01:05:29 +00:00