summaryrefslogtreecommitdiff
path: root/sys/net80211/ieee80211_crypto_tkip.c
AgeCommit message (Collapse)Author
2011-04-05Passing M_WAITOK to mbuf functions is supposed to be a contract betweenBret Lambert
the caller and the function that the function will not fail to allocate memory and return a NULL pointer. However, m_dup_pkthdr() violates this contract, making it possible for functions that pass M_WAITOK to be surprised in ways that hurt. Fix this by passing the wait flag all the way down the functions that actually do the allocation for m_dup_pkthdr() so that we won't be surprised. man page update forthcoming ok claudio@
2010-07-20Switch some obvious network stack MAC comparisons from bcmp() toMatthew Dempsky
timingsafe_bcmp(). ok deraadt@; committed over WPA.
2009-10-30missing \n in log() message.Damien Bergamini
from Jurjen Oskam.
2009-09-24do not call m_free(n0) followed by m_freem(n0) when m_dup_pkthdr()Damien Bergamini
call fails. this double-free was introduced with the M_DUP_PKTHRD to m_dup_pkthdr change that got committed before I had a chance to review it.
2009-09-13M_DUP_PKTHDR() define -> m_dup_pkthdr() function to properly dealKenneth R Westerback
with m_tag_copy_chain() failures. Use m_defrag() to eliminate hand rolled defragging of mbufs and some uses of M_DUP_PKTHDR(). Original diff from thib@, claudio@'s feedback integrated by me. Tests kevlo@ claudio@, "reads ok" blambert@ ok thib@ claudio@, "m_defrag() bits ok" kettenis@
2009-04-16make TKIP TSC start at 1 (instead of 0) to match the standard.Damien Bergamini
many implementations (including ours) will drop frames with a TSC equal to 0 (they are considered replayed frames.)
2009-04-14do not cache the computed TTAK unless MIC has been verified.Damien Bergamini
this prevents an attacker from changing the TTAK (DoS attack) by sending a frame with a large TSC but with a bad ICV and/or MIC. now an attacker can only invalidate the cached TTAK.
2008-12-03typos in comments - no binary change.Damien Bergamini
2008-11-13use different TSCs when sending the two MIC failure report framesDamien Miller
to our AP as we enter TKIP countermeasures by caching the TSC of the last frame to fail the MIC; prompted by and ok damien@
2008-11-13Mitigate the new WPA attack described in Beck, M. and Tews S. "PracticalDamien Miller
attacks against WEP and WPA". The attack works by using the MIC failure notification messages sent station->AP on MIC failure as an oracle to verify guesses to reverse the CRC. To stop this, we can skip sending these notify frames except when we are going into "countermeasures" mode (drop the AP association, do not process traffic for 60s). When we go into countermeasures, I send two MIC failure notifications in a row - this should force the AP into countermeasures too. ok damien@
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-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-12maintain a count of TKIP and CCMP replayed frames.Damien Bergamini
some cleanup while i'm here.
2008-08-12retrieve the TID from QoS frames to use with the appropriateDamien Bergamini
replay counter.
2008-08-12use MINCLSIZE to decide wether we need to allocate an mbuf cluster insteadHenning Brauer
of MLEM, damien ok
2008-07-26call Phase1 every 2**16 frames instead of calling it for every frame.Damien Bergamini
properly handle frames with an address 4 field (required for future work). remove useless #includes.
2008-04-26small optimization of TKIP mixing phase 2 (for little-endian architectures).Damien Bergamini
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-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@