All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: fix autoloading of crypto modules for WEP
@ 2009-07-22 20:05 Andreas Oberritter
  2009-07-22 20:20 ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Oberritter @ 2009-07-22 20:05 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless

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@linuxtv.org>

---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-07-23 12:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-22 20:05 [PATCH] mac80211: fix autoloading of crypto modules for WEP Andreas Oberritter
2009-07-22 20:20 ` Johannes Berg
2009-07-23  0:40   ` Herbert Xu
2009-07-23 11:39     ` Andreas Oberritter
2009-07-23 11:49       ` Johannes Berg
2009-07-23 12:19       ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.