Static wep keys not set

Dan Williams dcbw
Tue Apr 3 04:33:29 PDT 2007


On Tue, 2007-04-03 at 12:37 +0200, Rodolfo Giometti wrote:
> On Tue, April 3, 2007 10:17, Rodolfo Giometti said:
> 
> > I'm trying to set up static WEP keys with the following hostapd-0.5.7
> > configuration file:
> 
> After digging hostapd code I found that the problem is that the WEP key is set
> _before_ enabling privacy. Here my patch:

Jouni, could you explain privacy invoked a bit?  I've looked around for
stuff about it quite a bit before but couldn't find much at all.

In any case, this seems somewhat wrong; why exactly does the madwifi
driver care what order these two things are set in?  It really
shouldn't.

Dan

> --- hostapd.c.orig      2006-12-10 04:13:35.000000000 +0100
> +++ hostapd.c   2007-04-03 11:51:20.000000000 +0200
> @@ -671,6 +671,12 @@
>         if (hapd->conf->ssid.wep.default_len)
>                 return 0;
> 
> +       if (hostapd_set_privacy(hapd, 1)) {
> +               wpa_printf(MSG_ERROR, "Could not set PrivacyInvoked "
> +                          "for interface %s", hapd->conf->iface);
> +               return -1;
> +       }
> +
>         for (i = 0; i < 4; i++) {
>                 if (hapd->conf->ssid.wep.key[i] &&
>                     hostapd_set_encryption(iface, hapd, "WEP", NULL,
> --- ieee802_1x.c.orig   2006-12-24 20:21:56.000000000 +0100
> +++ ieee802_1x.c        2007-04-03 11:27:58.000000000 +0200
> @@ -1668,8 +1668,7 @@
> 
>                 if (hapd->default_wep_key == NULL)
>                         return -1;
> -       } else
> -               hostapd_set_privacy(hapd, 0);
> +       }
> 
>         return 0;
>  }
> 
> Also ieee802_1x_init() should not disable privacy if it is not used otherwise
> it will disable static WEB.
> 
> Is that solution correct?
> 
> Regards,
> 
> Rodolfo
> 





More information about the Hostap mailing list