Search Linux Wireless

[PATCH] mac80211: fix autoloading of crypto modules for WEP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If at least one of arc4 and ecb is built as a module, then autoloading
of the algorithm fails, because crypto_alloc_blkcipher tries to
request the module "ecb(arc4)", which does not exist.

This patch was made against 2.6.30, but should apply cleanly on top of
the wireless-2.6 git tree.

Signed-off-by: Andreas Oberritter <obi@xxxxxxxxxxx>

---
 net/mac80211/wep.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c
index ef73105..78e9119 100644
--- a/net/mac80211/wep.c
+++ b/net/mac80211/wep.c
@@ -29,6 +29,17 @@ int ieee80211_wep_init(struct ieee80211_local *local)
 	/* start WEP IV from a random value */
 	get_random_bytes(&local->wep_iv, WEP_IV_LEN);

+	/*
+	 * crypto_alloc_blkcipher() will request the
+	 * module "ecb(arc4)", which does not exist.
+	 */
+#ifdef CONFIG_CRYPTO_ARC4_MODULE
+	request_module("arc4");
+#endif
+#ifdef CONFIG_CRYPTO_ECB_MODULE
+	request_module("ecb");
+#endif
+
 	local->wep_tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0,
 						CRYPTO_ALG_ASYNC);
 	if (IS_ERR(local->wep_tx_tfm))
-- 
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux