summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Heim <phreak@gentoo.org>2006-10-13 12:22:10 +0000
committerChristian Heim <phreak@gentoo.org>2006-10-13 12:22:10 +0000
commitb44f2eeb259b5112840c74e905c4b1432495226b (patch)
treecea42644f9cc34080af0ca94270d82af9c747e8c /net-wireless/ieee80211
parentAdust the irssi blockers. (diff)
downloadgentoo-2-b44f2eeb259b5112840c74e905c4b1432495226b.tar.gz
gentoo-2-b44f2eeb259b5112840c74e905c4b1432495226b.tar.bz2
gentoo-2-b44f2eeb259b5112840c74e905c4b1432495226b.zip
Fixing ieee80211-1.1.13 for SMP-systems (see #150752 for reference). Thanks to Simon Koenig for reporting the issue and pointing me to the patch.
(Portage version: 2.1.2_pre2-r9)
Diffstat (limited to 'net-wireless/ieee80211')
-rw-r--r--net-wireless/ieee80211/ChangeLog7
-rw-r--r--net-wireless/ieee80211/files/ieee80211-1.1.13-tkip.patch188
-rw-r--r--net-wireless/ieee80211/ieee80211-1.1.13-r1.ebuild8
3 files changed, 198 insertions, 5 deletions
diff --git a/net-wireless/ieee80211/ChangeLog b/net-wireless/ieee80211/ChangeLog
index 35026a06c5aa..910933fa0fee 100644
--- a/net-wireless/ieee80211/ChangeLog
+++ b/net-wireless/ieee80211/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for net-wireless/ieee80211
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-wireless/ieee80211/ChangeLog,v 1.39 2006/09/13 12:32:02 phreak Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-wireless/ieee80211/ChangeLog,v 1.40 2006/10/13 12:22:10 phreak Exp $
+
+ 13 Oct 2006; Christian Heim <phreak@gentoo.org>
+ +files/ieee80211-1.1.13-tkip.patch, ieee80211-1.1.13-r1.ebuild:
+ Fixing ieee80211-1.1.13 for SMP-systems (see #150752 for reference). Thanks
+ to Simon Koenig for reporting the issue and pointing me to the patch.
*ieee80211-1.2.15 (13 Sep 2006)
diff --git a/net-wireless/ieee80211/files/ieee80211-1.1.13-tkip.patch b/net-wireless/ieee80211/files/ieee80211-1.1.13-tkip.patch
new file mode 100644
index 000000000000..9f21a9e724fa
--- /dev/null
+++ b/net-wireless/ieee80211/files/ieee80211-1.1.13-tkip.patch
@@ -0,0 +1,188 @@
+Index: ieee80211-1.1.13/ieee80211_crypt_tkip.c
+===================================================================
+--- ieee80211-1.1.13.orig/ieee80211_crypt_tkip.c
++++ ieee80211-1.1.13/ieee80211_crypt_tkip.c
+@@ -53,8 +53,10 @@ struct ieee80211_tkip_data {
+
+ int key_idx;
+
+- struct crypto_tfm *tfm_arc4;
+- struct crypto_tfm *tfm_michael;
++ struct crypto_tfm *tx_tfm_arc4;
++ struct crypto_tfm *tx_tfm_michael;
++ struct crypto_tfm *rx_tfm_arc4;
++ struct crypto_tfm *rx_tfm_michael;
+
+ /* scratch buffers for virt_to_page() (crypto API) */
+ u8 rx_hdr[16], tx_hdr[16];
+@@ -86,15 +88,29 @@ static void *ieee80211_tkip_init(int key
+
+ priv->key_idx = key_idx;
+
+- priv->tfm_arc4 = crypto_alloc_tfm("arc4", 0);
+- if (priv->tfm_arc4 == NULL) {
++ priv->tx_tfm_arc4 = crypto_alloc_tfm("arc4", 0);
++ if (priv->tx_tfm_arc4 == NULL) {
+ printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate "
+ "crypto API arc4\n");
+ goto fail;
+ }
+
+- priv->tfm_michael = crypto_alloc_tfm("michael_mic", 0);
+- if (priv->tfm_michael == NULL) {
++ priv->tx_tfm_michael = crypto_alloc_tfm("michael_mic", 0);
++ if (priv->tx_tfm_michael == NULL) {
++ printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate "
++ "crypto API michael_mic\n");
++ goto fail;
++ }
++
++ priv->rx_tfm_arc4 = crypto_alloc_tfm("arc4", 0);
++ if (priv->rx_tfm_arc4 == NULL) {
++ printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate "
++ "crypto API arc4\n");
++ goto fail;
++ }
++
++ priv->rx_tfm_michael = crypto_alloc_tfm("michael_mic", 0);
++ if (priv->rx_tfm_michael == NULL) {
+ printk(KERN_DEBUG "ieee80211_crypt_tkip: could not allocate "
+ "crypto API michael_mic\n");
+ goto fail;
+@@ -104,10 +120,14 @@ static void *ieee80211_tkip_init(int key
+
+ fail:
+ if (priv) {
+- if (priv->tfm_michael)
+- crypto_free_tfm(priv->tfm_michael);
+- if (priv->tfm_arc4)
+- crypto_free_tfm(priv->tfm_arc4);
++ if (priv->tx_tfm_michael)
++ crypto_free_tfm(priv->tx_tfm_michael);
++ if (priv->tx_tfm_arc4)
++ crypto_free_tfm(priv->tx_tfm_arc4);
++ if (priv->rx_tfm_michael)
++ crypto_free_tfm(priv->rx_tfm_michael);
++ if (priv->rx_tfm_arc4)
++ crypto_free_tfm(priv->rx_tfm_arc4);
+ kfree(priv);
+ }
+
+@@ -117,10 +137,14 @@ static void *ieee80211_tkip_init(int key
+ static void ieee80211_tkip_deinit(void *priv)
+ {
+ struct ieee80211_tkip_data *_priv = priv;
+- if (_priv && _priv->tfm_michael)
+- crypto_free_tfm(_priv->tfm_michael);
+- if (_priv && _priv->tfm_arc4)
+- crypto_free_tfm(_priv->tfm_arc4);
++ if (_priv && _priv->tx_tfm_michael)
++ crypto_free_tfm(_priv->tx_tfm_michael);
++ if (_priv && _priv->tx_tfm_arc4)
++ crypto_free_tfm(_priv->tx_tfm_arc4);
++ if (_priv && _priv->rx_tfm_michael)
++ crypto_free_tfm(_priv->rx_tfm_michael);
++ if (_priv && _priv->rx_tfm_arc4)
++ crypto_free_tfm(_priv->rx_tfm_arc4);
+ kfree(priv);
+ }
+
+@@ -352,11 +376,11 @@ static int ieee80211_tkip_encrypt(struct
+ icv[2] = crc >> 16;
+ icv[3] = crc >> 24;
+
+- crypto_cipher_setkey(tkey->tfm_arc4, rc4key, 16);
++ crypto_cipher_setkey(tkey->tx_tfm_arc4, rc4key, 16);
+ sg.page = virt_to_page(pos);
+ sg.offset = offset_in_page(pos);
+ sg.length = len + 4;
+- crypto_cipher_encrypt(tkey->tfm_arc4, &sg, &sg, len + 4);
++ crypto_cipher_encrypt(tkey->tx_tfm_arc4, &sg, &sg, len + 4);
+
+ return 0;
+ }
+@@ -447,11 +471,11 @@ static int ieee80211_tkip_decrypt(struct
+
+ plen = skb->len - hdr_len - 12;
+
+- crypto_cipher_setkey(tkey->tfm_arc4, rc4key, 16);
++ crypto_cipher_setkey(tkey->rx_tfm_arc4, rc4key, 16);
+ sg.page = virt_to_page(pos);
+ sg.offset = offset_in_page(pos);
+ sg.length = plen + 4;
+- crypto_cipher_decrypt(tkey->tfm_arc4, &sg, &sg, plen + 4);
++ crypto_cipher_decrypt(tkey->rx_tfm_arc4, &sg, &sg, plen + 4);
+
+ crc = ~crc32_le(~0, pos, plen);
+ icv[0] = crc;
+@@ -485,12 +509,12 @@ static int ieee80211_tkip_decrypt(struct
+ return keyidx;
+ }
+
+-static int michael_mic(struct ieee80211_tkip_data *tkey, u8 * key, u8 * hdr,
++static int michael_mic(struct crypto_tfm *tfm_michael, u8 * key, u8 * hdr,
+ u8 * data, size_t data_len, u8 * mic)
+ {
+ struct scatterlist sg[2];
+
+- if (tkey->tfm_michael == NULL) {
++ if (tfm_michael == NULL) {
+ printk(KERN_WARNING "michael_mic: tfm_michael == NULL\n");
+ return -1;
+ }
+@@ -502,10 +526,10 @@ static int michael_mic(struct ieee80211_
+ sg[1].offset = offset_in_page(data);
+ sg[1].length = data_len;
+
+- crypto_digest_init(tkey->tfm_michael);
+- crypto_digest_setkey(tkey->tfm_michael, key, 8);
+- crypto_digest_update(tkey->tfm_michael, sg, 2);
+- crypto_digest_final(tkey->tfm_michael, mic);
++ crypto_digest_init(tfm_michael);
++ crypto_digest_setkey(tfm_michael, key, 8);
++ crypto_digest_update(tfm_michael, sg, 2);
++ crypto_digest_final(tfm_michael, mic);
+
+ return 0;
+ }
+@@ -563,7 +587,7 @@ static int ieee80211_michael_mic_add(str
+
+ michael_mic_hdr(skb, tkey->tx_hdr);
+ pos = skb_put(skb, 8);
+- if (michael_mic(tkey, &tkey->key[16], tkey->tx_hdr,
++ if (michael_mic(tkey->tx_tfm_michael, &tkey->key[16], tkey->tx_hdr,
+ skb->data + hdr_len, skb->len - 8 - hdr_len, pos))
+ return -1;
+
+@@ -625,7 +649,7 @@ static int ieee80211_michael_mic_verify(
+ return -1;
+
+ michael_mic_hdr(skb, tkey->rx_hdr);
+- if (michael_mic(tkey, &tkey->key[24], tkey->rx_hdr,
++ if (michael_mic(tkey->rx_tfm_michael, &tkey->key[24], tkey->rx_hdr,
+ skb->data + hdr_len, skb->len - 8 - hdr_len, mic))
+ return -1;
+ if (memcmp(mic, skb->data + skb->len - 8, 8) != 0) {
+@@ -655,14 +679,18 @@ static int ieee80211_tkip_set_key(void *
+ {
+ struct ieee80211_tkip_data *tkey = priv;
+ int keyidx;
+- struct crypto_tfm *tfm = tkey->tfm_michael;
+- struct crypto_tfm *tfm2 = tkey->tfm_arc4;
++ struct crypto_tfm *tfm = tkey->tx_tfm_michael;
++ struct crypto_tfm *tfm2 = tkey->tx_tfm_arc4;
++ struct crypto_tfm *tfm3 = tkey->rx_tfm_michael;
++ struct crypto_tfm *tfm4 = tkey->rx_tfm_arc4;
+
+ keyidx = tkey->key_idx;
+ memset(tkey, 0, sizeof(*tkey));
+ tkey->key_idx = keyidx;
+- tkey->tfm_michael = tfm;
+- tkey->tfm_arc4 = tfm2;
++ tkey->tx_tfm_michael = tfm;
++ tkey->tx_tfm_arc4 = tfm2;
++ tkey->rx_tfm_michael = tfm3;
++ tkey->rx_tfm_arc4 = tfm4;
+ if (len == TKIP_KEY_LEN) {
+ memcpy(tkey->key, key, TKIP_KEY_LEN);
+ tkey->key_set = 1;
diff --git a/net-wireless/ieee80211/ieee80211-1.1.13-r1.ebuild b/net-wireless/ieee80211/ieee80211-1.1.13-r1.ebuild
index 4556ad366b50..da4dce9e4fac 100644
--- a/net-wireless/ieee80211/ieee80211-1.1.13-r1.ebuild
+++ b/net-wireless/ieee80211/ieee80211-1.1.13-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-wireless/ieee80211/ieee80211-1.1.13-r1.ebuild,v 1.2 2006/04/22 14:39:39 brix Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-wireless/ieee80211/ieee80211-1.1.13-r1.ebuild,v 1.3 2006/10/13 12:22:10 phreak Exp $
inherit eutils linux-mod
@@ -74,13 +74,13 @@ src_unpack() {
unpack ${A}
- cd ${S}
- epatch ${FILESDIR}/${P}-cflags.patch
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-*.patch
use debug && debug="y"
sed -i \
-e "s:^\(CONFIG_IEEE80211_DEBUG\)=.*:\1=${debug}:" \
- ${S}/Makefile || die
+ "${S}"/Makefile || die
}
src_install() {