OpenBSD CVS

CVS log for src/sys/net80211/ieee80211_pae_input.c


[BACK] Up to [local] / src / sys / net80211

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.37 / (download) - annotate - [select for diffs], Thu Nov 19 20:03:33 2020 UTC (3 years, 6 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, HEAD
Changes since 1.36: +21 -5 lines
Diff to previous 1.36 (colored)

Always check for EBUSY when the return value of ic_set_key() is tested.

Fixes urtwn(4) repeated DEAUTH and subsequent loss/restoration of link.
It was a great dhclient(4) stress test. Note that urtwn(4) is the first
and so far only device whose *_set_key() function returns EBUSY.

Debugging hints and ok stsp@

Revision 1.36 / (download) - annotate - [select for diffs], Thu Nov 12 13:31:19 2020 UTC (3 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.35: +29 -9 lines
Diff to previous 1.35 (colored)

Don't enable port or link until all crypto keys are installed by
async task(s).

Makes dhclient(8) much happier.

Suggestions and ok stsp@, jmatthew@

Revision 1.35 / (download) - annotate - [select for diffs], Mon Jul 13 08:26:26 2020 UTC (3 years, 10 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.34: +3 -1 lines
Diff to previous 1.34 (colored)

When a wifi interface acts as a client and the WPA handshake is done,
update the WPA group cipher value in interface configuration data.

Code relying in this value will otherwise get the group cipher wrong.
One obvious example is ifconfig which now displays the negotiated group
cipher rather than always displaying the default value 'ccmp'.

Fixes a regression where athn(4) no longer worked against WPA2 APs which
use TKIP as a group cipher for compatibility with WPA1.

Problem reported by Tim Chase.

ok kettenis@

Revision 1.34 / (download) - annotate - [select for diffs], Sun May 31 09:11:12 2020 UTC (4 years ago) by stsp
Branch: MAIN
Changes since 1.33: +4 -4 lines
Diff to previous 1.33 (colored)

Typo in WPA supplicant state machine: RNSA_SUPP_PTKDONE -> RSNA_SUPP_PTKDONE

Revision 1.33 / (download) - annotate - [select for diffs], Mon Sep 2 12:54:21 2019 UTC (4 years, 9 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.32: +4 -1 lines
Diff to previous 1.32 (colored)

Make net80211 expose reasons for association failures to userland and have
ifconfig display them in 'scan' output and on the ieee80211 status line if
the failure is applicable to an already selected AP (e.g. wrong WPA key).

This will hopefully reduce the amount of help requests for what often
turn out to be trivial misconfiguration issues that were previously
hard to diagnose without debug mode.

ifconfig must be recompiled with the new ieee80211_ioctl.h to stay in
sync with the kernel. A full 'make build' will do the right thing!

Very helpful input by mpi@ and deraadt@

Revision 1.32 / (download) - annotate - [select for diffs], Fri Nov 2 14:40:24 2018 UTC (5 years, 7 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.31: +6 -16 lines
Diff to previous 1.31 (colored)

Remove 'reused group key update received' printfs.
These have served no useful purpose in practice; all reported instances were
legitimate group key retransmissions by the AP, e.g. after laptop suspend.
We fixed KRACK long ago; re-used group key messages are nothing to worry about.

Revision 1.31 / (download) - annotate - [select for diffs], Mon Oct 16 10:39:41 2017 UTC (6 years, 7 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.30: +18 -1 lines
Diff to previous 1.30 (colored)

Add comments which document already fixed WPA attack vectors.

Revision 1.25.6.3 / (download) - annotate - [select for diffs], Wed Aug 30 15:08:46 2017 UTC (6 years, 9 months ago) by stsp
Branch: OPENBSD_6_0
Changes since 1.25.6.2: +111 -72 lines
Diff to previous 1.25.6.2 (colored) to branchpoint 1.25 (colored) next main 1.26 (colored)

MFC:
Add an entry to dmesg if pairwise WPA keys arrive unexpectedly or if WPA
group keys are being reused. OpenBSD wireless clients will now leave a
trail of such events in their message log.

Clear WPA group keys from memory before initiating a key exchange
with an access point. Prevents false positive 'reused group key'
warnings in dmesg when re-associating to the same access point.

(OpenBSD 6.0 errata 041, August 30, 2017)

Revision 1.28.4.2 / (download) - annotate - [select for diffs], Wed Aug 30 15:08:30 2017 UTC (6 years, 9 months ago) by stsp
Branch: OPENBSD_6_1
Changes since 1.28.4.1: +111 -72 lines
Diff to previous 1.28.4.1 (colored) to branchpoint 1.28 (colored) next main 1.29 (colored)

MFC:
Add an entry to dmesg if pairwise WPA keys arrive unexpectedly or if WPA
group keys are being reused. OpenBSD wireless clients will now leave a
trail of such events in their message log.

Clear WPA group keys from memory before initiating a key exchange
with an access point. Prevents false positive 'reused group key'
warnings in dmesg when re-associating to the same access point.

(OpenBSD 6.1 errata 027, August 30, 2017)

Revision 1.30 / (download) - annotate - [select for diffs], Thu Aug 17 06:01:05 2017 UTC (6 years, 9 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.29: +111 -72 lines
Diff to previous 1.29 (colored)

Add an entry to dmesg if pairwise WPA keys arrive unexpectedly or if WPA
group keys are being reused. OpenBSD wireless clients will now leave a
trail of such events in their message log.

There has been increased public scrutiny of WPA's security recently, so
I am curious to see if anyone is attempting replay attacks in the wild.

ok deraadt

Revision 1.25.6.2 / (download) - annotate - [select for diffs], Wed Aug 2 16:51:38 2017 UTC (6 years, 10 months ago) by deraadt
Branch: OPENBSD_6_0
Changes since 1.25.6.1: +7 -5 lines
Diff to previous 1.25.6.1 (colored) to branchpoint 1.25 (colored)

Fix length checks in EAPOL key frame parsing.
Problem reported by Ilja Van Sprundel.
errata 39

Revision 1.28.4.1 / (download) - annotate - [select for diffs], Tue Aug 1 22:30:29 2017 UTC (6 years, 10 months ago) by bluhm
Branch: OPENBSD_6_1
Changes since 1.28: +7 -5 lines
Diff to previous 1.28 (colored)

Fix length checks in EAPOL key frame parsing.
Problem reported by Ilja Van Sprundel.
errata 023

Revision 1.29 / (download) - annotate - [select for diffs], Sat Jul 22 16:48:21 2017 UTC (6 years, 10 months ago) by stsp
Branch: MAIN
Changes since 1.28: +7 -5 lines
Diff to previous 1.28 (colored)

Fix length checks in EAPOL key frame parsing.
Problem reported by Ilja Van Sprundel.
ok tb@ kevlo@

Revision 1.25.6.1 / (download) - annotate - [select for diffs], Wed Mar 1 20:57:51 2017 UTC (7 years, 3 months ago) by benno
Branch: OPENBSD_6_0
Changes since 1.25: +35 -1 lines
Diff to previous 1.25 (colored)

MFC: Fix a bug allowing a man-in-the-middle attack against WPA wireless clients.
A malicious AP could trick clients into connecting to the malicious AP
instead of the desired AP. All frames would then be sent in the clear.
This problem was found and reported by Mathy Vanhoef who also provided
an initial patch which we improved together.
(OpenBSD 5.9 errata 35, Mar 1, 2017)
by and ok stsp@

Revision 1.25.2.1 / (download) - annotate - [select for diffs], Wed Mar 1 20:57:29 2017 UTC (7 years, 3 months ago) by benno
Branch: OPENBSD_5_9
Changes since 1.25: +35 -1 lines
Diff to previous 1.25 (colored) next main 1.26 (colored)

MFC: Fix a bug allowing a man-in-the-middle attack against WPA wireless clients.
A malicious AP could trick clients into connecting to the malicious AP
instead of the desired AP. All frames would then be sent in the clear.
This problem was found and reported by Mathy Vanhoef who also provided
an initial patch which we improved together.
(OpenBSD 6.0 errata 18, Mar 1, 2017)
by and ok stsp@

Revision 1.28 / (download) - annotate - [select for diffs], Wed Mar 1 20:20:45 2017 UTC (7 years, 3 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE
Branch point for: OPENBSD_6_1
Changes since 1.27: +5 -5 lines
Diff to previous 1.27 (colored)

Fix some DPRINTFs I just added to ieee80211_pae_input.c.
No fnuctional change.

Revision 1.27 / (download) - annotate - [select for diffs], Wed Mar 1 19:28:48 2017 UTC (7 years, 3 months ago) by stsp
Branch: MAIN
Changes since 1.26: +35 -1 lines
Diff to previous 1.26 (colored)

Fix a bug allowing a man-in-the-middle attack against WPA wireless clients.
A malicious AP could trick clients into connecting to the malicious AP
instead of the desired AP. All frames would then be sent in the clear.
This problem was found and reported by Mathy Vanhoef who also provided
an initial patch which we improved together.

Revision 1.26 / (download) - annotate - [select for diffs], Thu Feb 2 16:47:53 2017 UTC (7 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.25: +9 -5 lines
Diff to previous 1.25 (colored)

Remove global counters from struct ieee80211com which track the number of
associated nodes with particular properties: 11b-only ("non-ERP") nodes,
nodes requiring long slot time, nodes using WPA, nodes not supporting 11n,
nodes currently dozing in powersave state, and nodes with a pending group
key update confirmation.

These counters weren't properly maintained.
There are bugs in the stack where these counters and actual node properties
got out of sync. This is exposed by panics which are supposed to help us
catch such bugs. But these panics don't provide real clues.

Instead of maintaining global counters forcing us to hunt refcounting bugs,
count nodes with the property in question on demand, by iterating over all
nodes and checking their state.
This is cheap since we'll never have more than 100 nodes cached, and none of
the cases where we need such information is in a performance critical path.

Prevents panics in hostap mode reported by Lauri Tirkkonen on bugs@ last
year (https://marc.info/?l=openbsd-bugs&m=147513817930489&w=2) and also
encountered by my 11n APs ("panic: bogus non-HT station count 0").

tested by Lauri, tb@, and myself
ok mpi@ tb@

Revision 1.25 / (download) - annotate - [select for diffs], Wed Jul 15 22:16:42 2015 UTC (8 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_5_9_BASE, OPENBSD_5_8_BASE, OPENBSD_5_8
Branch point for: OPENBSD_6_0, OPENBSD_5_9
Changes since 1.24: +2 -3 lines
Diff to previous 1.24 (colored)

m_freem() can handle NULL, do not check for this condition beforehands.
ok stsp mpi

Revision 1.24 / (download) - annotate - [select for diffs], Sat Mar 14 03:38:51 2015 UTC (9 years, 3 months ago) by jsg
Branch: MAIN
Changes since 1.23: +1 -2 lines
Diff to previous 1.23 (colored)

Remove some includes include-what-you-use claims don't
have any direct symbols used.  Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@

Revision 1.23 / (download) - annotate - [select for diffs], Tue Dec 23 03:24:08 2014 UTC (9 years, 5 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.22: +1 -3 lines
Diff to previous 1.22 (colored)

unifdef some more INET. v4 4life.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Nov 18 02:37:31 2014 UTC (9 years, 6 months ago) by tedu
Branch: MAIN
Changes since 1.21: +1 -3 lines
Diff to previous 1.21 (colored)

move arc4random prototype to systm.h. more appropriate for most code
to include that than rdnvar.h. ok deraadt dlg

Revision 1.21 / (download) - annotate - [select for diffs], Sun Sep 14 14:17:26 2014 UTC (9 years, 8 months ago) by jsg
Branch: MAIN
Changes since 1.20: +1 -2 lines
Diff to previous 1.20 (colored)

remove uneeded proc.h includes
ok mpi@ kspillner@

Revision 1.20 / (download) - annotate - [select for diffs], Thu Jul 24 08:23:12 2014 UTC (9 years, 10 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.19: +3 -2 lines
Diff to previous 1.19 (colored)

Fix debug printf, from Nathanael Rensen and chris@.

Revision 1.19 / (download) - annotate - [select for diffs], Tue Jul 22 11:06:10 2014 UTC (9 years, 10 months ago) by mpi
Branch: MAIN
Changes since 1.18: +1 -2 lines
Diff to previous 1.18 (colored)

Fewer <netinet/in_systm.h> !

Revision 1.18 / (download) - annotate - [select for diffs], Wed May 4 16:05:49 2011 UTC (13 years, 1 month ago) by blambert
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

Collapse m_pullup and m_pullup2 into a single function, as they're
essentially identical; the only difference being that m_pullup2 is
capable of handling mbuf clusters, but called m_pullup for shorter
lengths (!).

testing dlg@ ok claudio@

Revision 1.17 / (download) - annotate - [select for diffs], Sat Feb 6 15:16:27 2010 UTC (14 years, 4 months ago) by jcs
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.16: +2 -1 lines
Diff to previous 1.16 (colored)

when receiving the first message of an rsn group key handshake
packet, copy the key out of it properly.

fixes the problem where only broadcast packets like ipv6 router
advertisements were failing decryption and processing, only after a
rekey.

ok damien@

Revision 1.16 / (download) - annotate - [select for diffs], Mon Nov 23 16:54:38 2009 UTC (14 years, 6 months ago) by damien
Branch: MAIN
Changes since 1.15: +4 -1 lines
Diff to previous 1.15 (colored)

how did i manage to forget that file in my last commit?

Revision 1.15 / (download) - annotate - [select for diffs], Mon Jan 26 19:09:41 2009 UTC (15 years, 4 months ago) by damien
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.14: +18 -18 lines
Diff to previous 1.14 (colored)

Add some initial HT bits (not enabled yet) based on 802.11n Draft 7.01:
- 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.

Revision 1.14 / (download) - annotate - [select for diffs], Sat Dec 6 09:02:47 2008 UTC (15 years, 6 months ago) by damien
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

typo, no binary change.

Revision 1.13 / (download) - annotate - [select for diffs], Sat Sep 27 15:16:09 2008 UTC (15 years, 8 months ago) by damien
Branch: MAIN
Changes since 1.12: +40 -31 lines
Diff to previous 1.12 (colored)

Initial implementation of PMKSA caching and pre-authentication.
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.

Revision 1.12 / (download) - annotate - [select for diffs], Wed Aug 27 09:05:04 2008 UTC (15 years, 9 months ago) by damien
Branch: MAIN
Changes since 1.11: +41 -10 lines
Diff to previous 1.11 (colored)

introduce new IEEE80211_STA_ONLY kernel option that can be set to
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.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Aug 13 17:38:02 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.10: +17 -23 lines
Diff to previous 1.10 (colored)

do not increment is_rx_eapol_key twice for each frame.
fix a test on the mbuf length and one on the descriptor version.
remove redundant checking of GTK KDE length.

Revision 1.10 / (download) - annotate - [select for diffs], Tue Aug 12 19:29:07 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.9: +7 -2 lines
Diff to previous 1.9 (colored)

new SHA-256 based AKMPs.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Aug 12 18:22:41 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.8: +110 -33 lines
Diff to previous 1.8 (colored)

process IGTK KDEs in EAPOL-Key frames and install integrity group keys
if MFP was negotiated with the peer (not possible yet).

Revision 1.8 / (download) - annotate - [select for diffs], Tue Aug 12 17:53:13 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.7: +33 -13 lines
Diff to previous 1.7 (colored)

Change the way we process EAPOL-Key frames.
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.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Aug 12 16:14:05 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.6: +58 -29 lines
Diff to previous 1.6 (colored)

get rid of the map_ptk()/map_gtk() functions, just inline them
which makes things easier to track.

Revision 1.6 / (download) - annotate - [select for diffs], Tue Aug 12 16:05:15 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.5: +7 -10 lines
Diff to previous 1.5 (colored)

simplify ieee80211_derive_ptk() prototype.
pass the AKMP so we can support other key derivation functions in the
future.

Revision 1.5 / (download) - annotate - [select for diffs], Sat Aug 2 08:25:59 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.4: +4 -4 lines
Diff to previous 1.4 (colored)

print the correct value in a debug message.

Revision 1.4 / (download) - annotate - [select for diffs], Sat Aug 2 08:20:16 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.3: +8 -1 lines
Diff to previous 1.3 (colored)

Drop frames that are received unencrypted when WEP is on or when
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@

Revision 1.3 / (download) - annotate - [select for diffs], Sun Jul 27 14:21:15 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.2: +26 -34 lines
Diff to previous 1.2 (colored)

s/IEEE80211_DPRINTF/DPRINTF/
automatically prepend __func__ to output.

deobfuscates debug messages a bit.
no binary change unless compiled with IEEE80211_DEBUG.

Revision 1.2 / (download) - annotate - [select for diffs], Mon Jul 21 19:27:26 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.1: +3 -16 lines
Diff to previous 1.1 (colored)

add ieee80211_priv.h file: contains definitions private to net80211.
this must not be included by drivers.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Jul 21 19:05:21 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN

move processing of EAPOL frames away from ieee80211_{input,output}.c

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.