mac80211: Update to backports-5.10.42
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / subsys / 100-remove-cryptoapi-dependencies.patch
index 5fe76161432ae5a0be83999574c75615e1f632b6..ca02dfb06f9f0ab619833fd8ed64d2d9c5f73727 100644 (file)
@@ -8,7 +8,7 @@
        wpa.o \
        scan.o offchannel.o \
        ht.o agg-tx.o agg-rx.o \
-@@ -18,8 +17,8 @@ mac80211-y := \
+@@ -19,8 +18,8 @@ mac80211-y := \
        rate.o \
        michael.o \
        tkip.o \
@@ -20,7 +20,7 @@
        ethtool.o \
 --- a/net/mac80211/aead_api.c
 +++ /dev/null
-@@ -1,112 +0,0 @@
+@@ -1,113 +0,0 @@
 -// SPDX-License-Identifier: GPL-2.0-only
 -/*
 - * Copyright 2003-2004, Instant802 Networks, Inc.
@@ -46,6 +46,7 @@
 -      struct aead_request *aead_req;
 -      int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm);
 -      u8 *__aad;
+-      int ret;
 -
 -      aead_req = kzalloc(reqsize + aad_len, GFP_ATOMIC);
 -      if (!aead_req)
 -      aead_request_set_crypt(aead_req, sg, sg, data_len, b_0);
 -      aead_request_set_ad(aead_req, sg[0].length);
 -
--      crypto_aead_encrypt(aead_req);
--      kzfree(aead_req);
+-      ret = crypto_aead_encrypt(aead_req);
+-      kfree_sensitive(aead_req);
 -
--      return 0;
+-      return ret;
 -}
 -
 -int aead_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, size_t aad_len,
 -      aead_request_set_ad(aead_req, sg[0].length);
 -
 -      err = crypto_aead_decrypt(aead_req);
--      kzfree(aead_req);
+-      kfree_sensitive(aead_req);
 -
 -      return err;
 -}
  #endif /* AES_GCM_H */
 --- a/net/mac80211/wpa.c
 +++ b/net/mac80211/wpa.c
-@@ -311,7 +311,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
+@@ -312,7 +312,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
  }
  
  
  {
        __le16 mask_fc;
        int a4_included, mgmt;
-@@ -341,14 +342,8 @@ static void ccmp_special_blocks(struct s
+@@ -342,14 +343,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)
-@@ -356,6 +351,8 @@ static void ccmp_special_blocks(struct s
+@@ -357,6 +352,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] */
-@@ -412,7 +409,7 @@ static int ccmp_encrypt_skb(struct ieee8
+@@ -413,7 +410,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 &&
-@@ -467,9 +464,11 @@ static int ccmp_encrypt_skb(struct ieee8
+@@ -468,9 +465,11 @@ static int ccmp_encrypt_skb(struct ieee8
                return 0;
  
        pos += IEEE80211_CCMP_HDR_LEN;
  }
  
  
-@@ -542,13 +541,13 @@ ieee80211_crypto_ccmp_decrypt(struct iee
+@@ -543,13 +542,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;
                }
  
-@@ -643,7 +642,7 @@ static int gcmp_encrypt_skb(struct ieee8
+@@ -646,7 +645,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 &&
-@@ -700,8 +699,10 @@ static int gcmp_encrypt_skb(struct ieee8
+@@ -703,8 +702,10 @@ static int gcmp_encrypt_skb(struct ieee8
  
        pos += IEEE80211_GCMP_HDR_LEN;
        gcmp_special_blocks(skb, pn, j_0, aad);
  }
  
  ieee80211_tx_result
-@@ -1128,9 +1129,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct
+@@ -1133,9 +1134,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;
-@@ -1176,7 +1177,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct
+@@ -1181,7 +1182,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;
 -      depends on CRYPTO_GCM
        depends on CRYPTO_CMAC
        depends on CRC32
-       ---help---
+       help
 --- a/net/mac80211/aes_gmac.h
 +++ b/net/mac80211/aes_gmac.h
 @@ -12,10 +12,22 @@
  #endif /* AES_GMAC_H */
 --- a/net/mac80211/key.h
 +++ b/net/mac80211/key.h
-@@ -88,7 +88,7 @@ struct ieee80211_key {
+@@ -89,7 +89,7 @@ struct ieee80211_key {
                         * Management frames.
                         */
                        u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN];