summaryrefslogtreecommitdiff
path: root/sys/net80211
AgeCommit message (Collapse)Author
2008-04-26move things from ieee80211_ifattach() to ieee80211_crypto_attach().Damien Bergamini
2008-04-26small optimization of TKIP mixing phase 2 (for little-endian architectures).Damien Bergamini
2008-04-26unbreak hostap mode.Damien Bergamini
do not parse RSN IE from beacons/probe responses if not scanning.
2008-04-21move ieee80211_ibss_merge() from ieee80211_input.c to ieee80211_node.cDamien Bergamini
2008-04-21move ieee80211_auth_open() to ieee80211_proto.cDamien Bergamini
move ieee80211_setup_rates() to ieee80211_node.c move some prototypes from ieee80211_proto.h to ieee80211_crypto.h
2008-04-21refuse association requests containing a wildcard SSID.Damien Bergamini
2008-04-21- do not process ethernet PAE frames if RSN is not enabledDamien Bergamini
- add a ieee80211_recv_action() function (will be used later) - some cleanup, remove unused prototypes, get rid of the IEEE80211_VERIFY_* macros
2008-04-21Some WPA1+WPA2 APs include both a WPA and an RSN IE in message 3 of theDamien Bergamini
4-way handshake, regardless of what protocol the supplicant is using. Ignore the IEs we don't care about instead of deauthenticating with a reason code of 'RSN_DIFFERENT_IE'.
2008-04-18extend the if_ethersubr.c crc functions to support updating a runningDamien Miller
crc in addition to the existing "oneshot" mode and use them to replace ieee80211_crc_update() with the new ether_crc32_le_update(). Saves 1k kernel bss + some code. Mark the new ether_crc32_[lb]e_update functions as __pure for a ~25x speedup (on my i386 at least). feedback and ok damien@
2008-04-17call ieee80211_crc_init() only once, when the first 802.11 deviceDamien Bergamini
attaches instead of at every attach. discussed with deraadt@
2008-04-16Kernel implementation of the 4-way handshake and group-keyDamien Bergamini
handshake protocols (both supplicant and authenticator state machines) as defined in the IEEE 802.11i standard. Software implementation of the TKIP (Temporal Key Integrity Protocol) and CCMP (CTR with CBC-MAC Protocol) protocols. This diff doesn't implement any of the 802.1X authentication protocols and thus only PSK authentication (using pre-shared keys) is currently supported. In concrete terms, this adds support for WPA-PSK and WPA2-PSK protocols, both in station and hostap modes. The following drivers are marked as WPA-capable and should work: bwi(4), malo(4), ral(4), iwn(4), wpi(4), ural(4), rum(4), upgt(4), and zyd(4) The following options have been added to ifconfig(8): wpa, wpapsk, wpaprotos, wpaakms, wpaciphers, wpagroupcipher wpa-psk(8) can be used to generate keys from passphrases. tested by many@ ok deraadt@
2007-11-25return ENOTTY not EINVAL for an unknown ioctl.Brad Smith
ok reyk@ deraadt@ jsg@ dlg@
2007-11-17make it clear in the code and in the man page that the rate2plcp andDamien Bergamini
plcp2rate functions use plcp codes in most-significant-bit-first format (R4-R1). some drivers like wpi(4) and iwn(4) want plcp codes in lsb-first format so they can't use those functions. also the IEEE standard uses R1-R4 notation so this can be a bit confusing for those refering to it. use u_int8_t for plcp code and rate instead of int.
2007-11-14Add ieee80211_rate2plcp() and ieee80211_plcp2rate() functions, whichMarcus Glocker
convert the PLCP header signal field to a rate value and vice versa. This implementation has been discussed with Damien and doesn't change any existing net80211 structures. ok damien@
2007-11-03Revert last commit which added ieee80211_rate2plcp() andMarcus Glocker
ieee80211_plcp2rate() because I've got a late feedback from Damien that he dislike the implementation method a lot.
2007-11-01Add ieee80211_rate2plcp() and ieee80211_plcp2rate() functions.Marcus Glocker
Help and OK reyk@
2007-10-29MALLOC/FREE -> malloc/freeCharles Longeau
ok krw@
2007-10-08Get trunk(4) working again with 802.11 devices. Spotted by ajacoutot@.Marcus Glocker
Diff has been done in co-work with damien@, jsg@, reyk@, and claudio@. OK damien@
2007-09-18arc4random_bytes() is the preferred interface for generating nonces;Damien Miller
"looks ok" markus@
2007-09-15realy -> really in comments. Most reported on tech@ by Jung.Kenneth R Westerback
2007-09-11remove horrid casts now that SHA1Update() has been constified.Damien Bergamini
2007-09-07use new malloc M_ZERO flag + replace MALLOC with mallocDamien Bergamini
2007-08-29typo in a macro (fortunately unused): 0c00 -> 0x00Damien Bergamini
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-23add pseudo-header definition for TKIP MIC computation.Damien Bergamini
2007-08-23fix ieee80211_map_ptk() for TKIP.Damien Bergamini
2007-08-22add a ieee80211_get_txkey() function to determine the key to use forDamien Bergamini
transmitting a frame to a given node. change ieee80211_encrypt() so that it now takes the key as parameter. this change is required because drivers doing hardware crypto need to know what key is being used.
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-05Fix the length calculation of the TIM bitmask in ieee80211_add_tim().Claudio Jeker
Even no bit was set we copied the full 225bytes bitmaks into the beacon. Found the hard way with acx(4) by mglocker@ and myself. OK mglocker@ damien@
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-01set key length field in message 1 & 3 of the 4-way handshake.Damien Bergamini
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-01add a TSC field to the key structure. it will be used to store theDamien Bergamini
TKIP sequence counter (TKIP) or the PN (packet number, CCMP).
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.