summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_output.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Block Ack agreements are unidirectional.damien2009-01-281-15/+25
| | | | | | | | | | 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.
* remove ni_ba field from ieee80211_node structure as it is not used yet.damien2009-01-261-2/+3
| | | | | | | this reduces memory footprint and avoids a stack usage warning in ieee80211_find_node() that breaks amd64 build. pointed out by landry@
* Add some initial HT bits (not enabled yet) based on 802.11n Draft 7.01:damien2009-01-261-49/+333
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
* cleanup ieee80211_classify(): retrieve VLAN tag from m_pkthdr.ether_vtag.damien2008-12-021-8/+3
|
* Initial implementation of PMKSA caching and pre-authentication.damien2008-09-271-6/+14
| | | | | | | | | | | | | | | | | | 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.
* Add some inline functions to test the presence of optional 802.11damien2008-09-271-2/+1
| | | | | | | | | | | | | | | | 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).
* third parameter of ieee80211_get_assoc_req() is a management framedamien2008-09-031-4/+4
| | | | | | | subtype, not a boolean indicating assoc or reassoc. rename the parameter and use if (type == IEEE80211_FC0_SUBTYPE_REASSOC_REQ) instead of if (reassoc). it worked only because IEEE80211_FC0_SUBTYPE_ASSOC_REQ is equal to 0.
* add ic_tid_noack bitmap to indicate a per-TID ACK policy (1=no ack,damien2008-09-011-6/+10
| | | | | | 0=normal ack). all bits are currently set to 0. use this bitmap to set the ACK policy of the QoS control field of outgoing QoS frames.
* extend ieee80211_classify() to extract DSCP field from IPv6 packets too.damien2008-09-011-25/+46
|
* rework previously unused ieee80211_pwrsave() function, call it fromdamien2008-09-011-19/+56
| | | | | | ieee80211_mgmt_output() and ieee80211_encap(). use new IEEE80211_C_APPMGT capability flag where appropriate. rename ic_tim_mcast to ic_tim_mcast_pending.
* move code to support Frequency-Hopping spread spectrum (FHSS) PHYsdamien2008-08-291-44/+5
| | | | | | | 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.
* introduce new IEEE80211_STA_ONLY kernel option that can be set todamien2008-08-271-8/+33
| | | | | | | | | 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.
* use LLC_SNAPFRAMELEN here too.damien2008-08-151-4/+4
|
* add the code to encrypt/decrypt management frames, retrieve key iddamien2008-08-121-1/+19
| | | | | from MMIE etc... this code can't be triggered as no drivers claim MFP capability yet.
* new SHA-256 based AKMPs.damien2008-08-121-2/+12
|
* add/process group integrity cipher suite in RSN IEs.damien2008-08-121-7/+23
| | | | add support for MFP negotiation during association.
* add IEEE80211_RSNIE_MAXLEN and IEEE80211_WPAIE_MAXLEN definitionsdamien2008-08-121-7/+13
| | | | | instead of hard-coding values. for RSN IE, request space for Group Integrity Cipher Suite.
* do not use IEEE80211_QOS_TID. its definition in ieee80211.h isdamien2008-08-021-2/+2
| | | | wrong. hard-code 0xf for now. will be fixed post-release.
* do not touch m after it has been enqueued with IFQ_ENQUEUE().damien2008-08-021-6/+8
| | | | | | | | copy m_pkthdr.len and m_flags before and use that after to update the statistics. from altq(4) man page and for consistency with what is done in other parts of the tree.
* Drop frames that are received unencrypted when WEP is on or whendamien2008-08-021-3/+5
| | | | | | | | | | | | | | 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@
* s/IEEE80211_DPRINTF/DPRINTF/damien2008-07-271-8/+7
| | | | | | | automatically prepend __func__ to output. deobfuscates debug messages a bit. no binary change unless compiled with IEEE80211_DEBUG.
* Fix a blatant misuse of MINCLSIZE I introduced in ieee80211_output.c r1.59damien2008-07-231-2/+2
| | | | | | | | | | | The bug was added on 04/16 but it started to show up only after 06/12 when the value of MINCLSIZE was changed to something different from MHLEN + 1. Thanks to dlg@ and giovanni (qgiovanni at gmail dot com) for putting me on the right track. Tested by giovanni. Should fix system/5881 too.
* add ieee80211_priv.h file: contains definitions private to net80211.damien2008-07-211-7/+2
| | | | this must not be included by drivers.
* move processing of EAPOL frames away from ieee80211_{input,output}.cdamien2008-07-211-565/+1
|
* Kernel implementation of the 4-way handshake and group-keydamien2008-04-161-163/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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@
* rework ieee80211_recv_4way_msg2() function.damien2007-08-271-3/+10
| | | | add some RSNA authenticator state machine bits.
* Checking the MIC early in ieee80211_recv_eapol() does not work fordamien2007-08-271-4/+1
| | | | | | | | | | 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.
* - add k_rxmic and k_txmic fields to struct ieee80211_key to store thedamien2007-08-221-8/+16
| | | | | | | | | | | | | | | 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.
* Fix the length calculation of the TIM bitmask in ieee80211_add_tim().claudio2007-08-051-2/+2
| | | | | | 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@
* add a ni_eapol_desc field to struct ieee80211_node to know whetherdamien2007-08-031-29/+77
| | | | | | | | | | | | 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@
* set key length field in message 1 & 3 of the 4-way handshake.damien2007-08-011-3/+9
|
* pass the supplicant's nonce generated on reception of message 1 of thedamien2007-08-011-3/+4
| | | | 4-way handshake to ieee80211_send_4way_msg2().
* fix parsing and construction of RSN/WPA IEs.damien2007-08-011-3/+3
|
* the EAPOL-Key MIC must be computed with the MIC bit set.damien2007-08-011-15/+8
| | | | | | | | this simplifies ieee80211_eapol_key_mic() and ieee80211_eapol_key_check_mic() quite a bit. set the EAPOL-Key body length before computing the MIC since the MIC is computed with the 802.1X header too. add a missing htons() while i'm here.
* cipher suite type for CCMP is 4 not 3.damien2007-08-011-3/+3
|
* adds functions to parse and to build EAPOL-Key frames used indamien2007-07-281-4/+435
| | | | | | the 4-way and group-key handshake. the state machine is still missing though so this is not used anywhere yet.
* update QoS Tx/Rx sequence numbers for each TID.damien2007-07-141-43/+44
| | | | | | add a parameter to ieee80211_decap() to handle different 802.11 header sizes. cleanup and clarify ieee80211_classify().
* do not increment ic_stats.is_tx_nombuf in ieee80211_get_rts() anddamien2007-07-131-11/+9
| | | | ieee80211_get_cts_to_self() if mbuf allocation fails.
* cleanup the computation of mgmt frames sizes.damien2007-07-061-72/+48
| | | | still very ugly but hopefully correct.
* remove remaining bits for pre-RSNA shared authmode support.damien2007-07-061-53/+5
| | | | | it has been #if 0'd since 3.9 and we have never supported this mode (no ifconfig option etc...).
* always set the IEEE80211_CAPINFO_ESS bit in association requests.damien2007-07-051-7/+2
| | | | | fixes my 1.36 commit (the bit should not be set for non-AP STA only in Probe Responses and Beacons).
* move the logic of determining whether an extended supported rates IE isdamien2007-07-051-20/+32
| | | | needed or not to the callers (instead of doing nothing in add_xrates).
* split ieee80211_add_rsn() so that the code can be reused fordamien2007-07-051-16/+59
| | | | vendor-specific IE.
* allow USEGROUP as the pairwise cipher for RSN IE.damien2007-07-041-5/+19
| | | | add RSN IE to beacons, probe responses and (re)association requests.
* maintain the traffic-indication (TIM) virtual bitmap by definingdamien2007-07-031-17/+11
| | | | | a default ieee80211_set_tim() function that drivers can override by setting ic_set_tim.
* add a function that builds an RSN IE (ieee80211_add_rsn).damien2007-07-031-1/+80
|
* move construction of IEs into individual functions so that we don'tdamien2007-07-031-171/+203
| | | | | | duplicate the same code multiple times. add references to the spec for all these functions. fixes beacon_alloc() for FH PHYs as a side-effect.
* don't set the IEEE80211_CAPINFO_ESS bit in the Capability Informationdamien2007-07-031-9/+13
| | | | field if we're not operating as an AP (see 7.3.1.4).
* no TIM in probe reponses.damien2007-07-031-9/+1
|
* In ieee80211_getmbuf(), if we need to allocate a mbuf cluster becausedamien2007-07-031-2/+5
| | | | | | | the length is greater than MHLEN, test that the allocation succeeded. Otherwise, free the mbuf header and return NULL. Callers assume that if the function returns a value != NULL then enough space has been allocated.