mac80211: Update to version 5.6.8-1
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / subsys / 100-remove-cryptoapi-dependencies.patch
index 0fe6ee196c054afaf3376af955ca22603724de1f..5fe76161432ae5a0be83999574c75615e1f632b6 100644 (file)
        ethtool.o \
 --- a/net/mac80211/aead_api.c
 +++ /dev/null
-@@ -1,115 +0,0 @@
+@@ -1,112 +0,0 @@
+-// SPDX-License-Identifier: GPL-2.0-only
 -/*
 - * Copyright 2003-2004, Instant802 Networks, Inc.
 - * Copyright 2005-2006, Devicescape Software, Inc.
 - * Copyright 2014-2015, Qualcomm Atheros, Inc.
 - *
 - * Rewrite: Copyright (C) 2013 Linaro Ltd <ard.biesheuvel@linaro.org>
-- *
-- * This program is free software; you can redistribute it and/or modify
-- * it under the terms of the GNU General Public License version 2 as
-- * published by the Free Software Foundation.
 - */
 -
 -#include <linux/kernel.h>
 -}
 --- a/net/mac80211/aead_api.h
 +++ /dev/null
-@@ -1,27 +0,0 @@
--/*
-- * This program is free software; you can redistribute it and/or modify
-- * it under the terms of the GNU General Public License version 2 as
-- * published by the Free Software Foundation.
-- */
+@@ -1,23 +0,0 @@
+-/* SPDX-License-Identifier: GPL-2.0-only */
 -
 -#ifndef _AEAD_API_H
 -#define _AEAD_API_H
 -#endif /* _AEAD_API_H */
 --- a/net/mac80211/aes_ccm.h
 +++ b/net/mac80211/aes_ccm.h
-@@ -10,39 +10,17 @@
+@@ -7,39 +7,17 @@
  #ifndef AES_CCM_H
  #define AES_CCM_H
  
 +}
 --- a/net/mac80211/aes_gcm.h
 +++ b/net/mac80211/aes_gcm.h
-@@ -9,38 +9,30 @@
+@@ -6,38 +6,30 @@
  #ifndef AES_GCM_H
  #define AES_GCM_H
  
  #endif /* AES_GCM_H */
 --- a/net/mac80211/wpa.c
 +++ b/net/mac80211/wpa.c
-@@ -314,7 +314,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
+@@ -311,7 +311,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
  }
  
  
  {
        __le16 mask_fc;
        int a4_included, mgmt;
-@@ -344,14 +345,8 @@ static void ccmp_special_blocks(struct s
+@@ -341,14 +342,8 @@ static void ccmp_special_blocks(struct s
        else
                qos_tid = 0;
  
  
        /* Nonce: Nonce Flags | A2 | PN
         * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7)
-@@ -359,6 +354,8 @@ static void ccmp_special_blocks(struct s
+@@ -356,6 +351,8 @@ static void ccmp_special_blocks(struct s
        b_0[1] = qos_tid | (mgmt << 4);
        memcpy(&b_0[2], hdr->addr2, ETH_ALEN);
        memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN);
  
        /* AAD (extra authenticate-only data) / masked 802.11 header
         * FC | A1 | A2 | A3 | SC | [A4] | [QC] */
-@@ -415,7 +412,7 @@ static int ccmp_encrypt_skb(struct ieee8
+@@ -412,7 +409,7 @@ static int ccmp_encrypt_skb(struct ieee8
        u8 *pos;
        u8 pn[6];
        u64 pn64;
        u8 b_0[AES_BLOCK_SIZE];
  
        if (info->control.hw_key &&
-@@ -470,9 +467,11 @@ static int ccmp_encrypt_skb(struct ieee8
+@@ -467,9 +464,11 @@ static int ccmp_encrypt_skb(struct ieee8
                return 0;
  
        pos += IEEE80211_CCMP_HDR_LEN;
  }
  
  
-@@ -545,13 +544,13 @@ ieee80211_crypto_ccmp_decrypt(struct iee
+@@ -542,13 +541,13 @@ ieee80211_crypto_ccmp_decrypt(struct iee
                        u8 aad[2 * AES_BLOCK_SIZE];
                        u8 b_0[AES_BLOCK_SIZE];
                        /* hardware didn't decrypt/verify MIC */
                                return RX_DROP_UNUSABLE;
                }
  
-@@ -646,7 +645,7 @@ static int gcmp_encrypt_skb(struct ieee8
+@@ -643,7 +642,7 @@ static int gcmp_encrypt_skb(struct ieee8
        u8 *pos;
        u8 pn[6];
        u64 pn64;
        u8 j_0[AES_BLOCK_SIZE];
  
        if (info->control.hw_key &&
-@@ -703,8 +702,10 @@ static int gcmp_encrypt_skb(struct ieee8
+@@ -700,8 +699,10 @@ static int gcmp_encrypt_skb(struct ieee8
  
        pos += IEEE80211_GCMP_HDR_LEN;
        gcmp_special_blocks(skb, pn, j_0, aad);
  }
  
  ieee80211_tx_result
-@@ -1127,9 +1128,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct
+@@ -1128,9 +1129,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct
        struct ieee80211_key *key = tx->key;
        struct ieee80211_mmie_16 *mmie;
        struct ieee80211_hdr *hdr;
  
        if (WARN_ON(skb_queue_len(&tx->skbs) != 1))
                return TX_DROP;
-@@ -1175,7 +1176,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct
+@@ -1176,7 +1177,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct
        struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
        struct ieee80211_key *key = rx->key;
        struct ieee80211_mmie_16 *mmie;
--      u8 aad[GMAC_AAD_LEN], mic[GMAC_MIC_LEN], ipn[6], nonce[GMAC_NONCE_LEN];
-+      u8 aad[20], mic[16], ipn[6], nonce[12];
+-      u8 aad[GMAC_AAD_LEN], *mic, ipn[6], nonce[GMAC_NONCE_LEN];
++      u8 aad[20], *mic, ipn[6], nonce[12];
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
  
        if (!ieee80211_is_mgmt(hdr->frame_control))
 +}
 --- a/net/mac80211/Kconfig
 +++ b/net/mac80211/Kconfig
-@@ -5,8 +5,6 @@ config MAC80211
+@@ -6,8 +6,6 @@ config MAC80211
        depends on CRYPTO
-       depends on CRYPTO_ARC4
+       select BPAUTO_CRYPTO_LIB_ARC4
        depends on CRYPTO_AES
 -      depends on CRYPTO_CCM
 -      depends on CRYPTO_GCM
        ---help---
 --- a/net/mac80211/aes_gmac.h
 +++ b/net/mac80211/aes_gmac.h
-@@ -15,10 +15,22 @@
+@@ -12,10 +12,22 @@
  #define GMAC_MIC_LEN  16
  #define GMAC_NONCE_LEN        12