X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=net%2Fieee80211%2Fieee80211_crypt_wep.c;h=8d182459344e9a94d7f992c97da3fae33e8a2e25;hb=3960208f9ca0cf6bdb31c21c59ac0526303f8b34;hp=1b2efff11d39ff63fab9935e070b62d01897c193;hpb=0cd43f83d381c4246a08cd775834833d6fd64805;p=powerpc.git diff --git a/net/ieee80211/ieee80211_crypt_wep.c b/net/ieee80211/ieee80211_crypt_wep.c index 1b2efff11d..8d18245934 100644 --- a/net/ieee80211/ieee80211_crypt_wep.c +++ b/net/ieee80211/ieee80211_crypt_wep.c @@ -1,7 +1,7 @@ /* * Host AP crypt: host-based WEP encryption implementation for Host AP driver * - * Copyright (c) 2002-2004, Jouni Malinen + * Copyright (c) 2002-2004, Jouni Malinen * * 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 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -96,7 +97,7 @@ static int prism2_wep_build_iv(struct sk_buff *skb, int hdr_len, struct prism2_wep_data *wep = priv; u32 klen, len; u8 *pos; - + if (skb_headroom(skb) < 4 || skb->len < hdr_len) return -1; @@ -145,17 +146,17 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv) /* other checks are in prism2_wep_build_iv */ if (skb_tailroom(skb) < 4) return -1; - + /* add the IV to the frame */ if (prism2_wep_build_iv(skb, hdr_len, NULL, 0, priv)) return -1; - + /* Copy the IV into the first 3 bytes of the key */ - memcpy(key, skb->data + hdr_len, 3); + skb_copy_from_linear_data_offset(skb, hdr_len, key, 3); /* Copy rest of the WEP key (the secret part) */ memcpy(key + 3, wep->key, wep->key_len); - + len = skb->len - hdr_len - 4; pos = skb->data + hdr_len + 4; klen = 3 + wep->key_len;