Commit Graph

2188 Commits

Author SHA1 Message Date
Denis Kenzior b801f5b47f TODO: Mark 'Group Traffic not Allowed' as done 2017-10-23 11:40:00 -05:00
Andrew Zaborowski 828b8b7708 autotests: Add the AP mode test 2017-10-23 11:17:14 -05:00
Andrew Zaborowski 4dba9e37dd netdev: Track the id of the SET_STATION netlink command
This way we make sure it gets cancelled any sort of connect abort of
netdev removal and don't leak the message on error.
2017-10-23 11:17:11 -05:00
Andrew Zaborowski a03839f8ef netdev: Send SET STATION in pairwise key callback
When the 4-Way Handshake is done eapol.c calls netdev_set_tk, then
optionally netdev_set_gtk and netdev_set_igtk.  To support the no group
key option send the final SET STATION enabling the controlled port
inside the callback for the netdev_set_tk operation which always means
the end of a 4-Way Handshake rather than in the netdev_set_gtk callback.
The spec says exactly that the controlled port is enabled at the end of
the 4-Way Handshake.

The netlink operations will still be queued in the same order because
the netdev_set_tk/netdev_set_gtk/netdev_set_igtk calls happen in one
main loop iteration but even if the order changed it wouldn't matter.
On failure of any of the three operations netdev_setting_keys_failed
gets called and the remaining operations are cancelled.
2017-10-23 11:17:08 -05:00
Andrew Zaborowski ffcda135d2 eapol: Check for "No Group Traffic" group cipher suite 2017-10-23 11:14:40 -05:00
Denis Kenzior 2c565019c7 eapol: Silence uninitialized var warnings 2017-10-20 07:41:56 -05:00
Denis Kenzior e17d5abc70 TODO: Add EAP-OTP and EAP-GTC tasks 2017-10-19 20:43:26 -05:00
Denis Kenzior a8a9eb4a1c TODO: Add EAP-LEAP task 2017-10-19 20:36:08 -05:00
Denis Kenzior e74caf3c80 TODO: Add WiFi P2P tasks 2017-10-19 20:33:23 -05:00
Denis Kenzior 3a74286949 TODO: Mark RRM task as done 2017-10-19 20:25:16 -05:00
Denis Kenzior d5e0882938 TODO: Mark Fast Transition over Air task as Done 2017-10-19 20:20:06 -05:00
Denis Kenzior 4df406b99c TODO: Mark Preauthentication task as done 2017-10-19 20:17:55 -05:00
Denis Kenzior f49b5ed742 TODO: Mark SOCKET_OWNER task as done 2017-10-19 20:07:06 -05:00
Denis Kenzior a1f4a9901d unit: Add EAPoL retransmission test 2017-10-19 16:47:35 -05:00
Denis Kenzior 7f8f45220e eapol: Do not install the same GTK/IGTK
Track the contents and size of the GTK and IGTK and if the Authenticator
(or an adversary) tries to set the same GTK/IGTK, process the packet
normally but do not resubmit the GTK/IGTK to the kernel.
2017-10-19 16:47:35 -05:00
Denis Kenzior cd7af67aac eapol: Tighten up GTK/IGTK KDE validation
GTK KDE was being checked for being a minimum of 6 bytes.  Not quite
sure why since the minimum GTK key length is 16 bytes for CCMP.
Similarly make sure that the maximum length is not more than 32, which
is currently the largest key size (TKIP)
2017-10-19 16:47:35 -05:00
Denis Kenzior c93a52c066 eapol: Handle retransmissions 2017-10-19 16:47:29 -05:00
Denis Kenzior f07164b2ef eapol: Remove unneeded {} 2017-10-18 20:40:10 -05:00
Denis Kenzior ac5d8c2b34 eapol: Reword comment 2017-10-18 20:39:31 -05:00
Denis Kenzior bee04b179e eapol: Fail handshake if MIC calculation fails
This is a bizarre case since MIC calculation succeeded for the incoming
packet.  But just in case MIC calculation fails for the outgoing packet,
kill the handshake.
2017-10-18 20:38:54 -05:00
Denis Kenzior c1a0e844b0 eapol: Tighten up replay counter handling 2017-10-18 20:31:49 -05:00
Denis Kenzior 5b6c18fadd watchlist: Fix memory leak 2017-10-18 19:29:24 -05:00
James Prestwood 8ce787557f simutil: fixup adding const to data pointer
eap_sim_add_attribute() was not taking a const uint8_t * as
it should.
2017-10-18 11:18:26 -05:00
James Prestwood 32907c10df autotest: make hlrauc.py able to run standalone
For testing purposes, it is useful to run hlrauc.py by itself
not including it from another python script like autotests do.

Better error checking was also added as testing can result in
badly formatted data.
2017-10-18 11:17:43 -05:00
James Prestwood 98a5d2b9be docs: Updated docs for EAP-SIM/AKA autotests
The hostapd .config must be changed to compile in code
for EAP-SIM/AKA/AKA'
2017-10-18 11:16:46 -05:00
Denis Kenzior ffbf10fa31 eapol: Remove erroneous comments
The comments quoted sections of the specification that indicated STA
behavior for verifying Message 3 of 4 or GTK 1 of 2.  But in reality the
code directly below simply calculated the MIC for Message 4 of 4 or GTK
2 of 2.
2017-10-16 14:41:57 -05:00
Andrew Zaborowski dae0abbac8 eapol: Use frame watches for preauth_sm 2017-10-12 11:14:59 -05:00
Andrew Zaborowski cc4da26f69 eapol: Use frame watches for eapol_sm, refactor
Use eapol_frame_watch_add/eapol_frame_watch_remove in eapol_sm, while
there simplify the early_frame logic and confirm sender address for
received frames.
2017-10-12 11:13:51 -05:00
Andrew Zaborowski 06b8be902e autotests: Reset _exception after _wait_for_async_op
We need to reset self._exception after _wait_for_async_op raises an
exception, otherwise _wait_for_async_op will report that exception for
every future operation (this wasn't an issue when an exception always
meant that the test was failing and objects were torn down anyway)
2017-10-12 10:55:59 -05:00
Andrew Zaborowski 07d07bb2ca autotests: Fix an assertRaises parameter 2017-10-12 10:55:55 -05:00
Andrew Zaborowski 47ae8571c1 ap: Drop unneeded ap_deauth_cb cleanup step
ap_free_sta() later in ap_deauth_cb already cancels the command.
2017-10-12 10:55:02 -05:00
Andrew Zaborowski 69687bedd1 ap: Implement Deauthentication on error 2017-10-12 10:54:45 -05:00
Andrew Zaborowski 375e2262f2 ap: Implement Reassociation
Add some form of the Reassociation procedure with comment on the
interpretation choice.
2017-10-12 10:54:24 -05:00
Andrew Zaborowski a26ca0fb66 ap: Simplify ap_common_rates
If we've checked that the STA has included our Basic Rate we've already
found one common rate, no need for further checks.
2017-10-12 10:53:07 -05:00
Andrew Zaborowski f011b81b19 ap: Implement EAPOL frame retries 2017-10-12 10:52:48 -05:00
Andrew Zaborowski 9d05a6ddb7 ap: Reorder ap_assoc_req_cb, fix comment
Set all the new field values into struct sta_state only after all the
error checks for better readabilty and fixing a possible issue if we
did "sta->rates = rates" and then detected en error and freed "rates".
Also update a comment which I think used the wording from 802.11-2012
instead of 802.11-2016.
2017-10-12 10:47:12 -05:00
Andrew Zaborowski 3d9cbdb6f6 ap: Drop two unneeded DEL_KEY commands
DEL_KEY is not needed and will return errors right after NEW_STATION or
right after DEL_STATION.  In both cases the kernel makes sure there are
no old keys for the station already.
2017-10-12 10:46:17 -05:00
Andrew Zaborowski 3c64d21e34 ap: Use ie_tlv_builder in ap_build_beacon_pr_head 2017-10-12 10:46:14 -05:00
Andrew Zaborowski ba78950c83 crypto: Use l_pkcs5_pbkdf2 in place of local pbkdf2_sha1 2017-10-09 14:34:31 -05:00
Andrew Zaborowski 525ecbb113 unit: Remove pbkdf2_sha1 tests
They can now be moved to ELL.
2017-10-09 14:34:31 -05:00
Andrew Zaborowski 31631e1935 device: Add temporary Start / StopAccessPoint Dbus methods
As a temporary DBus API to switch between Station and Access Point
modes, add two methods on the Device interface.  Add a new state
DEVICE_STATE_ACCESS_POINT which is in effect from the moment
StartAccessPoint is received (even before it returns) until
StopAccessPoint returns, there are no intermediate states when the
methods run for simplicity.  Add checks across device.c to make sure
Station related functionality is disabled when in Access Point mode.
2017-09-22 12:50:12 -05:00
Andrew Zaborowski aca698573f ap: Handle netdev DOWN event 2017-09-22 12:44:41 -05:00
Andrew Zaborowski 251edd2557 ap: Handle PTK handshake frame 4/4
Handle the 4-Way Handshake last frame, install keys, enable data frames
on the controlled port.
2017-09-22 12:44:17 -05:00
Andrew Zaborowski a3361c5077 ap: Handle PTK handshake frame 2/4, send frame 3/4 2017-09-22 12:43:09 -05:00
Andrew Zaborowski c505de3582 ap: Send PTK handshake frame 1 of 4 2017-09-22 12:41:41 -05:00
Andrew Zaborowski 89c2f14683 eapol: Add eapol_append_key_data utility
Add a utility to append a KDE to the key_data field in an EAPoL frame.
The KDE types enum is actually added to handshake.h because we've got
the utilities for finding those KDEs in a buffer there.  The new
function is specific to EAPoL-Key frames though and perhaps to simple to
be split across handshake.c and eapol.c.  Also it didn't seem useful to
use the ie_tlv_builder here.
2017-09-22 12:38:42 -05:00
Andrew Zaborowski 29ee350ec3 ap: Handle Association / Disassociation
Parse Association Request frames and send Association Responses, handle
Disassociation.  With this we should be able to receive uncontrolled
port data frames since we register the STAs with the kernel.

In this version I don't register for Reassociation frames.
2017-09-22 12:32:19 -05:00
Andrew Zaborowski 1842fe542b ap: Handle Authentication and Deauthentication frames
Parse authentication frames and send responses, manage a list of STAs.
2017-09-22 12:29:33 -05:00
Andrew Zaborowski d8378c5a0f ap: Handle Probe Request frames
Parse probe requests and send probe responses to show up in active
scans.
2017-09-22 12:26:06 -05:00
Andrew Zaborowski 45c4e0589b netdev: Use mpdu_validate on received registered frames
This way the individual frame handlers have less validation to do.
2017-09-22 12:19:28 -05:00