aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMikael Kanstrup <mikael.kanstrup@sony.com>2020-10-20 21:34:22 +0200
committerAndersBroman <a.broman58@gmail.com>2020-10-21 11:03:44 +0000
commitad69ec2e118cbe23230378f2895416ceee398f9b (patch)
treef72e29a8e8c0ffdd17d0abe82931748b66d21962 /test
parente814fe0c9b1416125cf89b5b662739a6b162b2c8 (diff)
dot11decrypt: Fix WEP decryption
For WPA security association (SA) entries are created on sucessful PTK derivation from 4-way handshake frames. WEP though don't use 4-way handshake frames for key derivation and therefore no SA entry is created. Still WEP decryption implementaton expects to find an SA otherwise the decryption is skipped. Fix broken WEP decryption by removing the check for an existing SA entry and instead form the SA on first successful decryption. Add also a test for WEP decryption. Fixes: v3.3.0rc0-1263-g099d241046 ("dot11decrypt: Avoid allocating SA on packet decryption")
Diffstat (limited to 'test')
-rw-r--r--test/captures/wep.pcapng.gzbin0 -> 3147 bytes
-rw-r--r--test/config/80211_keys.tmpl1
-rw-r--r--test/suite_decryption.py10
3 files changed, 11 insertions, 0 deletions
diff --git a/test/captures/wep.pcapng.gz b/test/captures/wep.pcapng.gz
new file mode 100644
index 0000000000..e41f688e31
--- /dev/null
+++ b/test/captures/wep.pcapng.gz
Binary files differ
diff --git a/test/config/80211_keys.tmpl b/test/config/80211_keys.tmpl
index d60ac21e31..2341dd4254 100644
--- a/test/config/80211_keys.tmpl
+++ b/test/config/80211_keys.tmpl
@@ -1,4 +1,5 @@
# Keys needed for the decryption test suite
+"wep","1234567890"
"wpa-pwd","Induction"
"wpa-pwd","test0815"
"wpa-pwd","12345678"
diff --git a/test/suite_decryption.py b/test/suite_decryption.py
index a366620adb..bab0641df9 100644
--- a/test/suite_decryption.py
+++ b/test/suite_decryption.py
@@ -23,6 +23,16 @@ import fixtures
@fixtures.mark_usefixtures('test_env')
@fixtures.uses_fixtures
class case_decrypt_80211(subprocesstest.SubprocessTestCase):
+ def test_80211_wep(self, cmd_tshark, capture_file):
+ '''IEEE 802.11 WEP'''
+ # Included in git sources test/captures/wep.pcapng.gz
+ self.assertRun((cmd_tshark,
+ '-o', 'wlan.enable_decryption: TRUE',
+ '-r', capture_file('wep.pcapng.gz'),
+ ))
+ self.assertTrue(self.grepOutput('Who has 192.168.5.1'))
+ self.assertTrue(self.grepOutput('Echo \(ping\) request'))
+
def test_80211_wpa_psk(self, cmd_tshark, capture_file):
'''IEEE 802.11 WPA PSK'''
# https://gitlab.com/wireshark/wireshark/-/wikis/SampleCaptures?action=AttachFile&do=view&target=wpa-Induction.pcap