From: Jouni Malinen Date: Tue, 16 Jan 2024 14:04:40 +0000 (+0200) Subject: tests: Extra element and KDE in EAPOL-Key msg 2/4 and 4/4 X-Git-Tag: hostap_2_11~470 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1b043750c001c9ebbc8eb301eb6f27c159452b0;p=thirdparty%2Fhostap.git tests: Extra element and KDE in EAPOL-Key msg 2/4 and 4/4 Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_ap_psk.py b/tests/hwsim/test_ap_psk.py index d5c2167e9..7675c3b27 100644 --- a/tests/hwsim/test_ap_psk.py +++ b/tests/hwsim/test_ap_psk.py @@ -3760,3 +3760,31 @@ def test_rsn_eapol_m3_no_encrypt(dev, apdev): raise Exception("Unencrypted GTK KDE not rejected") dev[0].request("DISCONNECT") dev[0].wait_disconnected() + +def test_rsn_eapol_m2_extra(dev, apdev): + """Extra element and KDE in EAPOL-Key msg 2/4""" + ssid = "test-rsn" + passphrase = 'qwertyuiop' + params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase) + hapd = hostapd.add_ap(apdev[0], params) + + # Add a reserved element and KDE into EAPOL-Key msg 2/4 + elems = '02051122334455' + 'dd05000facff11' + if "OK" not in dev[0].request("TEST_EAPOL_M2_ELEMS " + elems): + raise Exception("Failed to add test elements") + dev[0].connect(ssid, psk=passphrase, scan_freq="2412") + hapd.wait_sta() + +def test_rsn_eapol_m4_extra(dev, apdev): + """Extra element and KDE in EAPOL-Key msg 4/4""" + ssid = "test-rsn" + passphrase = 'qwertyuiop' + params = hostapd.wpa2_params(ssid=ssid, passphrase=passphrase) + hapd = hostapd.add_ap(apdev[0], params) + + # Add a reserved element and KDE into EAPOL-Key msg 4/4 + elems = '02051122334455' + 'dd05000facff11' + if "OK" not in dev[0].request("TEST_EAPOL_M4_ELEMS " + elems): + raise Exception("Failed to add test elements") + dev[0].connect(ssid, psk=passphrase, scan_freq="2412") + hapd.wait_sta()