summaryrefslogtreecommitdiff
path: root/sys/net80211/ieee80211_input.c
AgeCommit message (Collapse)Author
2007-09-18arc4random_bytes() is the preferred interface for generating nonces;Damien Miller
"looks ok" markus@
2007-08-29- use ieee80211_get_hdrlen() where appropriate.Damien Bergamini
- discard all EAPOL-Key frames with an unknown descriptor version. - when receiving message 3/4 of the 4-way handshake, do not install the PTK if the INSTALL bit is not set. this fixes 4-way handshake with APs using group keys only. - similarly, do not mark the 802.1X port as valid if the SECURE bit is not set (it will be marked as valid after group key handshake).
2007-08-27rework ieee80211_recv_4way_msg2() function.Damien Bergamini
add some RSNA authenticator state machine bits.
2007-08-27Checking the MIC early in ieee80211_recv_eapol() does not work forDamien Bergamini
message 2/4 of the 4-way handshake because the authenticator must derive the PTK first (the MIC is computed using the KCK). Move calls to ieee80211_eapol_key_check_mic() - and as a consequence ieee80211_eapol_key_decrypt() - directly in the ieee80211_recv_{group,4way}_msg*() functions. Unconstify the first parameter since checking the MIC modifies the frame. Remove ni->ni_ptk_ok field while i'm here.
2007-08-23add a new ieee80211_save_ie() function to make a copy of anDamien Bergamini
information element in a management frame. the authenticator has to make a copy of the RSN/WPA1 IE from (Re)Association requests so that it can be compared with the one included in message 2/4 of the 4-way handshake.
2007-08-23add ieee80211_get_hdrlen() to compute the size of the 802.11 headerDamien Bergamini
of a management or data frame (check if the i_qos, i_ht or i_addr4 are present).
2007-08-23the authenticator can't differentiate 4-way handshake message 2 fromDamien Bergamini
message 4 based on the EAPOL-Key frame secure bit. the only thing that differentiate these messages is the presence of the RSN/WPA1 IE in the EAPOL-Key frame data field. only message 2/4 contains this IE.
2007-08-22- add k_rxmic and k_txmic fields to struct ieee80211_key to store theDamien Bergamini
Tx/Rx MIC for TKIP. - add two functions to map a PTK and a GTK to an IEEE 802.11 key and use them in ieee80211_input.c instead of duplicating the same code. properly set Tx/Rx MIC in the IEEE 802.11 key in the case of TKIP. - add ic_psk to struct ieee80211com to store the pre-shared key. - fix setting of the SECURE bit in outgoing EAPOL-Key frames. - when receiving msg 2 of the 4-way handshake, deauthenticate the station if the RSN IE does not match that of the (Re)Association request. - before parsing an RSN or WPA IE, check that there's enough room for the version field (2 bytes) which is mandatory. - various tweaks while i'm here.
2007-08-16back out part of last diff; breaks all hardware wep decryption.Theo de Raadt
from damien
2007-08-14Prevent sneaking in unencrypted packets into WEP traffic.Alexander Bluhm
ok damien@, put it ok deraadt@
2007-08-03fix parsing of GTK KDE.Damien Bergamini
2007-08-03add a ni_eapol_desc field to struct ieee80211_node to know whetherDamien Bergamini
a station is using WPA1 or RSN descriptors. make sure that a station that advertises WPA1 capability in an IE uses the WPA1 EAPOL-Key descriptor type and not the RSN one. fix construction of EAPOL-Key frames for WPA1. i can now successfuly complete a 4-way and group-key handshake with both a WPA1 and a WPA2 access point. add some TKIP encapsulation code (no SW crypto yet). ok deraadt@
2007-08-01allow ic_set_key to be NULL so that drivers won't need to implement itDamien Bergamini
(for instance if they don't support HW crypto).
2007-08-01make sure the MIC field is set in group key handshake messages beforeDamien Bergamini
passing the frame to the handlers.
2007-08-01make ieee80211_recv_wpa_group_msg1() install the GTK in ic_nw_keys[] too.Damien Bergamini
i only converted ieee80211_recv_rsn_group_msg1() in my previous commit.
2007-08-01add generic ieee80211_encrypt() and ieee80211_decrypt() functions thatDamien Bergamini
can handle multiple ciphers (the key to use is determined automatically by these functions based on the frame's destination address). add ieee80211_ccmp_encrypt() and ieee80211_ccmp_decrypt(). those two functions only do encapsulation/decapsulation of CCMP frames for now (they don't do SW crypto). they will help to test things with drivers that can do HW crypto. add a ni_pairwise_key field to struct ieee80211_node to actually install the pairwise transient key. install the GTK in ic_nw_keys[].
2007-08-01unbreak.Damien Bergamini
2007-08-01check the key length field in message 3 of the 4-way handshake.Damien Bergamini
change ieee80211_recv_eapol() so that it is called without the ethernet header striped.
2007-08-01group key handshake message 1 is very different between RSN and WPA1.Damien Bergamini
RSN uses a GTK KDE while WPA1 stores the GTK in the EAPOL-Key frame data field (encrypted) and uses some bits in the info field. split ieee80211_recv_group_msg1() in two separate functions.
2007-08-01pass the supplicant's nonce generated on reception of message 1 of theDamien Bergamini
4-way handshake to ieee80211_send_4way_msg2().
2007-08-01in 4-way handshake messages 2 and 3, parse vendor-specific WPA1 IEs too.Damien Bergamini
fix a test for ni_replaycnt_ok while i'm here.
2007-08-01PMKID KDE is optionnal in message 1 of the 4-way handshake (at leastDamien Bergamini
when using WPA-PSK). add a ni_replaycnt_ok flag to struct ieee80211_node to mark the replay counter as valid. the replay counter is marked valid only when message 3 of the 4-way handshake is received since message 1 contains no MIC.
2007-08-01fix parsing and construction of RSN/WPA IEs.Damien Bergamini
2007-08-01all WPA implementations i have tested use EAPOL-Key frames version 1,Damien Bergamini
so use that too and remove a check in ieee80211_recv_eapol(). WPA1 stores the group key id into bits 4-5 of the EAPOL-Key frame info field and uses bit 6 to indicate if the key is Rx/Tx or Rx only. remove a check in ieee80211_eapol_key_decrypt() because WPA1 encrypts the payload of message 1 of the group-key handshake without setting the encrypted bit in the info field.
2007-08-01KEYACK bit is not set for 4-way handshake messages 2 and 4.Damien Bergamini
it is set in message 3.
2007-08-01cipher suite type for CCMP is 4 not 3.Damien Bergamini
2007-07-28adds functions to parse and to build EAPOL-Key frames used inDamien Bergamini
the 4-way and group-key handshake. the state machine is still missing though so this is not used anywhere yet.
2007-07-14update QoS Tx/Rx sequence numbers for each TID.Damien Bergamini
add a parameter to ieee80211_decap() to handle different 802.11 header sizes. cleanup and clarify ieee80211_classify().
2007-07-13cleanup parsing of beacon and probe response mgmt frames.Damien Bergamini
2007-07-13in ieee80211_recv_assoc_resp(), do not start updating the nodeDamien Bergamini
structure until the frame has been fully validated.
2007-07-13change the way we parse IEs to make sure we never read past the end ofDamien Bergamini
the rx buffer.
2007-07-13properly check ieee80211_setup_rates() return code.Damien Bergamini
some cleanup while i'm here.
2007-07-06have ieee80211_parse_rsn() return a reason code so that we canDamien Bergamini
deauth associating stations with bad RSN IEs. cleanup parsing of vendor-specific IEs.
2007-07-06remove remaining bits for pre-RSNA shared authmode support.Damien Bergamini
it has been #if 0'd since 3.9 and we have never supported this mode (no ifconfig option etc...).
2007-07-06don't check the IEEE80211_CAPINFO_PRIVACY bit in (re)association requests.Damien Bergamini
the spec says that "APs ignore the Privacy subfield within received Association and Reassociation Request managements frames". if the IEEE80211_CAPINFO_ESS bit is not set, reply with the correct status code (IEEE80211_STATUS_CAPINFO instead of IEEE80211_STATUS_BASIC_RATE). indent things a bit while i'm here.
2007-07-04ignore WMM vendor IEs that are not parameter sets.Damien Bergamini
2007-07-03maintain the traffic-indication (TIM) virtual bitmap by definingDamien Bergamini
a default ieee80211_set_tim() function that drivers can override by setting ic_set_tim.
2007-07-03fix kernel builds with IEEE80211_DEBUG enabled.Damien Bergamini
pointed out by claudio@
2007-07-02split ieee80211_parse_rsn() so the same function can be usedDamien Bergamini
to parse both WPA1 and RSN (WPA2) IEs. rename ieee80211_parse_edca_params_common() into ieee80211_parse_edca_params_body() while i'm here.
2007-07-02replace some letoh16(*(u_int16_t *)frm) by LE_READ_2(frm)Damien Bergamini
for consistency.
2007-06-21add (currently unused) code to parse RSN IEs.Damien Bergamini
2007-06-21parse vendor-specific Microsoft WMM OUI.Damien Bergamini
unfortunately, most APs that advertise themselves as being 802.11e capable still use the Microsoft OUI instead of the standard IEEE 802.11 information element.
2007-06-21add code to parse EDCA parameter set information elements.Damien Bergamini
add myself to the copyright list.
2007-06-21split ieee80211_recv_mgmt() into smaller functions:Damien Bergamini
- ieee80211_recv_probe_resp - ieee80211_recv_probe_req - ieee80211_recv_auth - ieee80211_recv_assoc_req - ieee80211_recv_assoc_resp - ieee80211_recv_deauth - ieee80211_recv_disassoc "reads ok" jsg@ claudio@ mglocker@
2007-06-16move global declaration of ieee80211_merge_print_intvl into the onlyDamien Bergamini
function that uses it.
2007-06-16constifyDamien Bergamini
2007-06-16don't mix u_int{8,16,32}_t and uint{8,16,32}_tDamien Bergamini
use u_int{8,16,32}_t everywhere.
2007-06-16de-staticDamien Bergamini
ok jsg@
2007-06-06The license permits us to redistribute this code under the BSD or the GPLv2.Damien Bergamini
Choose the BSD license so that future enhancements will be BSD-only. ok jsg@ reyk@ deraadt@
2006-12-25print the phy mode in IFF_DEBUG status output which helps to debugReyk Floeter
dual/multi mode chipset operation. ok jsg@