git: e74405a4d648 - stable/14 - LinuxKPI: 802.11: return proper value for IEEE80211_CRYPTO_AES_CCM

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Mon, 01 Apr 2024 23:47:32 UTC
The branch stable/14 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=e74405a4d6488194a8e6d83a6637a181864f221c

commit e74405a4d6488194a8e6d83a6637a181864f221c
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-03-04 23:03:58 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-04-01 23:46:10 +0000

    LinuxKPI: 802.11: return proper value for IEEE80211_CRYPTO_AES_CCM
    
    In case of LKPI_80211_HW_CRYPTO we convert from LinuxKPI cipher_suites
    to net80211 ic_cryptocaps fields. For WLAN_CIPHER_SUITE_CCMP we
    accidentally returned the bit number instead of the shifted value
    which leads to ieee80211_crypto_newkey() setting IEEE80211_KEY_SWCRYPT,
    which in turned lead to us trying to decode the frame again despite
    HW had already done it.  This was found out of a discussion in D43634.
    
    Reviewed by:    cc, adrian
    
    (cherry picked from commit 906521f8176b13533556d742db4ab28e847b85c0)
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 57b3609b2290..d5a97009200f 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -547,7 +547,7 @@ lkpi_l80211_to_net80211_cyphers(uint32_t wlan_cipher_suite)
 	case WLAN_CIPHER_SUITE_TKIP:
 		return (IEEE80211_CRYPTO_TKIP);
 	case WLAN_CIPHER_SUITE_CCMP:
-		return (IEEE80211_CIPHER_AES_CCM);
+		return (IEEE80211_CRYPTO_AES_CCM);
 	case WLAN_CIPHER_SUITE_WEP104:
 		return (IEEE80211_CRYPTO_WEP);
 	case WLAN_CIPHER_SUITE_AES_CMAC: