Skip to contentSkip to conversation

staging:r8188eu: Use lib80211 to decrypt WEP-frames

PATCH New Ivan Safonov 1 participant 1 message Feb 18, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging:r8188eu: Use lib80211 to decrypt WEP-frames

Use native lib80211 WEP decrypt instead of custom implementation.

---
 drivers/staging/rtl8188eu/Kconfig                |  2 +
 drivers/staging/rtl8188eu/core/rtw_recv.c        |  2 +-
 drivers/staging/rtl8188eu/core/rtw_security.c    | 80 +++++++++++++-----------
 drivers/staging/rtl8188eu/include/rtw_security.h |  2 +-
 4 files changed, 49 insertions(+), 37 deletions(-)
drivers/staging/rtl8188eu/Kconfig +2 -0
index cb836c59d564..d787a091d3c1 100644
@@ -4,6 +4,8 @@ config R8188EU
 	depends on m
 	select WIRELESS_EXT
 	select WEXT_PRIV
+	select LIB80211
+	select LIB80211_CRYPT_WEP
 	---help---
 	This option adds the Realtek RTL8188EU USB device such as TP-Link TL-WN725N.
 	If built as a module, it will be called r8188eu.
drivers/staging/rtl8188eu/core/rtw_recv.c +1 -1
index 6506a1587df0..fe31ebbf36fb 100644
@@ -404,7 +404,7 @@ static struct recv_frame *decryptor(struct adapter *padapter,
 		switch (prxattrib->encrypt) {
 		case _WEP40_:
 		case _WEP104_:
-			rtw_wep_decrypt(padapter, (u8 *)precv_frame);
+			res = rtw_wep_decrypt(padapter, (u8 *)precv_frame);
 			break;
 		case _TKIP_:
 			res = rtw_tkip_decrypt(padapter, (u8 *)precv_frame);
drivers/staging/rtl8188eu/core/rtw_security.c +45 -35

99 lines not on this page · raw message

drivers/staging/rtl8188eu/include/rtw_security.h +1 -1
index a0c6cf706218..b1883ca852af 100644
@@ -308,6 +308,6 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe);
 void rtw_wep_encrypt(struct adapter *padapter, u8  *pxmitframe);
 u32 rtw_aes_decrypt(struct adapter *padapter, u8  *precvframe);
 u32 rtw_tkip_decrypt(struct adapter *padapter, u8  *precvframe);
-void rtw_wep_decrypt(struct adapter *padapter, u8  *precvframe);
+int rtw_wep_decrypt(struct adapter *padapter, u8  *precvframe);
 
 #endif	/* __RTL871X_SECURITY_H_ */
Signature · 6 lines
2.16.1

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel