Jouni Malinen | 1 Mar 2008 01:06
Picon

Re: Differences between EAPOL v1 and EAPOL v2?

On Thu, Feb 28, 2008 at 09:37:59PM +0000, Queisser, Andrew (core, context, who knows?) wrote:

> We're running into some incompatibilies between clients that expect EAPOL v1 and APs that run EAPOL v2.

Unfortunately, some clients have incorrect implementation for IEEE
802.1X/EAPOL version negotiation and they refuse to work with EAPOL v2
even though the connection would work fine if they just allowed it to
continue..

> I took a look at the applicable IEEE specs from 2001 and 2004 but I have a hard time distilling the
differences between the two versions. How big are the differences between the two versions for clients
running WPA-PSK? Would it be safe for those clients to bypass the hardcoded check for EAPOL v1 and connect
to APs running v2?

I don't remember whether there actually is any externally noticeable
difference apart from the version number in the EAPOL header. As far as
WPA-PSK, I don't think there are any real differences.

The way IEEE 802.1X version negotiation is supposed to work is that v1
supplicants can act in the exact same way with both v1 and v2
authenticators, so yes, it would be safe to just bypass that incorrect
check for the version field. Version 1 clients should do this with any
EAPOL version and expect the other end to take care of any backwards
compatibility operations, if needed.

--

-- 
Jouni Malinen                                            PGP id EFC895FA
Saber Zrelli | 2 Mar 2008 13:03
Picon

Re: help urgently needed!

Hi Sven,

Your problem could be caused by the bridge setup. Have you tried using NAT ?

> hi everyone,
>
> we are supposed to roll out about 20 new access points on our first test
> site in a few days, however, I haven't quite got them working yet.
> The APs are small Alix mainboards equipped with two Atheros miniPCI
> cards (madwifi driver). System is minimal Debian stable.
>
> bridgeutils version is 1.2
> hostapd version is 0.5.5
> (both from stable debian package)
>
> The current major problem at hand is as follows:
>
> Most important scenario for this test site is this:
>
> Asterisk Voip server <--> AP <--> Mobile SIP client (Nokia E65 / E51)
> (Everything in one LAN)
>
> We are using a bridge setup, with e.g. br0 containing eth0 and ath0 on
> the APs.
>
> Using no, WPA, or WPA2 encryption (with PSK) the mobile clients connect
> with no problem, they register to Asterisk Voip server, I can start a
> call, I can browse the internet on the mobiles, too.
>
> However, using CCMP algorithm in hostapd I cannot ping or reach the
(Continue reading)

Sven Nielsen | 2 Mar 2008 18:00
Picon

Nokia E65, E51 connection problem with bridge and madwifi (Re: help urgently needed!)

I did not try using NAT since this requires setting up dhcp on the
embedded AP devices. It might work without the bridge, but I have to use
some kind of bridge setup since, well, I need a LAN Access point and not
a router here. ;-)

At a guess, problem is Nokia together with madwifi, as WEP (no hostapd)
and WPA exhibit the same connection problem (Nokia outbound ok, inbound
to Nokia fails)

I will try to get some info on the madwifi chat tomorrow. 
Still, the problem is most probably caused by the Nokia phones since my
laptop has a reliable and stable connection, so I can only hope the guys
at madwifi know this problem already and know how to solve it.

regards,
sven

Am Sonntag, den 02.03.2008, 21:03 +0900 schrieb Saber Zrelli:
> Hi Sven,
> 
> Your problem could be caused by the bridge setup. Have you tried using NAT ?
> 
> > hi everyone,
> >
> > we are supposed to roll out about 20 new access points on our first test
> > site in a few days, however, I haven't quite got them working yet.
> > The APs are small Alix mainboards equipped with two Atheros miniPCI
> > cards (madwifi driver). System is minimal Debian stable.
> >
> > bridgeutils version is 1.2
(Continue reading)

Thomas Unterleitner | 3 Mar 2008 09:57
Picon

ndisuio dosn't receive packets

Currently i test the version 0.5.10 with windows (xp/vista) and with ndisuio. But on the most computers there are the same situation, the EAPOL Start Request will be send, the EAP Rquest comes from the switch - but the ReadFile Function inside l2_packet_ndis.c dosn't become any data.
 
Is there anyone in the community with experiance inside windows and wpa_supplicant?
 
greetings
thomas

_______________________________________________
HostAP mailing list
HostAP <at> lists.shmoo.com
http://lists.shmoo.com/mailman/listinfo/hostap
fbernal@um.es | 3 Mar 2008 18:33
Picon
Favicon

avoid EAP REQUEST ID

Hi all,

I'm working with HOSTAP and I want to avoid the sending of the EAP  
REQUEST ID message and to start directly with the first message of a  
EAP METHOD. See the following example to clarify.

message interchange in the EAP MD5 method.

1) A-> P: eap request/id

2) P->A: eap response/id

3) A->P: eap-md5 request

4) P->A: eap-md5 response

5) A->P: eap success

The idea is remove messages 1 and 2 when the mobile node attaches to  
the access point.

So, my ask is: what's the part in the hostap's code that must be  
modified to avoid the initial eap request/id?

Thank you very much,
Fernando.
Dan Williams | 4 Mar 2008 15:52
Picon
Favicon

[PATCH] fix qt3 wpa_gui build

When a WpaMsg item to the QValueList WpaMsgList, there's no constructor
that the QValueList can call.  This is a port of the fix from the stable
branch where it builds fine.

diff -up wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/wpamsg.h.fix wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/wpamsg.h
--- wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/wpamsg.h.fix	2008-03-03 11:58:18.000000000 -0500
+++ wpa_supplicant-0.6.3/wpa_supplicant/wpa_gui/wpamsg.h	2008-03-03 11:58:33.000000000 -0500
 <at>  <at>  -14,6 +14,7  <at>  <at>  typedef QValueList<WpaMsg> WpaMsgList;

 class WpaMsg {
 public:
+    WpaMsg() {}
     WpaMsg(const QString &_msg, int _priority = 2)
 	: msg(_msg), priority(_priority)
     {
Dan Williams | 4 Mar 2008 15:58
Picon
Favicon

[PATCH] (backport) fix usage of deprecated D-Bus functions

Patch has been in 0.6.x for a while already, and I've been shipping it
along with 0.5.7 in Fedora 8 and Fedora rawhide for quite a while
already too.  I'm assuming you can't cherry-pick from 0.6.x back to
stable since you blew away the git repo and reinitialized :)

The purpose of the patch is to get rid of
dbus_message_iter_get_array_len(), which is deprecated because it
doesn't work everywhere or the way we expect it.  Therefore, instead of
pre-sizing the arrays, we start with a reasonable size and grow the
arrays when needed while demarshalling the D-Bus message.

--- dbus_dict_helpers.c.array-fix	2006-12-18 12:31:11.000000000 -0500
+++ dbus_dict_helpers.c	2006-12-20 03:17:08.000000000 -0500
 <at>  <at>  -629,36 +629,55  <at>  <at>  dbus_bool_t wpa_dbus_dict_open_read(DBus
 }

 
+#define BYTE_ARRAY_CHUNK_SIZE 34
+#define BYTE_ARRAY_ITEM_SIZE (sizeof (char))
+
 static dbus_bool_t _wpa_dbus_dict_entry_get_byte_array(
-	DBusMessageIter *iter, int array_len, int array_type,
+	DBusMessageIter *iter, int array_type,
 	struct wpa_dbus_dict_entry *entry)
 {
-	dbus_uint32_t i = 0;
+	dbus_uint32_t count = 0;
 	dbus_bool_t success = FALSE;
-	char byte;
+	char * buffer;

-	/* Zero-length arrays are valid. */
-	if (array_len == 0) {
-		entry->bytearray_value = NULL;
-		entry->array_type = DBUS_TYPE_BYTE;
-		success = TRUE;
-		goto done;
-	}
+	entry->bytearray_value = NULL;
+	entry->array_type = DBUS_TYPE_BYTE;

-	entry->bytearray_value = wpa_zalloc(array_len * sizeof(char));
-	if (!entry->bytearray_value) {
+	buffer = wpa_zalloc(BYTE_ARRAY_ITEM_SIZE * BYTE_ARRAY_CHUNK_SIZE);
+	if (!buffer) {
 		perror("_wpa_dbus_dict_entry_get_byte_array[dbus]: out of "
 		       "memory");
 		goto done;
 	}

-	entry->array_type = DBUS_TYPE_BYTE;
-	entry->array_len = array_len;
+	entry->bytearray_value = buffer;
+	entry->array_len = 0;
 	while (dbus_message_iter_get_arg_type(iter) == DBUS_TYPE_BYTE) {
+		char byte;
+
+		if ((count % BYTE_ARRAY_CHUNK_SIZE) == 0 && count != 0) {
+			buffer = realloc(buffer, BYTE_ARRAY_ITEM_SIZE * (count + BYTE_ARRAY_CHUNK_SIZE));
+			if (buffer == NULL) {
+				perror("_wpa_dbus_dict_entry_get_byte_array["
+				       "dbus] out of memory trying to "
+				       "retrieve the string array");
+				goto done;
+			}
+		}
+		entry->bytearray_value = buffer;
+
 		dbus_message_iter_get_basic(iter, &byte);
-		entry->bytearray_value[i++] = byte;
+		entry->bytearray_value[count] = byte;
+		entry->array_len = ++count;
 		dbus_message_iter_next(iter);
 	}
+
+	/* Zero-length arrays are valid. */
+	if (entry->array_len == 0) {
+		free(entry->bytearray_value);
+		entry->bytearray_value = NULL;
+	}
+
 	success = TRUE;

 done:
 <at>  <at>  -666,8 +685,11  <at>  <at>  done:
 }

 
+#define STR_ARRAY_CHUNK_SIZE 8
+#define STR_ARRAY_ITEM_SIZE (sizeof (char *))
+
 static dbus_bool_t _wpa_dbus_dict_entry_get_string_array(
-	DBusMessageIter *iter, int array_len, int array_type,
+	DBusMessageIter *iter, int array_type,
 	struct wpa_dbus_dict_entry *entry)
 {
 	dbus_uint32_t count = 0;
 <at>  <at>  -677,13 +699,7  <at>  <at>  static dbus_bool_t _wpa_dbus_dict_entry_
 	entry->strarray_value = NULL;
 	entry->array_type = DBUS_TYPE_STRING;

-	/* Zero-length arrays are valid. */
-	if (array_len == 0) {
-		success = TRUE;
-		goto done;
-	}
-
-	buffer = wpa_zalloc(sizeof (char *) * 8);
+	buffer = wpa_zalloc(STR_ARRAY_ITEM_SIZE * STR_ARRAY_CHUNK_SIZE);
 	if (buffer == NULL) {
 		perror("_wpa_dbus_dict_entry_get_string_array[dbus] out of "
 		       "memory trying to retrieve a string array");
 <at>  <at>  -696,18 +712,14  <at>  <at>  static dbus_bool_t _wpa_dbus_dict_entry_
 		const char *value;
 		char *str;

-		if ((count % 8) == 0 && count != 0) {
-			char **tmp;
-			tmp = realloc(buffer, sizeof(char *) * (count + 8));
-			if (tmp == NULL) {
+		if ((count % STR_ARRAY_CHUNK_SIZE) == 0 && count != 0) {
+			buffer = realloc(buffer, STR_ARRAY_ITEM_SIZE * (count + STR_ARRAY_CHUNK_SIZE));
+			if (buffer == NULL) {
 				perror("_wpa_dbus_dict_entry_get_string_array["
 				       "dbus] out of memory trying to "
 				       "retrieve the string array");
-				free(buffer);
-				buffer = NULL;
 				goto done;
 			}
-			buffer = tmp;
 		}
 		entry->strarray_value = buffer;

 <at>  <at>  -723,6 +735,13  <at>  <at>  static dbus_bool_t _wpa_dbus_dict_entry_
 		entry->array_len = ++count;
 		dbus_message_iter_next(iter);
 	}
+
+	/* Zero-length arrays are valid. */
+	if (entry->array_len == 0) {
+		free(entry->strarray_value);
+		entry->strarray_value = NULL;
+	}
+
 	success = TRUE;

 done:
 <at>  <at>  -734,7 +753,6  <at>  <at>  static dbus_bool_t _wpa_dbus_dict_entry_
 	DBusMessageIter *iter_dict_val, struct wpa_dbus_dict_entry *entry)
 {
 	int array_type = dbus_message_iter_get_element_type(iter_dict_val);
-	int array_len;
 	dbus_bool_t success = FALSE;
 	DBusMessageIter iter_array;

 <at>  <at>  -743,20 +761,14  <at>  <at>  static dbus_bool_t _wpa_dbus_dict_entry_
 
 	dbus_message_iter_recurse(iter_dict_val, &iter_array);

- 	array_len = dbus_message_iter_get_array_len(&iter_array);
-	if (array_len < 0)
-		return FALSE;
-
  	switch (array_type) {
 	case DBUS_TYPE_BYTE:
 		success = _wpa_dbus_dict_entry_get_byte_array(&iter_array,
-							      array_len,
 							      array_type,
 							      entry);
 		break;
 	case DBUS_TYPE_STRING:
 		success = _wpa_dbus_dict_entry_get_string_array(&iter_array,
-								array_len,
 								array_type,
 								entry);
 		break;
 <at>  <at>  -943,9 +955,17  <at>  <at>  void wpa_dbus_dict_entry_clear(struct wp
 		break;
 	case DBUS_TYPE_ARRAY:
 		switch (entry->array_type) {
-		case DBUS_TYPE_BYTE:
-			free(entry->bytearray_value);
-			break;
+		case DBUS_TYPE_BYTE: {
+				free(entry->bytearray_value);
+				break;
+			}
+		case DBUS_TYPE_STRING: {
+				int i;
+				for (i = 0; i < entry->array_len; i++)
+					free (entry->strarray_value[i]);
+				free (entry->strarray_value);
+				break;
+			}
 		}
 		break;
 	}
Dan Williams | 4 Mar 2008 16:04
Picon
Favicon

[PATCH] fix potential use-after-free in dbus byte array demarshaling code

The byte array code should be clearing its own pointer, not the string array pointer.

diff --git a/wpa_supplicant/dbus_dict_helpers.c b/wpa_supplicant/dbus_dict_helpers.c
index 1232ab2..d810979 100644
--- a/wpa_supplicant/dbus_dict_helpers.c
+++ b/wpa_supplicant/dbus_dict_helpers.c
 <at>  <at>  -674,7 +674,7  <at>  <at>  static dbus_bool_t _wpa_dbus_dict_entry_get_byte_array(
 	/* Zero-length arrays are valid. */
 	if (entry->array_len == 0) {
 		free(entry->bytearray_value);
-		entry->strarray_value = NULL;
+		entry->bytearray_value = NULL;
 	}

 	success = TRUE;
Dan Williams | 4 Mar 2008 16:05
Picon
Favicon

Re: [PATCH] (backport) fix usage of deprecated D-Bus functions

On Tue, 2008-03-04 at 09:58 -0500, Dan Williams wrote:
> Patch has been in 0.6.x for a while already, and I've been shipping it
> along with 0.5.7 in Fedora 8 and Fedora rawhide for quite a while
> already too.  I'm assuming you can't cherry-pick from 0.6.x back to
> stable since you blew away the git repo and reinitialized :)
> 
> The purpose of the patch is to get rid of
> dbus_message_iter_get_array_len(), which is deprecated because it
> doesn't work everywhere or the way we expect it.  Therefore, instead of
> pre-sizing the arrays, we start with a reasonable size and grow the
> arrays when needed while demarshalling the D-Bus message.

Note that this patch isn't susceptible to the potential use-after-free
issue that I just patched for 0.6.x.  I fixed the issue in the patch
below before sending it to the list.

Dan

> --- dbus_dict_helpers.c.array-fix	2006-12-18 12:31:11.000000000 -0500
> +++ dbus_dict_helpers.c	2006-12-20 03:17:08.000000000 -0500
>  <at>  <at>  -629,36 +629,55  <at>  <at>  dbus_bool_t wpa_dbus_dict_open_read(DBus
>  }
>  
> 
> +#define BYTE_ARRAY_CHUNK_SIZE 34
> +#define BYTE_ARRAY_ITEM_SIZE (sizeof (char))
> +
>  static dbus_bool_t _wpa_dbus_dict_entry_get_byte_array(
> -	DBusMessageIter *iter, int array_len, int array_type,
> +	DBusMessageIter *iter, int array_type,
>  	struct wpa_dbus_dict_entry *entry)
>  {
> -	dbus_uint32_t i = 0;
> +	dbus_uint32_t count = 0;
>  	dbus_bool_t success = FALSE;
> -	char byte;
> +	char * buffer;
>  
> -	/* Zero-length arrays are valid. */
> -	if (array_len == 0) {
> -		entry->bytearray_value = NULL;
> -		entry->array_type = DBUS_TYPE_BYTE;
> -		success = TRUE;
> -		goto done;
> -	}
> +	entry->bytearray_value = NULL;
> +	entry->array_type = DBUS_TYPE_BYTE;
>  
> -	entry->bytearray_value = wpa_zalloc(array_len * sizeof(char));
> -	if (!entry->bytearray_value) {
> +	buffer = wpa_zalloc(BYTE_ARRAY_ITEM_SIZE * BYTE_ARRAY_CHUNK_SIZE);
> +	if (!buffer) {
>  		perror("_wpa_dbus_dict_entry_get_byte_array[dbus]: out of "
>  		       "memory");
>  		goto done;
>  	}
>  
> -	entry->array_type = DBUS_TYPE_BYTE;
> -	entry->array_len = array_len;
> +	entry->bytearray_value = buffer;
> +	entry->array_len = 0;
>  	while (dbus_message_iter_get_arg_type(iter) == DBUS_TYPE_BYTE) {
> +		char byte;
> +
> +		if ((count % BYTE_ARRAY_CHUNK_SIZE) == 0 && count != 0) {
> +			buffer = realloc(buffer, BYTE_ARRAY_ITEM_SIZE * (count + BYTE_ARRAY_CHUNK_SIZE));
> +			if (buffer == NULL) {
> +				perror("_wpa_dbus_dict_entry_get_byte_array["
> +				       "dbus] out of memory trying to "
> +				       "retrieve the string array");
> +				goto done;
> +			}
> +		}
> +		entry->bytearray_value = buffer;
> +
>  		dbus_message_iter_get_basic(iter, &byte);
> -		entry->bytearray_value[i++] = byte;
> +		entry->bytearray_value[count] = byte;
> +		entry->array_len = ++count;
>  		dbus_message_iter_next(iter);
>  	}
> +
> +	/* Zero-length arrays are valid. */
> +	if (entry->array_len == 0) {
> +		free(entry->bytearray_value);
> +		entry->bytearray_value = NULL;
> +	}
> +
>  	success = TRUE;
>  
>  done:
>  <at>  <at>  -666,8 +685,11  <at>  <at>  done:
>  }
>  
> 
> +#define STR_ARRAY_CHUNK_SIZE 8
> +#define STR_ARRAY_ITEM_SIZE (sizeof (char *))
> +
>  static dbus_bool_t _wpa_dbus_dict_entry_get_string_array(
> -	DBusMessageIter *iter, int array_len, int array_type,
> +	DBusMessageIter *iter, int array_type,
>  	struct wpa_dbus_dict_entry *entry)
>  {
>  	dbus_uint32_t count = 0;
>  <at>  <at>  -677,13 +699,7  <at>  <at>  static dbus_bool_t _wpa_dbus_dict_entry_
>  	entry->strarray_value = NULL;
>  	entry->array_type = DBUS_TYPE_STRING;
>  
> -	/* Zero-length arrays are valid. */
> -	if (array_len == 0) {
> -		success = TRUE;
> -		goto done;
> -	}
> -
> -	buffer = wpa_zalloc(sizeof (char *) * 8);
> +	buffer = wpa_zalloc(STR_ARRAY_ITEM_SIZE * STR_ARRAY_CHUNK_SIZE);
>  	if (buffer == NULL) {
>  		perror("_wpa_dbus_dict_entry_get_string_array[dbus] out of "
>  		       "memory trying to retrieve a string array");
>  <at>  <at>  -696,18 +712,14  <at>  <at>  static dbus_bool_t _wpa_dbus_dict_entry_
>  		const char *value;
>  		char *str;
>  
> -		if ((count % 8) == 0 && count != 0) {
> -			char **tmp;
> -			tmp = realloc(buffer, sizeof(char *) * (count + 8));
> -			if (tmp == NULL) {
> +		if ((count % STR_ARRAY_CHUNK_SIZE) == 0 && count != 0) {
> +			buffer = realloc(buffer, STR_ARRAY_ITEM_SIZE * (count + STR_ARRAY_CHUNK_SIZE));
> +			if (buffer == NULL) {
>  				perror("_wpa_dbus_dict_entry_get_string_array["
>  				       "dbus] out of memory trying to "
>  				       "retrieve the string array");
> -				free(buffer);
> -				buffer = NULL;
>  				goto done;
>  			}
> -			buffer = tmp;
>  		}
>  		entry->strarray_value = buffer;
>  
>  <at>  <at>  -723,6 +735,13  <at>  <at>  static dbus_bool_t _wpa_dbus_dict_entry_
>  		entry->array_len = ++count;
>  		dbus_message_iter_next(iter);
>  	}
> +
> +	/* Zero-length arrays are valid. */
> +	if (entry->array_len == 0) {
> +		free(entry->strarray_value);
> +		entry->strarray_value = NULL;
> +	}
> +
>  	success = TRUE;
>  
>  done:
>  <at>  <at>  -734,7 +753,6  <at>  <at>  static dbus_bool_t _wpa_dbus_dict_entry_
>  	DBusMessageIter *iter_dict_val, struct wpa_dbus_dict_entry *entry)
>  {
>  	int array_type = dbus_message_iter_get_element_type(iter_dict_val);
> -	int array_len;
>  	dbus_bool_t success = FALSE;
>  	DBusMessageIter iter_array;
>  
>  <at>  <at>  -743,20 +761,14  <at>  <at>  static dbus_bool_t _wpa_dbus_dict_entry_
>  
>  	dbus_message_iter_recurse(iter_dict_val, &iter_array);
>  
> - 	array_len = dbus_message_iter_get_array_len(&iter_array);
> -	if (array_len < 0)
> -		return FALSE;
> -
>   	switch (array_type) {
>  	case DBUS_TYPE_BYTE:
>  		success = _wpa_dbus_dict_entry_get_byte_array(&iter_array,
> -							      array_len,
>  							      array_type,
>  							      entry);
>  		break;
>  	case DBUS_TYPE_STRING:
>  		success = _wpa_dbus_dict_entry_get_string_array(&iter_array,
> -								array_len,
>  								array_type,
>  								entry);
>  		break;
>  <at>  <at>  -943,9 +955,17  <at>  <at>  void wpa_dbus_dict_entry_clear(struct wp
>  		break;
>  	case DBUS_TYPE_ARRAY:
>  		switch (entry->array_type) {
> -		case DBUS_TYPE_BYTE:
> -			free(entry->bytearray_value);
> -			break;
> +		case DBUS_TYPE_BYTE: {
> +				free(entry->bytearray_value);
> +				break;
> +			}
> +		case DBUS_TYPE_STRING: {
> +				int i;
> +				for (i = 0; i < entry->array_len; i++)
> +					free (entry->strarray_value[i]);
> +				free (entry->strarray_value);
> +				break;
> +			}
>  		}
>  		break;
>  	}
> 
> _______________________________________________
> HostAP mailing list
> HostAP <at> lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
Jouni Malinen | 4 Mar 2008 18:07
Picon

Re: ndisuio dosn't receive packets

On Mon, Mar 03, 2008 at 09:57:37AM +0100, Thomas Unterleitner wrote:
> Currently i test the version 0.5.10 with windows (xp/vista) and with
> ndisuio. But on the most computers there are the same situation, the EAPOL
> Start Request will be send, the EAP Rquest comes from the switch - but the
> ReadFile Function inside l2_packet_ndis.c dosn't become any data.

Which NDIS driver are you using? Are you saying that only the initial
EAPOL frames (EAP-Request/Identity) is missed and after the EAPOL-Start
is sent out, authentication goes through without problems or that no
EAPOL frames are received?

--

-- 
Jouni Malinen                                            PGP id EFC895FA

Gmane