wireless: move crypto constants to ieee80211.h
mac80211 and the Intel drivers all define crypto constants, move them to ieee80211.h instead. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
04a161f460
commit
4325f6caad
10 changed files with 96 additions and 108 deletions
|
@ -1622,7 +1622,7 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
|
|||
entry->ccmp = 1;
|
||||
memcpy(entry->last_pn,
|
||||
rx->key->u.ccmp.rx_pn[queue],
|
||||
CCMP_PN_LEN);
|
||||
IEEE80211_CCMP_PN_LEN);
|
||||
}
|
||||
return RX_QUEUED;
|
||||
}
|
||||
|
@ -1641,21 +1641,21 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
|
|||
* (IEEE 802.11i, 8.3.3.4.5) */
|
||||
if (entry->ccmp) {
|
||||
int i;
|
||||
u8 pn[CCMP_PN_LEN], *rpn;
|
||||
u8 pn[IEEE80211_CCMP_PN_LEN], *rpn;
|
||||
int queue;
|
||||
if (!rx->key || rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP)
|
||||
return RX_DROP_UNUSABLE;
|
||||
memcpy(pn, entry->last_pn, CCMP_PN_LEN);
|
||||
for (i = CCMP_PN_LEN - 1; i >= 0; i--) {
|
||||
memcpy(pn, entry->last_pn, IEEE80211_CCMP_PN_LEN);
|
||||
for (i = IEEE80211_CCMP_PN_LEN - 1; i >= 0; i--) {
|
||||
pn[i]++;
|
||||
if (pn[i])
|
||||
break;
|
||||
}
|
||||
queue = rx->security_idx;
|
||||
rpn = rx->key->u.ccmp.rx_pn[queue];
|
||||
if (memcmp(pn, rpn, CCMP_PN_LEN))
|
||||
if (memcmp(pn, rpn, IEEE80211_CCMP_PN_LEN))
|
||||
return RX_DROP_UNUSABLE;
|
||||
memcpy(entry->last_pn, pn, CCMP_PN_LEN);
|
||||
memcpy(entry->last_pn, pn, IEEE80211_CCMP_PN_LEN);
|
||||
}
|
||||
|
||||
skb_pull(rx->skb, ieee80211_hdrlen(fc));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue