Constantin Musca | 22 Sep 14:00 2014
Picon

[PATCH v2] P2P: Decrement sd_pending_bcast_queries when sd returns success

The sd_pending_bcast_queries variable should be decremented only
in case of success. This way, the supplicant can retry if a service
discovery request fails.

Signed-off-by: Constantin Musca <constantin.musca <at> intel.com>
---
 src/p2p/p2p.c    | 10 ++++++++++
 src/p2p/p2p_sd.c | 10 ----------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index e746310..522ea89 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
 <at>  <at>  -2773,6 +2773,16  <at>  <at>  static void p2p_sd_cb(struct p2p_data *p2p, int success)
 		p2p_dbg(p2p, "No SD peer entry known");
 		p2p_continue_find(p2p);
 		return;
+	} else if (p2p->sd_query->for_all_peers) {
+		/* Update the pending broadcast SD query count for this device */
+		p2p->sd_peer->sd_pending_bcast_queries--;
+
+		/*
+		 * If there are no pending broadcast queries for this device, mark it as
+		 * done (-1).
+		 */
+		if (p2p->sd_peer->sd_pending_bcast_queries == 0)
+			p2p->sd_peer->sd_pending_bcast_queries = -1;
 	}

(Continue reading)

Eduardo Abinader | 20 Sep 22:50 2014

[PATCH 0/2] P2P: Improvements on p2p global deinit

Patchset regarding proper p2p service flush and code
cleaning.

Eduardo Abinader (2):
  P2P: Flush services based on global p2p init and not p2p ifaces
  P2P: Remove unecessary sanity check for global p2p

 wpa_supplicant/p2p_supplicant.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--

-- 
1.9.1
Robert Chiras | 20 Sep 11:15 2014
Picon

[PATCH] Handle disconnect event while scanning for WPS

If we are already connected to an AP and we initiate a WPS connection,
wpa_supplicant will first disconnect from the current AP then initiate a
scan request. The driver, will send us a disconnect event with
ReasonCode 3 (WLAN_REASON_DEAUTH_LEAVING), confirming the disconnection
from te current AP.
If this happens during a WPS connection, when scan results receive, this
disconnect will cause the process to stop.
So, if a disconnect event is received while scanning for WPS connection,
ignore this event and continue with WPS connection.

Change-Id: I9332959a25012426cbb8c5ee035b04269c81b6ed
Signed-off-by: Robert Chiras <robert.chiras <at> intel.com>
---
 wpa_supplicant/events.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index ba9e083..634e4c6 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
 <at>  <at>  -1356,8 +1356,16  <at>  <at>  static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
 		goto scan_work_done;

 	if (wpa_s->disconnected) {
-		wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
-		goto scan_work_done;
+		if (wpas_wps_searching(wpa_s)) {
+			/* Received a disconnect while scanning for WPS; ignore it
+			 * and continue with WPS process.
+			 * */
(Continue reading)

Adam Langley | 19 Sep 03:40 2014
Picon

[PATCH] Support building with BoringSSL.

BoringSSL is Google's cleanup of OpenSSL and an attempt to unify
Chromium, Android and internal codebases around a single OpenSSL.

As part of moving Android to BoringSSL, the wpa_supplicant maintainers
in Android requested that I upstream the change. I've worked to reduce
the size of the patch a lot but I'm afraid that it still contains a
number of #ifdefs.

One change worth noting (which I didn't #ifdef) is the switch from the
deprecated ERR_remove_state to ERR_remove_thread_state. I think this is
generally applicable because upstream have deprecated it, but it does
require OpenSSL 1.0.0 or greater (i.e. not 0.9.8).

[1] https://www.imperialviolet.org/2014/06/20/boringssl.html
---
 src/crypto/crypto_openssl.c     |  6 +++++-
 src/crypto/tls_openssl.c        | 17 ++++++++++++-----
 src/eap_common/eap_pwd_common.c |  2 ++
 3 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c
index 8876ebf..da4d5ef 100644
--- a/src/crypto/crypto_openssl.c
+++ b/src/crypto/crypto_openssl.c
 <at>  <at>  -40,7 +40,7  <at>  <at> 

 static BIGNUM * get_group5_prime(void)
 {
-#if OPENSSL_VERSION_NUMBER < 0x00908000
+#if OPENSSL_VERSION_NUMBER < 0x00908000 || defined(OPENSSL_IS_BORINGSSL)
(Continue reading)

Adrian Moran | 18 Sep 16:41 2014

EAPOL_TEST - Send vendor specific Radius attribute

Dear all,

I need to send some vendor specific Radius attributes through the eapol_test application. Specifically I need to send the atribute RADIUS_VENDOR_ATTR_WFA_HS20_STA_VERSION (40808/3). I see that this attribute is supported since it is defined in src/radius/radius.h.

However I don't find how to send it. I know the option -N to send specific attributes but I have not been able to use it with vendor specific attributes.

Does someone know how to use it?

Thank you in advance for the support,

Adrián
_______________________________________________
HostAP mailing list
HostAP <at> lists.shmoo.com
http://lists.shmoo.com/mailman/listinfo/hostap
Constantin Musca | 18 Sep 14:18 2014
Picon

[PATCH] P2P: Decrement sd_pending_bcast_queries when sd returns success

The sd_pending_bcast_queries variable should be decremented only
in case of success. This way, the supplicant can retry if a service
discovery request fails.

Change-Id: Id2061f31e7f4669527d11cb3478a12af4418e1b9
Signed-off-by: Constantin Musca <constantin.musca <at> intel.com>
---
 src/p2p/p2p.c    | 10 ++++++++++
 src/p2p/p2p_sd.c | 10 ----------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index e746310..522ea89 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
 <at>  <at>  -2773,6 +2773,16  <at>  <at>  static void p2p_sd_cb(struct p2p_data *p2p, int success)
 		p2p_dbg(p2p, "No SD peer entry known");
 		p2p_continue_find(p2p);
 		return;
+	} else if (p2p->sd_query->for_all_peers) {
+		/* Update the pending broadcast SD query count for this device */
+		p2p->sd_peer->sd_pending_bcast_queries--;
+
+		/*
+		 * If there are no pending broadcast queries for this device, mark it as
+		 * done (-1).
+		 */
+		if (p2p->sd_peer->sd_pending_bcast_queries == 0)
+			p2p->sd_peer->sd_pending_bcast_queries = -1;
 	}

 	/* Wait for response from the peer */
diff --git a/src/p2p/p2p_sd.c b/src/p2p/p2p_sd.c
index 6235b1d..13119c2 100644
--- a/src/p2p/p2p_sd.c
+++ b/src/p2p/p2p_sd.c
 <at>  <at>  -301,16 +301,6  <at>  <at>  int p2p_start_sd(struct p2p_data *p2p, struct p2p_device *dev)
 		ret = -1;
 	}

-	/* Update the pending broadcast SD query count for this device */
-	dev->sd_pending_bcast_queries--;
-
-	/*
-	 * If there are no pending broadcast queries for this device, mark it as
-	 * done (-1).
-	 */
-	if (dev->sd_pending_bcast_queries == 0)
-		dev->sd_pending_bcast_queries = -1;
-
 	wpabuf_free(req);

 	return ret;
--

-- 
1.9.1
John Finley | 18 Sep 04:06 2014
Picon

wps_pbc "alert" event?

Hi,

I have my AP and device set up so at the moment I can do "wpa_cli wps_pbc" and "hostapd_cli wps_pbc", and the pairing works as expected. The next step I'm trying to get through might be a little odd.

What I want is for the button push on the device (wpa_cli wps_pbc) to be noticed _automatically_ on the AP, such that I can prompt an operator to accept the pairing or not. In other words, the only user-initiated action to start a pairing will be the button push on the device, then software should lead the user through the rest of it. Security is secondary to simplicity.

So, I am trying to figure out how, on the AP side, I can get some kind of event when the device tries to pair. The device does not know the SSID of the AP - it is going to be quite trusting as far as whom it will pair with.

I attached an "action" to hostapd_cli, i.e. "hostapd_cli -a/my/script", and all it does is log what it sees to a file. I don't see anything interesting that comes out as an event when I initiate pairing on the device side. When I initiate pairing on _both_ sides, I see events corresponding to the pairing, but what I was hoping for is some kind of "please pair with me" popping out when the device tries to pair.

Starting to grope around in the dark, I added some output on the AP side in wps_hostapd.c::hostapd_wps_probe_req_rx, and can see probes coming in from the device when I push the button, but they are dropped when ieee802_11_vendor_ie_concat returns NULL. I have no idea if I'm in an interesting place there or not.

So questions:
* Whether this is a bad idea or not, does it sound possible? (Either out of the box, or with some tweaks to the code.)
* Is there information already available at the hostapd level that would indicate there is a device out there that is trying to do wps_pbc pairing? Some way to enable more "events"?
* If so, is there a way to get it sent to hostapd_cli so I can get an event?
* If not, is there some mechanism in wpa_supplicant that would let me do something like append my own ie to a probe or anything special like that, that would let me get some kind of signal from the device to hostapd so I can proceed on the AP side?

I do not mind changing things if needed, but would like to start with a feeling that there will be success in the end.

Sorry for the length. I do not mean to get free design input (or criticism :). I'm just trying to figure out whether I need to start modifying code, or if it already does what I want and I am just missing it.

Thanks,
John
_______________________________________________
HostAP mailing list
HostAP <at> lists.shmoo.com
http://lists.shmoo.com/mailman/listinfo/hostap
Constantin Musca | 17 Sep 21:02 2014
Picon

[PATCH] P2P: Increment sd_pending_bcast_queries if Service Discovery fails

If the Service Discovery Query TX callback returns an unsuccessful
status increment the sd_peer pending_bcast_queries variable to
resend the Service Discovery request.

Signed-off-by: Constantin Musca <constantin.musca <at> intel.com>
---
 src/p2p/p2p.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index e746310..7aea86d 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
 <at>  <at>  -2764,6 +2764,10  <at>  <at>  static void p2p_sd_cb(struct p2p_data *p2p, int success)
 	p2p->pending_action_state = P2P_NO_PENDING_ACTION;

 	if (!success) {
+		if (p2p->sd_peer->sd_pending_bcast_queries == -1) {
+			p2p->sd_peer->sd_pending_bcast_queries = 0;
+		}
+		p2p->sd_peer->sd_pending_bcast_queries++;
 		p2p->sd_peer = NULL;
 		p2p_continue_find(p2p);
 		return;
--

-- 
1.9.1
Izoard, CedricX | 17 Sep 16:47 2014
Picon

question regarding sd_pending_bcast_queries field

Hi,

I have some questions regarding the sd_pending_bcast_queries field added by commit "P2P: Address few
issues seen with P2P SD".
My understanding is that this field track the number of broadcast query remaining for each p2p device but:
  - in p2p_start_sd, it is decreased for any query. I guess it should be decreased only for broadcast query, am
I correct ?
  - It is decreased even if p2p_send_action fails, is it expected behavior ?
  - Shouldn't it be decreased  only in p2p_sd_cb when status is OK ? 
    Indeed If we take the use case when driver fails to send a broadcast query to peer, when p2p_sd_cb is called
(with status FAIL) wpa_supplicant won't try to resend the query as sd_pending_bcast_queries is already
set to -1 and it remains "stuck" in p2p-send-action radio work until it reaches timeout.

Thanks for your answers.

cedric
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
Stefan Lippers-Hollmann | 17 Sep 01:22 2014
Picon
Picon

[PATCH] ap_config.c: fix typo for "capabilities"

Signed-off-by: Stefan Lippers-Hollmann <s.l-h <at> gmx.de>
---
 src/ap/ap_config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
index bc9f6cf..d7d5c3b 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
 <at>  <at>  -759,7 +759,7  <at>  <at>  static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
 	    conf->hw_mode == HOSTAPD_MODE_IEEE80211B) {
 		bss->disable_11n = 1;
 		wpa_printf(MSG_ERROR, "HT (IEEE 802.11n) in 11b mode is not "
-			   "allowed, disabling HT capabilites");
+			   "allowed, disabling HT capabilities");
 	}

 	if (full_config && conf->ieee80211n &&
--

-- 
2.1.0
Bernhard Walle | 16 Sep 21:20 2014
Picon

[PATCH] util: Don't use "\e"

'\e' representing ESC (0x1b) is not C standard, it's an GNU extension.
https://gcc.gnu.org/onlinedocs/gcc/Character-Escapes.html#Character-Escapes

Since the code also compiles on Windows with Microsoft compiler, we
should use '\033' instead.

Note: I didn't try to build the whole wpa_supplicant on Windows, so I
don't know if it still builds (I have no Visual Studio 2005 for a quick
test). I just needed the string conversion routines for the P"" syntax
in both directions.

Signed-off-by: Bernhard Walle <bernhard <at> bwalle.de>
---
 src/utils/common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/utils/common.c b/src/utils/common.c
index 5b017e5..7ef8b0a 100644
--- a/src/utils/common.c
+++ b/src/utils/common.c
 <at>  <at>  -362,7 +362,7  <at>  <at>  void printf_encode(char *txt, size_t maxlen, const u8 *data, size_t len)
 			*txt++ = '\\';
 			*txt++ = '\\';
 			break;
-		case '\e':
+		case '\033':
 			*txt++ = '\\';
 			*txt++ = 'e';
 			break;
 <at>  <at>  -427,7 +427,7  <at>  <at>  size_t printf_decode(u8 *buf, size_t maxlen, const char *str)
 				pos++;
 				break;
 			case 'e':
-				buf[len++] = '\e';
+				buf[len++] = '\033';
 				pos++;
 				break;
 			case 'x':
--

-- 
2.1.0

Gmane