| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright 2002-2004, Instant802 Networks, Inc. |
|---|
| 3 | 4 | * Copyright 2008, Jouni Malinen <j@w1.fi> |
|---|
| 4 | 5 | * Copyright (C) 2016-2017 Intel Deutschland GmbH |
|---|
| 5 | 6 | * Copyright (C) 2020-2021 Intel Corporation |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 9 | | - * published by the Free Software Foundation. |
|---|
| 10 | 7 | */ |
|---|
| 11 | 8 | |
|---|
| 12 | 9 | #include <linux/netdevice.h> |
|---|
| .. | .. |
|---|
| 243 | 240 | /* Add room for ICV */ |
|---|
| 244 | 241 | skb_put(skb, IEEE80211_TKIP_ICV_LEN); |
|---|
| 245 | 242 | |
|---|
| 246 | | - return ieee80211_tkip_encrypt_data(tx->local->wep_tx_tfm, |
|---|
| 243 | + return ieee80211_tkip_encrypt_data(&tx->local->wep_tx_ctx, |
|---|
| 247 | 244 | key, skb, pos, len); |
|---|
| 248 | 245 | } |
|---|
| 249 | 246 | |
|---|
| .. | .. |
|---|
| 294 | 291 | if (status->flag & RX_FLAG_DECRYPTED) |
|---|
| 295 | 292 | hwaccel = 1; |
|---|
| 296 | 293 | |
|---|
| 297 | | - res = ieee80211_tkip_decrypt_data(rx->local->wep_rx_tfm, |
|---|
| 294 | + res = ieee80211_tkip_decrypt_data(&rx->local->wep_rx_ctx, |
|---|
| 298 | 295 | key, skb->data + hdrlen, |
|---|
| 299 | 296 | skb->len - hdrlen, rx->sta->sta.addr, |
|---|
| 300 | 297 | hdr->addr1, hwaccel, rx->security_idx, |
|---|
| .. | .. |
|---|
| 960 | 957 | |
|---|
| 961 | 958 | info = IEEE80211_SKB_CB(skb); |
|---|
| 962 | 959 | |
|---|
| 963 | | - if (info->control.hw_key) |
|---|
| 960 | + if (info->control.hw_key && |
|---|
| 961 | + !(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIE)) |
|---|
| 964 | 962 | return TX_CONTINUE; |
|---|
| 965 | 963 | |
|---|
| 966 | 964 | if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie))) |
|---|
| .. | .. |
|---|
| 976 | 974 | |
|---|
| 977 | 975 | bip_ipn_set64(mmie->sequence_number, pn64); |
|---|
| 978 | 976 | |
|---|
| 977 | + if (info->control.hw_key) |
|---|
| 978 | + return TX_CONTINUE; |
|---|
| 979 | + |
|---|
| 979 | 980 | bip_aad(skb, aad); |
|---|
| 980 | 981 | |
|---|
| 981 | 982 | /* |
|---|