Search Linux Wireless

Re: [PATCH v2] cfg80211: fix a couple of bugs with key ioctls

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

 



On Wed, May 13, 2009 at 11:10 AM, Johannes Berg
<johannes@xxxxxxxxxxxxxxxx> wrote:
> There are a few small bugs/oversights in the key handling
> code I wrote:
>  * SIOCSIWENCODE should default to setting key 0 if no
>   default key is set already and no index is given,
>  * key removal should not require key material,
>  * SIOCSIWENCODEEXT should default to changing the default
>   management key if no index is given.
>  * SIOCSIWENCODEEXT needs to use ext->key_len rather than
>   erq->length to verify the key length
>
> Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>

Tested-by: Hin-Tak Leung <htl10@xxxxxxxxxxxxxxxxxxxxx>  ... I think I
truly earned it this time :-). This works, and I also tried the
iwconfig way and that is still working. I was using an earlier
wpa_supplicant 0.6.8-1, but switched to 0.6.8-3 (
http://koji.fedoraproject.org/koji/buildinfo?buildID=101920 )
yesterday seeing as Dan has put some new stuff in.

The other question -, the number was always 53.

Thanks for fixing this.

Hin-Tak

> ---
>  net/wireless/wext-compat.c |   18 +++++++-----------
>  1 file changed, 7 insertions(+), 11 deletions(-)
>
> --- wireless-testing.orig/net/wireless/wext-compat.c    2009-05-12 12:38:41.000000000 +0200
> +++ wireless-testing/net/wireless/wext-compat.c 2009-05-13 12:09:13.000000000 +0200
> @@ -557,7 +557,7 @@ int cfg80211_wext_siwencode(struct net_d
>        if (idx == 0) {
>                idx = wdev->wext.default_key;
>                if (idx < 0)
> -                       return -EINVAL;
> +                       idx = 0;
>        } else if (idx < 1 || idx > 4)
>                return -EINVAL;
>        else
> @@ -580,7 +580,7 @@ int cfg80211_wext_siwencode(struct net_d
>                params.cipher = WLAN_CIPHER_SUITE_WEP40;
>        else if (erq->length == 13)
>                params.cipher = WLAN_CIPHER_SUITE_WEP104;
> -       else
> +       else if (!remove)
>                return -EINVAL;
>
>        return cfg80211_set_encryption(rdev, dev, NULL, remove,
> @@ -614,9 +614,9 @@ int cfg80211_wext_siwencodeext(struct ne
>                cipher = 0;
>                break;
>        case IW_ENCODE_ALG_WEP:
> -               if (erq->length == 5)
> +               if (ext->key_len == 5)
>                        cipher = WLAN_CIPHER_SUITE_WEP40;
> -               else if (erq->length == 13)
> +               else if (ext->key_len == 13)
>                        cipher = WLAN_CIPHER_SUITE_WEP104;
>                else
>                        return -EINVAL;
> @@ -640,13 +640,9 @@ int cfg80211_wext_siwencodeext(struct ne
>        idx = erq->flags & IW_ENCODE_INDEX;
>        if (cipher == WLAN_CIPHER_SUITE_AES_CMAC) {
>                if (idx < 4 || idx > 5) {
> -                       /*
> -                        * XXX: Only wpa_supplicant ever used this
> -                        *      can we still change the ABI a little
> -                        *      so we do not need to keep track of
> -                        *      the default key?
> -                        */
> -                       return -EINVAL;
> +                       idx = wdev->wext.default_mgmt_key;
> +                       if (idx < 0)
> +                               return -EINVAL;
>                } else
>                        idx--;
>        } else {
>
>
>
--
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