summaryrefslogtreecommitdiff
path: root/sys/net80211/ieee80211_input.c
AgeCommit message (Collapse)Author
2009-03-26sync with 802.11w draft 8.0.Damien Bergamini
the SA Query Transaction Identifier field is now a 16-bit non-negative counter value instead of a 128-bit random value.
2009-03-06Fix setting of the Short Slot Time subfield of the Capability InformationDamien Bergamini
field in (Re)Association Requests. This fixes association with APs refusing non-short-slot-time capable STAs. This should also prevent the AP we're associating with to disable the use of short slot time in the BSS as we join. Fix debug message in recv_assoc_resp() while I'm here (s/reason/status/). Scary. Thanks to Adam Emanuel for spotting this.
2009-02-08initial 802.11 defragmentation bits.Damien Bergamini
the code will allow the concurrent reception of fragments of three fragmented MSDUs or MMPDUs as required by the 802.11 standard.
2009-01-28Block Ack agreements are unidirectional.Damien Bergamini
Maintain state for both originator and recipient roles separately. Do not allocate receive reordering buffer in addba_request(). Test the "initiator" bit in incoming DELBA frames and set it appropriately in outgoing DELBA frames. Separate callbacks for Tx/Rx too. no binary change since all this is #ifdef'ed out.
2009-01-26Add some initial HT bits (not enabled yet) based on 802.11n Draft 7.01:Damien Bergamini
- implement A-MPDU frames buffering and reordering - implement A-MSDU decapsulation - process/send ADDBA Request, ADDBA Response and DELBA action frames - process Block Ack Request control frames (including MTBAR) - implement PBAC support (Protected Block Ack) - add some incomplete HT Capabilities and HT Operation IEs parsing Add more Management Frame Protection bits based on 802.11w Draft 7.0: - implement SA Query procedure (both AP and STA) - cleanup BIP Fix some bugs: - fix check for WEP key length that otherwise caused a stack smash in ieee80211_wep_encrypt (pointed out by Xavier Santolaria on macppc) - properly stop EAPOL timeout: fixes a panic that occured in HostAP mode when turning the interface down while a 4-way handshake is in progress (pointed out by Doughertys) Did some code cleanup too. The HT bits are currently not compiled in (IEEE80211_NO_HT is defined) because they won't be ready until after the next release and I didn't want to grow the kernel or to inadvertently introduce new bugs. They are here such that other people can look at the code. Notice that I had to add an extra parameter to ic_send_mgmt() for action frames, that is why there are small changes in drivers defining their own ic_send_mgmt() handler. Sorry for the not very incremental diff but this has been sitting in my tree for too long now.
2008-09-27Initial implementation of PMKSA caching and pre-authentication.Damien Bergamini
This will be required for future WPA-Enterprise support (802.1X). Add ieee80211_needs_auth() function (not implemented yet) to notify the userland 802.1X PACP machine when an 802.1X port becomes enabled (that is after successfull 802.11 Open System authentication). Add SIOCS80211KEYRUN and SIOCS80211KEYAVAIL ioctls so that the PACP state machine can kick the 802.11 key state machine and install PMKs obtained from 802.1X (pre-)authentication. Enable SHA-256 based AKMPs by default while I'm here (TGw). This uses SHA-256 for key-derivation (instead of SHA1), AES-128-CMAC for data integrity, and AES Key Wrap for data protection of EAPOL-Key frames. An OpenBSD AP will always advertise this capability and an OpenBSD STA will always prefer SHA-256 based AKMPs over SHA1 based ones if both are supported by an AP.
2008-09-27Add some inline functions to test the presence of optional 802.11Damien Bergamini
header fields (Sequence Control, Address 4, QoS Control, +HTC) and use them where appropriate. Add ieee80211_get_qos() inline function to extract the QoS control field of an 802.11 header instead of duplicating the same scary code everywhere (the location of this field depends on the presence of an Address 4 field). Export ieee80211_up_to_ac() so that drivers can select the access category to use based on the TID subfield of the QoS Control field. Define more QoS-related bits for the RSN Capabilities field of RSN IE (will be used later).
2008-09-01rework previously unused ieee80211_pwrsave() function, call it fromDamien Bergamini
ieee80211_mgmt_output() and ieee80211_encap(). use new IEEE80211_C_APPMGT capability flag where appropriate. rename ic_tim_mcast to ic_tim_mcast_pending.
2008-08-29move code to support Frequency-Hopping spread spectrum (FHSS) PHYsDamien Bergamini
to the Attic. nothing uses it in the tree and it is very unlikely that something will use it one day. the only driver supporting FHSS PHYs in the tree is ray(4) and it does not use net80211.
2008-08-28unbreak IEEE80211_DEBUGDamien Bergamini
2008-08-27introduce new IEEE80211_STA_ONLY kernel option that can be set toDamien Bergamini
remove IBSS and HostAP support from net80211 and 802.11 drivers. it can be used to shrink RAMDISK kernels for instance (like what was done for wi(4)). it also has the benefit of highlighting what is specific to IBSS and HostAP modes in the code. the cost is that we now have two code paths to maintain.
2008-08-14move the HostAP bridge code and the delivery of data frames to ether_inputDamien Bergamini
to a separate ieee80211_deliver_data() function. this will later be called by the A-MSDU deaggregation routine.
2008-08-14in ieee80211_input(), call if_start() after enqueuing frames in if_sndDamien Bergamini
when acting as an access point instead of having each driver doing the job. tested by krw@ (ral AP) and me with several drivers.
2008-08-13one should never use sizeof(struct llc) since 802.2 LLC headersDamien Bergamini
have a variable length. use LLC_SNAPFRAMELEN instead (which happen to be equal to sizeof(struct llc)) as we only deal with LLC+SNAP headers. some indentation tweaks while i'm here. no binary change.
2008-08-12adopt the integrity group cipher of the AP at association time.Damien Bergamini
2008-08-12add the code to encrypt/decrypt management frames, retrieve key idDamien Bergamini
from MMIE etc... this code can't be triggered as no drivers claim MFP capability yet.
2008-08-12clear Tx_Rx protection bits properly.Damien Bergamini
2008-08-12do not drop frames that have an invalid IE, just stop processingDamien Bergamini
more IEs.
2008-08-12populate ieee80211_recv_action(), does nothing yet.Damien Bergamini
2008-08-12new SHA-256 based AKMPs.Damien Bergamini
2008-08-12add/process group integrity cipher suite in RSN IEs.Damien Bergamini
add support for MFP negotiation during association.
2008-08-12Change the way we process EAPOL-Key frames.Damien Bergamini
Free the mbuf in the ieee80211_eapol_key_input() function. Do not assume the frame is contiguous, call m_pullup2() if it is not. We need the frame to be contiguous to process KDEs efficiently in EAPOL-Key frames (just like we process IEs in management frames). However, there are drivers like upgt(4) that use m_devget() in the RX path. m_devget() can return fragmented mbuf chains. Notice that we should do the same m_pullup2() for management frames. This will be done later. Remove the ic_recv_eapol callback.
2008-08-02do not use IEEE80211_QOS_TID. its definition in ieee80211.h isDamien Bergamini
wrong. hard-code 0xf for now. will be fixed post-release.
2008-08-02Drop frames that are received unencrypted when WEP is on or whenDamien Bergamini
WPA is on and RX protection for TA is on. Keep track of the TX/RX protection for each node when WPA is on. tested by djm@ (ral+wpa), ckuethe@ (ath-noenc) and krw@ (wpi<->ral+wpa). hints from bluhm@ has been in snaps for a few days. pointed out by bluhm@ something like 1 year ago but we did not have the right infrastructure to fix it properly at that time. ok deraadt@
2008-07-28ignore PS mode changes and PS-Poll from non-associated STAs.Damien Bergamini
keep track of the number of associated STAs in PS mode.
2008-07-28missing "goto err".Damien Bergamini
fix IEEE80211_DEBUG builds.
2008-07-27sanitize RX path a bit.Damien Bergamini
make sure drivers pass a contiguous header, check header length earlier. fix checking of frames sequence number for frames containing an Address 4 field (required for future work). fix processing of control frames (only pspoll for now).
2008-07-27s/IEEE80211_DPRINTF/DPRINTF/Damien Bergamini
automatically prepend __func__ to output. deobfuscates debug messages a bit. no binary change unless compiled with IEEE80211_DEBUG.
2008-07-21add ieee80211_priv.h file: contains definitions private to net80211.Damien Bergamini
this must not be included by drivers.
2008-07-21move processing of EAPOL frames away from ieee80211_{input,output}.cDamien Bergamini
2008-07-21instead of passing rx tstamp and rssi to the ieee80211_input function,Damien Bergamini
pass a pointer to an ieee80211_rxinfo structure containing those two fields plus an extra flags field that indicates whether the frame was decrypted by hardware or not. required for a future fix.
2008-06-09rename arc4random_bytes => arc4random_buf to match libc's nicer name;Damien Miller
ok deraadt@
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-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-10-29MALLOC/FREE -> malloc/freeCharles Longeau
ok krw@
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@