[PATCH] P2P: Fix inconsistency in displaying wps pin

Jouni Malinen j
Sat Dec 10 02:16:43 PST 2011

On Fri, Dec 09, 2011 at 03:28:35AM -0800, Jithu Jance wrote:
> When "p2p_connect <devaddr> pin display join" command is issued, the pin generated in the p2p_connect context and the SHOW-PIN event are 
> different. The PIN generated in the p2p_connect context is the one in use. The provision discovery response pin generation is useful when explicit
> provision discovery is done and then the generated PIN is entered via the subsequent p2p_connect command. The attached patch doesn't generate PIN,
> if the pin is already generated in the p2p_connect context. Kindly see whether the patch is okay.

This is a bit problematic since wpa_s->p2p_pin does not get cleared and
the same PIN would be used in number of operations where it was not
supposed to be used.

> > p2p_connect 02:90:4c:12:34:56 pin display join
> 78292024 <<<<<<<<<<<<<<<<<<<<<<<<<<<<< PIN Generated in the connect context
> <3>P2P-PROV-DISC-SHOW-PIN 02:90:4c:12:34:56 23612945 <<<<<<<< Show Pin event.

In this particular sequence, I don't really see much point in even
displaying the P2P-PROV-DISC-SHOW-PIN event. In fact, it does not
necessarily even get shown if the Provision Discovery Response is not
received (there is no strict requirement on waiting for it in the case
of p2p_connect join). As such, it could be better to just make this
event conditional in a way that it is not indicated for p2p_connect join

> In case the below copy is whitespace damaged, please use the attached patch file.

The inline version was fine - thanks.

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list