opnsense-src/sys/net80211
Adrian Chadd 1751bf9e58 net80211: fail setting a key if the cipher isn't HW/SW supported
The key alloc path was checking if the key was supported in hardware
but treated /all/ keys as supported in software.  As I discovered
during my ath10k port, not all NICs that support ciphers in hardware
support enough of an 802.11 frame transmit/receive path to actually
handle software encryption.

So, do a second check after the hardware encryption check to see
if it's in the software list and hard fail it if it isn't in there.

Otherwise a fun failure mode occurs - the frames are marked as
protected, but since there's no GCMP support setup/enabled, they
just get marked as "protected" but they don't go through the
encryption path, and the receiver dutifully tosses them as invalid.

I've verified this by trying to use GCMP in wpa_supplicant with
a NIC that doesn't announce GCMP HW/SW encryption, and now it actually
fails.

Differential Revision:	https://reviews.freebsd.org/D49393
Reviewed by:	bz
2025-04-07 18:35:22 -07:00
..
_ieee80211.h net80211: fix spelling of Michael (MMIC) 2025-03-04 22:46:05 +00:00
ieee80211.c net80211: migrate ieee80211_rate2media() to use ieee80211_node_txrate 2025-02-26 11:31:27 -08:00
ieee80211.h net80211: rename \4 in IEEE80211_VHTCAP_BITS for clarity 2025-02-15 15:49:27 +00:00
ieee80211_acl.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
ieee80211_action.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
ieee80211_action.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_adhoc.c net80211: remove direct use of ni->ni_txrate, add indirection methods 2025-02-26 11:29:09 -08:00
ieee80211_adhoc.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_ageq.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
ieee80211_ageq.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_alq.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
ieee80211_alq.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_amrr.c net80211: add VHT MCS in AMRR rate control 2025-02-26 11:31:24 -08:00
ieee80211_amrr.h net80211: add VHT MCS in AMRR rate control 2025-02-26 11:31:24 -08:00
ieee80211_crypto.c net80211: fail setting a key if the cipher isn't HW/SW supported 2025-04-07 18:35:22 -07:00
ieee80211_crypto.h net80211: refactor out the AAD init code shared between GCMP and CCMP 2025-04-07 18:35:21 -07:00
ieee80211_crypto_ccmp.c net80211: refactor out the AAD init code shared between GCMP and CCMP 2025-04-07 18:35:21 -07:00
ieee80211_crypto_gcm.c net80211: add initial AES-GCMP crypto support 2025-03-12 17:02:27 -07:00
ieee80211_crypto_gcm.h net80211: add initial AES-GCMP crypto support 2025-03-12 17:02:27 -07:00
ieee80211_crypto_gcmp.c net80211: refactor out the AAD init code shared between GCMP and CCMP 2025-04-07 18:35:21 -07:00
ieee80211_crypto_none.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
ieee80211_crypto_tkip.c net80211: LinuxKPI 802.11: clean up MIC vs. MMIC rx flags 2025-03-04 15:56:49 +00:00
ieee80211_crypto_wep.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
ieee80211_ddb.c net80211: add AES-GCM in ddb output 2025-03-01 17:35:23 -08:00
ieee80211_dfs.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
ieee80211_dfs.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_freebsd.c net80211: cleanup keyidx argument of ieee80211_notify_michael_failure() 2025-03-18 09:21:47 +00:00
ieee80211_freebsd.h net80211: add IEEE80211_IS_LOCKED() 2025-01-15 23:36:00 +00:00
ieee80211_hostap.c net80211: add AES-GCM to the hostap logic 2025-03-12 17:02:43 -07:00
ieee80211_hostap.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_ht.c net80211: migrate ieee80211_rate2media() to use ieee80211_node_txrate 2025-02-26 11:31:27 -08:00
ieee80211_ht.h net80211: HT: add missing bit descriptions for IEEE80211_AGGR_BITS 2024-12-08 20:59:15 +00:00
ieee80211_hwmp.c net80211: Fix a typo in a source code comment 2024-01-22 21:54:36 +01:00
ieee80211_input.c net80211: adjust more VHT structures/fields 2023-12-22 00:20:19 +00:00
ieee80211_input.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_ioctl.c net80211: update get_sta_info() to only populate isi_txrate for legacy rates 2025-02-26 11:31:27 -08:00
ieee80211_ioctl.h net80211: fail setting a key if the cipher isn't HW/SW supported 2025-04-07 18:35:22 -07:00
ieee80211_mesh.c net80211: remove direct use of ni->ni_txrate, add indirection methods 2025-02-26 11:29:09 -08:00
ieee80211_mesh.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
ieee80211_monitor.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
ieee80211_monitor.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_node.c net80211: Fix IEEE80211_KEY_UNDEFINED() in ieee80211_node_delucastkey() 2025-03-05 21:18:15 +00:00
ieee80211_node.h net80211: add static initialisers for the ieee80211_node_txrate options 2025-02-26 11:31:26 -08:00
ieee80211_output.c net80211: document the 802.11 specification for ieee80211_getcapinfo() 2025-03-28 12:00:04 -07:00
ieee80211_phy.c net80211: add ieee80211_phy_vht_get_mcs_kbit() 2025-02-26 11:31:25 -08:00
ieee80211_phy.h net80211: add ieee80211_phy_vht_get_mcs_kbit() 2025-02-26 11:31:25 -08:00
ieee80211_power.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
ieee80211_power.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_proto.c net80211: deal with lost state transitions 2024-02-14 19:47:21 +00:00
ieee80211_proto.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_radiotap.c net80211: Correct a comment 2024-06-20 12:27:43 +08:00
ieee80211_radiotap.h net8011: radiotap: add more EHT constants 2024-04-14 23:09:09 +00:00
ieee80211_ratectl.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
ieee80211_ratectl.h net80211: change ieee80211_ratectl_rate() to not return a rix 2025-02-26 11:29:36 -08:00
ieee80211_ratectl_none.c net80211: remove direct use of ni->ni_txrate, add indirection methods 2025-02-26 11:29:09 -08:00
ieee80211_regdomain.c net80211: migrate ic_vhtcaps, ic_vht_mcsinfo, ic_flags_vht 2023-11-03 21:08:04 +00:00
ieee80211_regdomain.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_rssadapt.c net80211: remove direct use of ni->ni_txrate, add indirection methods 2025-02-26 11:29:09 -08:00
ieee80211_rssadapt.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
ieee80211_scan.c net80211: scan/internal: change boolean argument from int to bool 2024-07-26 11:07:39 +00:00
ieee80211_scan.h net80211: scan/internal: change boolean argument from int to bool 2024-07-26 11:07:39 +00:00
ieee80211_scan_sta.c net80211: remove direct use of ni->ni_txrate, add indirection methods 2025-02-26 11:29:09 -08:00
ieee80211_scan_sw.c net80211: scan/internal: change boolean argument from int to bool 2024-07-26 11:07:39 +00:00
ieee80211_scan_sw.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_sta.c net80211: Implement ieee80211_setup_vht_rates() 2025-02-26 11:30:23 -08:00
ieee80211_sta.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_superg.c net80211: remove direct use of ni->ni_txrate, add indirection methods 2025-02-26 11:29:09 -08:00
ieee80211_superg.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_tdma.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
ieee80211_tdma.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_var.h net80211: migrate ieee80211_rate2media() to use ieee80211_node_txrate 2025-02-26 11:31:27 -08:00
ieee80211_vht.c net80211: add the specific 802.11-2020 references to VHT IEs 2025-03-12 17:02:50 -07:00
ieee80211_vht.h net80211: add ieee80211_vht_node_check_tx_valid_mcs() 2025-02-26 11:31:02 -08:00
ieee80211_wds.c net80211: clean up / add more macros to check the frame types 2024-11-10 17:11:58 -08:00
ieee80211_wds.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_wps.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee80211_xauth.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00