git: 7cda20918644 - stable/13 - LinuxKPI: 802.11: return proper value for IEEE80211_CRYPTO_AES_CCM

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Wed, 12 Jun 2024 19:16:53 UTC
The branch stable/13 has been updated by bz:

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

commit 7cda20918644f283590a5bb348066bdc2bef18b8
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-03-04 23:03:58 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-06-12 16:59:35 +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
    Differential Revision: https://reviews.freebsd.org/D44208
    
    (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 876ff3693bd0..e5fcb81dce6a 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -546,7 +546,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: