[PATCH] P2P: Add error message for invalid PIN

Jouni Malinen j
Mon Mar 5 06:36:35 PST 2012


On Sun, Mar 04, 2012 at 12:09:37PM +0900, Masashi Honma wrote:
> The second argument of p2p_connect command is "pin", "pbc" or PIN number.
> 
> But PIN number is not checked. So the user typed "pbd" can not
> recognize he mistyped.
> Because the command returns "OK".
> 
> So I made a patch adds a error message.

This may be a bit too restrictive conditions. While 4-digit PINs are not
very commonly used, I think that they would be allowed for P2P use
cases. As such, I don't think I can apply this patch in its current
form. In addition, user-generated 8-digit PINs are not required to
include a checksum digit, so the use of wps_pin_valid() may not actually
be valid for some use cases.

I would be fine with a change that verifies that the PIN value is either
a 4-digit or 8-digit number, but I'm not sure whether we can make this
command any more restrictive than that. Please note that the separate
wps_check_pin command was added for this same reason instead of making
wps_pin command validate the PIN values.


PS.

Please read the CONTRIBUTIONS file in the top of the tree and use the
Signed-hostap: line in future contributions to the project.


-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list