On Fri, 2011-02-04 at 17:09 +0100, ext Samuel Ortiz wrote:
> > +             if (strncmp(key, "psk", 4) == 0 ||
> 4 ? If you meant 3 I can fix it myself and apply those patches.
> Otherwise, you'll have to explain :)

"psk" is the full name of the argument, and so the idea was to match
also the trailing \0 with number 4. The initial use of strcmp was to try
to signal the reader that the whole null terminated string is to be
matched. When the strncmp match is limited to three, everything starting
with psk* would match, which was not the intention. I didn't notice
anything else in wpa_supplicant starting with the letters 'psk', though.

On the line below that one, strncmp(key, "wep_key, 7) would match any of
wep_key0, wep_key1, wep_key2 and wep_key3 which is precisely as intended
(I haven't checked, but I think ConnMan sets only the first wep key;
that's another story).


Cheers,

        Patrik


_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to