| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright 2002-2004, Instant802 Networks, Inc. |
|---|
| 3 | 4 | * Copyright 2005, Devicescape Software, Inc. |
|---|
| 4 | 5 | * Copyright (C) 2016 Intel Deutschland GmbH |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 8 | | - * published by the Free Software Foundation. |
|---|
| 9 | 6 | */ |
|---|
| 10 | 7 | #include <linux/kernel.h> |
|---|
| 11 | 8 | #include <linux/bitops.h> |
|---|
| .. | .. |
|---|
| 222 | 219 | * @payload_len is the length of payload (_not_ including IV/ICV length). |
|---|
| 223 | 220 | * @ta is the transmitter addresses. |
|---|
| 224 | 221 | */ |
|---|
| 225 | | -int ieee80211_tkip_encrypt_data(struct crypto_cipher *tfm, |
|---|
| 222 | +int ieee80211_tkip_encrypt_data(struct arc4_ctx *ctx, |
|---|
| 226 | 223 | struct ieee80211_key *key, |
|---|
| 227 | 224 | struct sk_buff *skb, |
|---|
| 228 | 225 | u8 *payload, size_t payload_len) |
|---|
| .. | .. |
|---|
| 231 | 228 | |
|---|
| 232 | 229 | ieee80211_get_tkip_p2k(&key->conf, skb, rc4key); |
|---|
| 233 | 230 | |
|---|
| 234 | | - return ieee80211_wep_encrypt_data(tfm, rc4key, 16, |
|---|
| 231 | + return ieee80211_wep_encrypt_data(ctx, rc4key, 16, |
|---|
| 235 | 232 | payload, payload_len); |
|---|
| 236 | 233 | } |
|---|
| 237 | 234 | |
|---|
| .. | .. |
|---|
| 239 | 236 | * beginning of the buffer containing IEEE 802.11 header payload, i.e., |
|---|
| 240 | 237 | * including IV, Ext. IV, real data, Michael MIC, ICV. @payload_len is the |
|---|
| 241 | 238 | * length of payload, including IV, Ext. IV, MIC, ICV. */ |
|---|
| 242 | | -int ieee80211_tkip_decrypt_data(struct crypto_cipher *tfm, |
|---|
| 239 | +int ieee80211_tkip_decrypt_data(struct arc4_ctx *ctx, |
|---|
| 243 | 240 | struct ieee80211_key *key, |
|---|
| 244 | 241 | u8 *payload, size_t payload_len, u8 *ta, |
|---|
| 245 | 242 | u8 *ra, int only_iv, int queue, |
|---|
| .. | .. |
|---|
| 309 | 306 | |
|---|
| 310 | 307 | tkip_mixing_phase2(tk, &rx_ctx->ctx, iv16, rc4key); |
|---|
| 311 | 308 | |
|---|
| 312 | | - res = ieee80211_wep_decrypt_data(tfm, rc4key, 16, pos, payload_len - 12); |
|---|
| 309 | + res = ieee80211_wep_decrypt_data(ctx, rc4key, 16, pos, payload_len - 12); |
|---|
| 313 | 310 | done: |
|---|
| 314 | 311 | if (res == TKIP_DECRYPT_OK) { |
|---|
| 315 | 312 | /* |
|---|