diff options
Diffstat (limited to 'net/mac80211/wpa.c')
-rw-r--r-- | net/mac80211/wpa.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index 4a2a9aa638b3..b6cd66e0ee58 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c @@ -89,7 +89,7 @@ ieee80211_tx_h_michael_mic_add(struct ieee80211_txrx_data *tx) if (ieee80211_get_hdr_info(skb, &sa, &da, &qos_tid, &data, &data_len)) return TXRX_DROP; - if (!(tx->key->conf.flags & IEEE80211_KEY_FORCE_SW_ENCRYPT) && + if ((tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) && !(tx->flags & IEEE80211_TXRXD_FRAGMENTED) && !(tx->local->hw.flags & IEEE80211_HW_TKIP_INCLUDE_MMIC) && !wpa_test) { @@ -146,7 +146,7 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_txrx_data *rx) return TXRX_CONTINUE; if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) && - !(rx->key->conf.flags & IEEE80211_KEY_FORCE_SW_ENCRYPT)) { + (rx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) { if (rx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV) { if (skb->len < MICHAEL_MIC_LEN) return TXRX_DROP; @@ -205,10 +205,10 @@ static int tkip_encrypt_skb(struct ieee80211_txrx_data *tx, hdrlen = ieee80211_get_hdrlen(fc); len = skb->len - hdrlen; - if (tx->key->conf.flags & IEEE80211_KEY_FORCE_SW_ENCRYPT) - tailneed = TKIP_ICV_LEN; - else + if (tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) tailneed = 0; + else + tailneed = TKIP_ICV_LEN; if ((skb_headroom(skb) < TKIP_IV_LEN || skb_tailroom(skb) < tailneed)) { @@ -227,7 +227,7 @@ static int tkip_encrypt_skb(struct ieee80211_txrx_data *tx, if (key->u.tkip.iv16 == 0) key->u.tkip.iv32++; - if (!(tx->key->conf.flags & IEEE80211_KEY_FORCE_SW_ENCRYPT)) { + if (tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) { u32 flags = tx->local->hw.flags; hdr = (struct ieee80211_hdr *)skb->data; @@ -286,7 +286,7 @@ ieee80211_tx_h_tkip_encrypt(struct ieee80211_txrx_data *tx) tx->u.tx.control->iv_len = TKIP_IV_LEN; ieee80211_tx_set_iswep(tx); - if (!(tx->key->conf.flags & IEEE80211_KEY_FORCE_SW_ENCRYPT) && + if ((tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) && !(tx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV) && !wpa_test) { /* hwaccel - with no need for preallocated room for IV/ICV */ @@ -331,7 +331,7 @@ ieee80211_rx_h_tkip_decrypt(struct ieee80211_txrx_data *rx) return TXRX_DROP; if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) && - !(key->conf.flags & IEEE80211_KEY_FORCE_SW_ENCRYPT)) { + (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) { if (!(rx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV)) { /* Hardware takes care of all processing, including * replay protection, so no need to continue here. */ @@ -475,10 +475,10 @@ static int ccmp_encrypt_skb(struct ieee80211_txrx_data *tx, hdrlen = ieee80211_get_hdrlen(fc); len = skb->len - hdrlen; - if (key->conf.flags & IEEE80211_KEY_FORCE_SW_ENCRYPT) - tailneed = CCMP_MIC_LEN; - else + if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) tailneed = 0; + else + tailneed = CCMP_MIC_LEN; if ((skb_headroom(skb) < CCMP_HDR_LEN || skb_tailroom(skb) < tailneed)) { @@ -504,7 +504,7 @@ static int ccmp_encrypt_skb(struct ieee80211_txrx_data *tx, ccmp_pn2hdr(pos, pn, key->conf.keyidx); - if (!(key->conf.flags & IEEE80211_KEY_FORCE_SW_ENCRYPT)) { + if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) { /* hwaccel - with preallocated room for CCMP header */ tx->u.tx.control->key_idx = key->conf.hw_key_idx; return 0; @@ -537,7 +537,7 @@ ieee80211_tx_h_ccmp_encrypt(struct ieee80211_txrx_data *tx) tx->u.tx.control->iv_len = CCMP_HDR_LEN; ieee80211_tx_set_iswep(tx); - if (!(tx->key->conf.flags & IEEE80211_KEY_FORCE_SW_ENCRYPT) && + if ((tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) && !(tx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV)) { /* hwaccel - with no need for preallocated room for CCMP " * header or MIC fields */ @@ -586,7 +586,7 @@ ieee80211_rx_h_ccmp_decrypt(struct ieee80211_txrx_data *rx) return TXRX_DROP; if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) && - !(key->conf.flags & IEEE80211_KEY_FORCE_SW_ENCRYPT) && + (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) && !(rx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV)) return TXRX_CONTINUE; @@ -607,7 +607,7 @@ ieee80211_rx_h_ccmp_decrypt(struct ieee80211_txrx_data *rx) } if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) && - !(key->conf.flags & IEEE80211_KEY_FORCE_SW_ENCRYPT)) { + (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) { /* hwaccel has already decrypted frame and verified MIC */ } else { u8 *scratch, *b_0, *aad; |