Skip to content

wpagui WPS PIN connect bug #10

@MrMiracleMan111

Description

@MrMiracleMan111

The wpa_gui application fails to connect to an AP that is in WPS PIN Mode. After selecting the scanned network, putting the WPS PIN in the AP PIN field and clicking the Use AP Pin button the Enrollee device fails to connect to the WPS AP.

The Use AP Pin button press callback within wpa_supplicant/wpa_gui-qt4/wpagui.cpp seems to be the culprit. Instead of connecting as an Enrollee, the "WPS_REG" command forces a connection as a Registrar to the other Registrar who is expecting an Enrollee not another Registrar to connect.

wpa_supplicant/wpa_gui-qt4/wpagui.cpp

void WpaGui::wpsApPin()
{
	char reply[20];
	size_t reply_len = sizeof(reply);

	QString cmd("WPS_REG " + bssFromScan + " " + wpsApPinEdit->text());   // Problematic line
	if (ctrlRequest(cmd.toLocal8Bit().constData(), reply, &reply_len) < 0)
		return;

	wpsStatusText->setText(tr("Waiting for AP/Enrollee"));
	wpsRunning = true;
}

I propose the following change to wpa_supplicant/wpa_gui-qt4/wpagui.cpp

void WpaGui::wpsApPin()
{
	char reply[20];
	size_t reply_len = sizeof(reply);

	QString cmd("WPS_PIN " + bssFromScan + " " + wpsApPinEdit->text());  // changed "WPS_REG " to "WPS_PIN "
	if (ctrlRequest(cmd.toLocal8Bit().constData(), reply, &reply_len) < 0)
		return;

	wpsStatusText->setText(tr("Waiting for AP/Enrollee"));
	wpsRunning = true;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions