[PATCH] Reset the ssid in wps before being replaced with the one in credential.

張晏榕 jungwalk at gmail.com
Fri Dec 9 16:50:46 EST 2011

Hi Jouni and Johannes,

Yes, I am trying to fix a bug related to generating random WPS ssid for
each band, and thought this kind of change maybe necessary even without
that random WPS ssid modification.
However, I seems to misunderstand how to use that SSID buffer. I will check
it more.
Thanks for your responses. :)

2011/12/10 Jouni Malinen <j at w1.fi>

> On Fri, Dec 09, 2011 at 01:10:10PM +0800, jungwalk at gmail.com wrote:
> > It is better to reset the ssid in WPS first before it is replaced with
> the one in
> > credential in case the length of ssid in credential is longer than
> wps->ssid.
> Are you trying to fix a bug that addresses some noticeable issue?
> > @@ -318,6 +318,7 @@ static int hapd_wps_cred_cb(struct hostapd_data
> *hapd, void *ctx)
> > +     os_memset(hapd->wps->ssid, 0, HOSTAPD_MAX_SSID_LEN);
> >       os_memcpy(hapd->wps->ssid, cred->ssid, cred->ssid_len);
> >       hapd->wps->ssid_len = cred->ssid_len;
> Like Johannes pointed out, this should not really result in any real
> change in actual behavior. If it does, there is likely a real bug
> somewhere else and that should be fixed. The SSID buffer is used as an
> arbitrary binary array of ssid_len octets and as such, there is no need
> to null-terminate it - the extra octets in the buffer are ignored.
> --
> Jouni Malinen                                            PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.shmoo.com/pipermail/hostap/attachments/20111210/1da6904d/attachment.htm 

More information about the HostAP mailing list