Commit de30da13 authored by Phillip Potter's avatar Phillip Potter Committed by Greg Kroah-Hartman

staging: r8188eu: remove RT_TRACE calls from core/rtw_security.c

Remove RT_TRACE macro calls from core/rtw_security.c, so that ultimately the
macro definition itself can eventually be removed.
Signed-off-by: default avatarPhillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210806004034.82233-7-phil@philpotter.co.ukSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fea8d09f
...@@ -139,10 +139,6 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe) ...@@ -139,10 +139,6 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe)
void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe) void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe)
{ {
/* exclude ICV */ /* exclude ICV */
union {
__le32 f0;
u8 f1[4];
} crc;
struct arc4context mycontext; struct arc4context mycontext;
int length; int length;
u32 keylength; u32 keylength;
...@@ -167,18 +163,6 @@ void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe) ...@@ -167,18 +163,6 @@ void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe)
/* decrypt payload include icv */ /* decrypt payload include icv */
arcfour_init(&mycontext, wepkey, 3+keylength); arcfour_init(&mycontext, wepkey, 3+keylength);
arcfour_encrypt(&mycontext, payload, payload, length); arcfour_encrypt(&mycontext, payload, payload, length);
/* calculate icv and compare the icv */
crc.f0 = cpu_to_le32(~crc32_le(~0, payload, length));
if (crc.f1[3] != payload[length-1] ||
crc.f1[2] != payload[length-2] ||
crc.f1[1] != payload[length-3] ||
crc.f1[0] != payload[length-4]) {
RT_TRACE(_module_rtl871x_security_c_, _drv_err_,
("rtw_wep_decrypt:icv error crc (%4ph)!=payload (%4ph)\n",
&crc, &payload[length-4]));
}
} }
} }
...@@ -554,8 +538,6 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe) ...@@ -554,8 +538,6 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
stainfo = rtw_get_stainfo(&padapter->stapriv, &pattrib->ra[0]); stainfo = rtw_get_stainfo(&padapter->stapriv, &pattrib->ra[0]);
if (stainfo) { if (stainfo) {
RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_tkip_encrypt: stainfo!= NULL!!!\n"));
if (IS_MCAST(pattrib->ra)) if (IS_MCAST(pattrib->ra))
prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey;
else else
...@@ -574,9 +556,6 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe) ...@@ -574,9 +556,6 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
if ((curfragnum+1) == pattrib->nr_frags) { /* 4 the last fragment */ if ((curfragnum+1) == pattrib->nr_frags) { /* 4 the last fragment */
length = pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len; length = pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len;
RT_TRACE(_module_rtl871x_security_c_, _drv_info_,
("pattrib->iv_len=%x, pattrib->icv_len=%x\n",
pattrib->iv_len, pattrib->icv_len));
crc.f0 = cpu_to_le32(~crc32_le(~0, payload, length)); crc.f0 = cpu_to_le32(~crc32_le(~0, payload, length));
arcfour_init(&mycontext, rc4key, 16); arcfour_init(&mycontext, rc4key, 16);
...@@ -595,7 +574,6 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe) ...@@ -595,7 +574,6 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
} }
} }
} else { } else {
RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_tkip_encrypt: stainfo==NULL!!!\n"));
res = _FAIL; res = _FAIL;
} }
} }
...@@ -638,7 +616,6 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe) ...@@ -638,7 +616,6 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
} }
prwskey = psecuritypriv->dot118021XGrpKey[prxattrib->key_index].skey; prwskey = psecuritypriv->dot118021XGrpKey[prxattrib->key_index].skey;
} else { } else {
RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_tkip_decrypt: stainfo!= NULL!!!\n"));
prwskey = &stainfo->dot118021x_UncstKey.skey[0]; prwskey = &stainfo->dot118021x_UncstKey.skey[0];
} }
...@@ -664,14 +641,9 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe) ...@@ -664,14 +641,9 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
if (crc.f1[3] != payload[length-1] || if (crc.f1[3] != payload[length-1] ||
crc.f1[2] != payload[length-2] || crc.f1[2] != payload[length-2] ||
crc.f1[1] != payload[length-3] || crc.f1[1] != payload[length-3] ||
crc.f1[0] != payload[length-4]) { crc.f1[0] != payload[length-4])
RT_TRACE(_module_rtl871x_security_c_, _drv_err_,
("rtw_wep_decrypt:icv error crc (%4ph)!=payload (%4ph)\n",
&crc, &payload[length-4]));
res = _FAIL; res = _FAIL;
}
} else { } else {
RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_tkip_decrypt: stainfo==NULL!!!\n"));
res = _FAIL; res = _FAIL;
} }
} }
...@@ -1216,8 +1188,6 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe) ...@@ -1216,8 +1188,6 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe)
stainfo = rtw_get_stainfo(&padapter->stapriv, &pattrib->ra[0]); stainfo = rtw_get_stainfo(&padapter->stapriv, &pattrib->ra[0]);
if (stainfo) { if (stainfo) {
RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_aes_encrypt: stainfo!= NULL!!!\n"));
if (IS_MCAST(pattrib->ra)) if (IS_MCAST(pattrib->ra))
prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey;
else else
...@@ -1236,7 +1206,6 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe) ...@@ -1236,7 +1206,6 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe)
} }
} }
} else { } else {
RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_aes_encrypt: stainfo==NULL!!!\n"));
res = _FAIL; res = _FAIL;
} }
} }
...@@ -1428,9 +1397,6 @@ static int aes_decipher(u8 *key, uint hdrlen, ...@@ -1428,9 +1397,6 @@ static int aes_decipher(u8 *key, uint hdrlen,
/* compare the mic */ /* compare the mic */
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i]) { if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i]) {
RT_TRACE(_module_rtl871x_security_c_, _drv_err_,
("aes_decipher:mic check error mic[%d]: pframe(%x)!=message(%x)\n",
i, pframe[hdrlen+8+plen-8+i], message[hdrlen+8+plen-8+i]));
DBG_88E("aes_decipher:mic check error mic[%d]: pframe(%x)!=message(%x)\n", DBG_88E("aes_decipher:mic check error mic[%d]: pframe(%x)!=message(%x)\n",
i, pframe[hdrlen+8+plen-8+i], message[hdrlen+8+plen-8+i]); i, pframe[hdrlen+8+plen-8+i], message[hdrlen+8+plen-8+i]);
res = _FAIL; res = _FAIL;
...@@ -1455,8 +1421,6 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe) ...@@ -1455,8 +1421,6 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
if (prxattrib->encrypt == _AES_) { if (prxattrib->encrypt == _AES_) {
stainfo = rtw_get_stainfo(&padapter->stapriv, &prxattrib->ta[0]); stainfo = rtw_get_stainfo(&padapter->stapriv, &prxattrib->ta[0]);
if (stainfo) { if (stainfo) {
RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_aes_decrypt: stainfo!= NULL!!!\n"));
if (IS_MCAST(prxattrib->ra)) { if (IS_MCAST(prxattrib->ra)) {
/* in concurrent we should use sw descrypt in group key, so we remove this message */ /* in concurrent we should use sw descrypt in group key, so we remove this message */
if (!psecuritypriv->binstallGrpkey) { if (!psecuritypriv->binstallGrpkey) {
...@@ -1477,7 +1441,6 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe) ...@@ -1477,7 +1441,6 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
length = ((struct recv_frame *)precvframe)->len-prxattrib->hdrlen-prxattrib->iv_len; length = ((struct recv_frame *)precvframe)->len-prxattrib->hdrlen-prxattrib->iv_len;
res = aes_decipher(prwskey, prxattrib->hdrlen, pframe, length); res = aes_decipher(prwskey, prxattrib->hdrlen, pframe, length);
} else { } else {
RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("rtw_aes_encrypt: stainfo==NULL!!!\n"));
res = _FAIL; res = _FAIL;
} }
} }
...@@ -1689,10 +1652,5 @@ void rtw_use_tkipkey_handler(void *FunctionContext) ...@@ -1689,10 +1652,5 @@ void rtw_use_tkipkey_handler(void *FunctionContext)
{ {
struct adapter *padapter = (struct adapter *)FunctionContext; struct adapter *padapter = (struct adapter *)FunctionContext;
RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("^^^rtw_use_tkipkey_handler ^^^\n"));
padapter->securitypriv.busetkipkey = true; padapter->securitypriv.busetkipkey = true;
RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("^^^rtw_use_tkipkey_handler padapter->securitypriv.busetkipkey=%d^^^\n", padapter->securitypriv.busetkipkey));
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment