[pkg-wpa-devel] r1281 - in /wpasupplicant/trunk: debian/ src/common/ src/drivers/ src/eap_peer/ src/eap_server/ src/eapol_supp/ src/radius/ src/utils/ wpa_supplicant/ wpa_supplicant/vs2005/eapol_test/ wpa_supplicant/vs2005/wpa_supplicant/ wpa_supplicant/vs2005/wpasvc/ wpa_supplicant/wpa_gui-qt4/

kelmo-guest at users.alioth.debian.org kelmo-guest at users.alioth.debian.org
Sun Nov 2 11:09:46 UTC 2008


Author: kelmo-guest
Date: Sun Nov  2 11:09:46 2008
New Revision: 1281

URL: http://svn.debian.org/wsvn/pkg-wpa/?sc=1&rev=1281
Log:
New upstream release.
proposed copyright format.

Added:
    wpasupplicant/trunk/src/common/ieee802_11_common.c
      - copied unchanged from r1280, wpasupplicant/branches/upstream/current/src/common/ieee802_11_common.c
    wpasupplicant/trunk/src/common/ieee802_11_common.h
      - copied unchanged from r1280, wpasupplicant/branches/upstream/current/src/common/ieee802_11_common.h
Modified:
    wpasupplicant/trunk/debian/changelog
    wpasupplicant/trunk/src/common/ieee802_11_defs.h
    wpasupplicant/trunk/src/common/version.h
    wpasupplicant/trunk/src/drivers/driver_madwifi.c
    wpasupplicant/trunk/src/drivers/driver_nl80211.c
    wpasupplicant/trunk/src/eap_peer/eap_fast.c
    wpasupplicant/trunk/src/eap_peer/eap_fast_pac.c
    wpasupplicant/trunk/src/eap_peer/tncc.c
    wpasupplicant/trunk/src/eap_server/eap.c
    wpasupplicant/trunk/src/eap_server/eap.h
    wpasupplicant/trunk/src/eap_server/eap_fast.c
    wpasupplicant/trunk/src/eap_server/eap_gpsk.c
    wpasupplicant/trunk/src/eap_server/eap_i.h
    wpasupplicant/trunk/src/eapol_supp/eapol_supp_sm.c
    wpasupplicant/trunk/src/radius/radius_server.c
    wpasupplicant/trunk/src/radius/radius_server.h
    wpasupplicant/trunk/src/utils/os_unix.c
    wpasupplicant/trunk/wpa_supplicant/ChangeLog
    wpasupplicant/trunk/wpa_supplicant/Makefile
    wpasupplicant/trunk/wpa_supplicant/README-Windows.txt
    wpasupplicant/trunk/wpa_supplicant/ctrl_iface.c
    wpasupplicant/trunk/wpa_supplicant/mlme.c
    wpasupplicant/trunk/wpa_supplicant/vs2005/eapol_test/eapol_test.vcproj
    wpasupplicant/trunk/wpa_supplicant/vs2005/wpa_supplicant/wpa_supplicant.vcproj
    wpasupplicant/trunk/wpa_supplicant/vs2005/wpasvc/wpasvc.vcproj
    wpasupplicant/trunk/wpa_supplicant/wpa_cli.c
    wpasupplicant/trunk/wpa_supplicant/wpa_gui-qt4/networkconfig.cpp

Modified: wpasupplicant/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/debian/changelog?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/debian/changelog (original)
+++ wpasupplicant/trunk/debian/changelog Sun Nov  2 11:09:46 2008
@@ -1,6 +1,6 @@
-wpasupplicant (0.6.5~git.20081008.gb43f7c3-1) UNRELEASED; urgency=low
-
-  * New upstream git snapshot.
+wpasupplicant (0.6.5-1) experimental; urgency=low
+
+  * New upstream release.
   * Purge patches applied upstream.
   * Modify 20_wpa_gui_menu_exec_path.patch to use the new -t command line
     option and start wpa_gui in the system tray and avoid desktop startup
@@ -14,11 +14,11 @@
     06_wpa_gui_menu_exec_path.patch, it will possibly be a long term
     patch.
   * Update debian/copyright for new files, as well as better conformance with
-    prpposed copyright format.
+    proposed copyright format.
   * Cleanup wording of README.Debian paragraph which explains how to debug
     wpa_supplicant via logging.
 
- -- Kel Modderman <kel at otaku42.de>  Mon, 27 Oct 2008 21:18:53 +1000
+ -- Kel Modderman <kel at otaku42.de>  Sun, 02 Nov 2008 21:05:50 +1000
 
 wpasupplicant (0.6.4-3) experimental; urgency=low
 

Modified: wpasupplicant/trunk/src/common/ieee802_11_defs.h
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/src/common/ieee802_11_defs.h?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/src/common/ieee802_11_defs.h (original)
+++ wpasupplicant/trunk/src/common/ieee802_11_defs.h Sun Nov  2 11:09:46 2008
@@ -556,4 +556,26 @@
 	u8 mode;
 } STRUCT_PACKED;
 
+
+#define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs)
+				* 00:50:F2 */
+
+#define WME_OUI_TYPE 2
+#define WME_OUI_SUBTYPE_INFORMATION_ELEMENT 0
+#define WME_OUI_SUBTYPE_PARAMETER_ELEMENT 1
+#define WME_OUI_SUBTYPE_TSPEC_ELEMENT 2
+#define WME_VERSION 1
+
+#define WME_ACTION_CODE_SETUP_REQUEST 0
+#define WME_ACTION_CODE_SETUP_RESPONSE 1
+#define WME_ACTION_CODE_TEARDOWN 2
+
+#define WME_SETUP_RESPONSE_STATUS_ADMISSION_ACCEPTED 0
+#define WME_SETUP_RESPONSE_STATUS_INVALID_PARAMETERS 1
+#define WME_SETUP_RESPONSE_STATUS_REFUSED 3
+
+#define WME_TSPEC_DIRECTION_UPLINK 0
+#define WME_TSPEC_DIRECTION_DOWNLINK 1
+#define WME_TSPEC_DIRECTION_BI_DIRECTIONAL 3
+
 #endif /* IEEE802_11_DEFS_H */

Modified: wpasupplicant/trunk/src/common/version.h
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/src/common/version.h?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/src/common/version.h (original)
+++ wpasupplicant/trunk/src/common/version.h Sun Nov  2 11:09:46 2008
@@ -1,6 +1,6 @@
 #ifndef VERSION_H
 #define VERSION_H
 
-#define VERSION_STR "0.6.4"
+#define VERSION_STR "0.6.5"
 
 #endif /* VERSION_H */

Modified: wpasupplicant/trunk/src/drivers/driver_madwifi.c
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/src/drivers/driver_madwifi.c?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/src/drivers/driver_madwifi.c (original)
+++ wpasupplicant/trunk/src/drivers/driver_madwifi.c Sun Nov  2 11:09:46 2008
@@ -23,6 +23,11 @@
 #include "ieee802_11_defs.h"
 #include "wireless_copy.h"
 
+/*
+ * Avoid conflicts with wpa_supplicant definitions by undefining a definition.
+ */
+#undef WME_OUI_TYPE
+
 #include <include/compat.h>
 #include <net80211/ieee80211.h>
 #ifdef WME_NUM_AC
@@ -32,6 +37,7 @@
 #endif /* WME_NUM_AC */
 #include <net80211/ieee80211_crypto.h>
 #include <net80211/ieee80211_ioctl.h>
+
 
 #ifdef IEEE80211_IOCTL_SETWMMPARAMS
 /* Assume this is built against madwifi-ng */

Modified: wpasupplicant/trunk/src/drivers/driver_nl80211.c
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/src/drivers/driver_nl80211.c?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/src/drivers/driver_nl80211.c (original)
+++ wpasupplicant/trunk/src/drivers/driver_nl80211.c Sun Nov  2 11:09:46 2008
@@ -103,6 +103,8 @@
 
 static int finish_handler(struct nl_msg *msg, void *arg)
 {
+	int *ret = arg;
+	*ret = 0;
 	return NL_SKIP;
 }
 
@@ -133,7 +135,7 @@
 	err = 1;
 
 	nl_cb_err(cb, NL_CB_CUSTOM, error_handler, &err);
-	nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, finish_handler, NULL);
+	nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, finish_handler, &err);
 	nl_cb_set(cb, NL_CB_ACK, NL_CB_CUSTOM, ack_handler, &err);
 
 	if (valid_handler)

Modified: wpasupplicant/trunk/src/eap_peer/eap_fast.c
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/src/eap_peer/eap_fast.c?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/src/eap_peer/eap_fast.c (original)
+++ wpasupplicant/trunk/src/eap_peer/eap_fast.c Sun Nov  2 11:09:46 2008
@@ -1194,7 +1194,7 @@
 	}
 
 	if (data->current_pac == NULL && data->provisioning &&
-	    !data->anon_provisioning) {
+	    !data->anon_provisioning && !tlv.pac) {
 		/*
 		 * Need to request Tunnel PAC when using authenticated
 		 * provisioning.

Modified: wpasupplicant/trunk/src/eap_peer/eap_fast_pac.c
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/src/eap_peer/eap_fast_pac.c?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/src/eap_peer/eap_fast_pac.c (original)
+++ wpasupplicant/trunk/src/eap_peer/eap_fast_pac.c Sun Nov  2 11:09:46 2008
@@ -555,7 +555,12 @@
 				   "file '%s' for writing", pac_file);
 			return -1;
 		}
-		fwrite(buf, 1, len, f);
+		if (fwrite(buf, 1, len, f) != len) {
+			wpa_printf(MSG_INFO, "EAP-FAST: Failed to write all "
+				   "PACs into '%s'", pac_file);
+			fclose(f);
+			return -1;
+		}
 		os_free(buf);
 		fclose(f);
 	}

Modified: wpasupplicant/trunk/src/eap_peer/tncc.c
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/src/eap_peer/tncc.c?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/src/eap_peer/tncc.c (original)
+++ wpasupplicant/trunk/src/eap_peer/tncc.c Sun Nov  2 11:09:46 2008
@@ -1274,10 +1274,11 @@
 
 	/* MS-Packet-Info */
 	wpabuf_put_u8(buf, SSOH_MS_PACKET_INFO);
-	/* FIX: What is correct value here? IF-TNCCS-SOH v1.0 r8 claims this
-	 * field to be: Reserved(4 bits) r(1 bit) Vers(3 bits), but Windows XP
+	/* Note: IF-TNCCS-SOH v1.0 r8 claims this field to be:
+	 * Reserved(4 bits) r(1 bit) Vers(3 bits), but Windows XP
 	 * SP3 seems to be sending 0x11 for SSoH, i.e., r(request/response) bit
 	 * would not be in the specified location.
+	 * [MS-SOH] 4.0.2: Reserved(3 bits) r(1 bit) Vers(4 bits)
 	 */
 	wpabuf_put_u8(buf, 0x11); /* r=request, vers=1 */
 

Modified: wpasupplicant/trunk/src/eap_server/eap.c
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/src/eap_server/eap.c?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/src/eap_server/eap.c (original)
+++ wpasupplicant/trunk/src/eap_server/eap.c Sun Nov  2 11:09:46 2008
@@ -1151,8 +1151,19 @@
 				  conf->pac_opaque_encr_key, 16);
 		}
 	}
-	if (conf->eap_fast_a_id)
-		sm->eap_fast_a_id = os_strdup(conf->eap_fast_a_id);
+	if (conf->eap_fast_a_id) {
+		sm->eap_fast_a_id = os_malloc(conf->eap_fast_a_id_len);
+		if (sm->eap_fast_a_id) {
+			os_memcpy(sm->eap_fast_a_id, conf->eap_fast_a_id,
+				  conf->eap_fast_a_id_len);
+			sm->eap_fast_a_id_len = conf->eap_fast_a_id_len;
+		}
+	}
+	if (conf->eap_fast_a_id_info)
+		sm->eap_fast_a_id_info = os_strdup(conf->eap_fast_a_id_info);
+	sm->eap_fast_prov = conf->eap_fast_prov;
+	sm->pac_key_lifetime = conf->pac_key_lifetime;
+	sm->pac_key_refresh_time = conf->pac_key_refresh_time;
 	sm->eap_sim_aka_result_ind = conf->eap_sim_aka_result_ind;
 	sm->tnc = conf->tnc;
 
@@ -1183,6 +1194,7 @@
 	os_free(sm->identity);
 	os_free(sm->pac_opaque_encr_key);
 	os_free(sm->eap_fast_a_id);
+	os_free(sm->eap_fast_a_id_info);
 	wpabuf_free(sm->eap_if.aaaEapReqData);
 	wpabuf_free(sm->eap_if.aaaEapRespData);
 	os_free(sm->eap_if.aaaEapKeyData);

Modified: wpasupplicant/trunk/src/eap_server/eap.h
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/src/eap_server/eap.h?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/src/eap_server/eap.h (original)
+++ wpasupplicant/trunk/src/eap_server/eap.h Sun Nov  2 11:09:46 2008
@@ -95,7 +95,12 @@
 	Boolean backend_auth;
 	int eap_server;
 	u8 *pac_opaque_encr_key;
-	char *eap_fast_a_id;
+	u8 *eap_fast_a_id;
+	size_t eap_fast_a_id_len;
+	char *eap_fast_a_id_info;
+	int eap_fast_prov;
+	int pac_key_lifetime;
+	int pac_key_refresh_time;
 	int eap_sim_aka_result_ind;
 	int tnc;
 };

Modified: wpasupplicant/trunk/src/eap_server/eap_fast.c
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/src/eap_server/eap_fast.c?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/src/eap_server/eap_fast.c (original)
+++ wpasupplicant/trunk/src/eap_server/eap_fast.c Sun Nov  2 11:09:46 2008
@@ -33,17 +33,6 @@
 #define PAC_OPAQUE_TYPE_LIFETIME 2
 #define PAC_OPAQUE_TYPE_IDENTITY 3
 
-/* PAC-Key lifetime in seconds (hard limit) */
-#define PAC_KEY_LIFETIME (7 * 24 * 60 * 60)
-
-/*
- * PAC-Key refresh time in seconds (soft limit on remaining hard limit). The
- * server will generate a new PAC-Key when this number of seconds (or fewer)
- * of the lifetime.
- */
-#define PAC_KEY_REFRESH_TIME (1 * 24 * 60 * 60)
-
-
 struct eap_fast_data {
 	struct eap_ssl_data ssl;
 	enum {
@@ -67,7 +56,9 @@
 	int simck_idx;
 
 	u8 pac_opaque_encr[16];
-	char *srv_id;
+	u8 *srv_id;
+	size_t srv_id_len;
+	char *srv_id_info;
 
 	int anon_provisioning;
 	int send_new_pac; /* server triggered re-keying of Tunnel PAC */
@@ -76,6 +67,9 @@
 	size_t identity_len;
 	int eap_seq;
 	int tnc_started;
+
+	int pac_key_lifetime;
+	int pac_key_refresh_time;
 };
 
 
@@ -251,7 +245,7 @@
 		return 0;
 	}
 
-	if (lifetime - now.sec < PAC_KEY_REFRESH_TIME)
+	if (lifetime - now.sec < data->pac_key_refresh_time)
 		data->send_new_pac = 1;
 
 	eap_fast_derive_master_secret(pac_key, server_random, client_random,
@@ -453,11 +447,34 @@
 		eap_fast_reset(sm, data);
 		return NULL;
 	}
-	data->srv_id = os_strdup(sm->eap_fast_a_id);
+	data->srv_id = os_malloc(sm->eap_fast_a_id_len);
 	if (data->srv_id == NULL) {
 		eap_fast_reset(sm, data);
 		return NULL;
 	}
+	os_memcpy(data->srv_id, sm->eap_fast_a_id, sm->eap_fast_a_id_len);
+	data->srv_id_len = sm->eap_fast_a_id_len;
+
+	if (sm->eap_fast_a_id_info == NULL) {
+		wpa_printf(MSG_INFO, "EAP-FAST: No A-ID-Info configured");
+		eap_fast_reset(sm, data);
+		return NULL;
+	}
+	data->srv_id_info = os_strdup(sm->eap_fast_a_id_info);
+	if (data->srv_id_info == NULL) {
+		eap_fast_reset(sm, data);
+		return NULL;
+	}
+
+	/* PAC-Key lifetime in seconds (hard limit) */
+	data->pac_key_lifetime = sm->pac_key_lifetime;
+
+	/*
+	 * PAC-Key refresh time in seconds (soft limit on remaining hard
+	 * limit). The server will generate a new PAC-Key when this number of
+	 * seconds (or fewer) of the lifetime remains.
+	 */
+	data->pac_key_refresh_time = sm->pac_key_refresh_time;
 
 	return data;
 }
@@ -472,6 +489,7 @@
 		data->phase2_method->reset(sm, data->phase2_priv);
 	eap_server_tls_ssl_deinit(sm, &data->ssl);
 	os_free(data->srv_id);
+	os_free(data->srv_id_info);
 	os_free(data->key_block_p);
 	wpabuf_free(data->pending_phase2_resp);
 	os_free(data->identity);
@@ -483,10 +501,9 @@
 					    struct eap_fast_data *data, u8 id)
 {
 	struct wpabuf *req;
-	size_t srv_id_len = os_strlen(data->srv_id);
 
 	req = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_FAST,
-			    1 + sizeof(struct pac_tlv_hdr) + srv_id_len,
+			    1 + sizeof(struct pac_tlv_hdr) + data->srv_id_len,
 			    EAP_CODE_REQUEST, id);
 	if (req == NULL) {
 		wpa_printf(MSG_ERROR, "EAP-FAST: Failed to allocate memory for"
@@ -498,7 +515,7 @@
 	wpabuf_put_u8(req, EAP_TLS_FLAGS_START | data->fast_version);
 
 	/* RFC 4851, 4.1.1. Authority ID Data */
-	eap_fast_put_tlv(req, PAC_TYPE_A_ID, data->srv_id, srv_id_len);
+	eap_fast_put_tlv(req, PAC_TYPE_A_ID, data->srv_id, data->srv_id_len);
 
 	eap_fast_state(data, PHASE1);
 
@@ -646,7 +663,7 @@
 	u8 *pac_buf, *pac_opaque;
 	struct wpabuf *buf;
 	u8 *pos;
-	size_t buf_len, srv_id_len, pac_len;
+	size_t buf_len, srv_id_info_len, pac_len;
 	struct eap_tlv_hdr *pac_tlv;
 	struct pac_tlv_hdr *pac_info;
 	struct eap_tlv_result_tlv *result;
@@ -664,7 +681,7 @@
 	if (pac_buf == NULL)
 		return NULL;
 
-	srv_id_len = os_strlen(data->srv_id);
+	srv_id_info_len = os_strlen(data->srv_id_info);
 
 	pos = pac_buf;
 	*pos++ = PAC_OPAQUE_TYPE_KEY;
@@ -674,7 +691,7 @@
 
 	*pos++ = PAC_OPAQUE_TYPE_LIFETIME;
 	*pos++ = 4;
-	WPA_PUT_BE32(pos, now.sec + PAC_KEY_LIFETIME);
+	WPA_PUT_BE32(pos, now.sec + data->pac_key_lifetime);
 	pos += 4;
 
 	if (sm->identity) {
@@ -710,50 +727,12 @@
 	buf_len = sizeof(*pac_tlv) +
 		sizeof(struct pac_tlv_hdr) + EAP_FAST_PAC_KEY_LEN +
 		sizeof(struct pac_tlv_hdr) + pac_len +
-		2 * srv_id_len + 100 + sizeof(*result);
+		data->srv_id_len + srv_id_info_len + 100 + sizeof(*result);
 	buf = wpabuf_alloc(buf_len);
 	if (buf == NULL) {
 		os_free(pac_opaque);
 		return NULL;
 	}
-
-	/* PAC TLV */
-	wpa_printf(MSG_DEBUG, "EAP-FAST: Add PAC TLV");
-	pac_tlv = wpabuf_put(buf, sizeof(*pac_tlv));
-	pac_tlv->tlv_type = host_to_be16(EAP_TLV_TYPE_MANDATORY |
-					 EAP_TLV_PAC_TLV);
-
-	/* PAC-Key */
-	eap_fast_put_tlv(buf, PAC_TYPE_PAC_KEY, pac_key, EAP_FAST_PAC_KEY_LEN);
-
-	/* PAC-Opaque */
-	eap_fast_put_tlv(buf, PAC_TYPE_PAC_OPAQUE, pac_opaque, pac_len);
-	os_free(pac_opaque);
-
-	/* PAC-Info */
-	pac_info = wpabuf_put(buf, sizeof(*pac_info));
-	pac_info->type = host_to_be16(PAC_TYPE_PAC_INFO);
-
-	/* PAC-Lifetime (inside PAC-Info) */
-	eap_fast_put_tlv_hdr(buf, PAC_TYPE_CRED_LIFETIME, 4);
-	wpabuf_put_be32(buf, now.sec + PAC_KEY_LIFETIME);
-
-	/* A-ID (inside PAC-Info) */
-	eap_fast_put_tlv(buf, PAC_TYPE_A_ID, data->srv_id, srv_id_len);
-	
-	/* Note: headers may be misaligned after A-ID */
-
-	/* A-ID-Info (inside PAC-Info) */
-	eap_fast_put_tlv(buf, PAC_TYPE_A_ID_INFO, data->srv_id, srv_id_len);
-
-	/* PAC-Type (inside PAC-Info) */
-	eap_fast_put_tlv_hdr(buf, PAC_TYPE_PAC_TYPE, 2);
-	wpabuf_put_be16(buf, PAC_TYPE_TUNNEL_PAC);
-
-	/* Update PAC-Info and PAC TLV Length fields */
-	pos = wpabuf_put(buf, 0);
-	pac_info->len = host_to_be16(pos - (u8 *) (pac_info + 1));
-	pac_tlv->length = host_to_be16(pos - (u8 *) (pac_tlv + 1));
 
 	/* Result TLV */
 	wpa_printf(MSG_DEBUG, "EAP-FAST: Add Result TLV (status=SUCCESS)");
@@ -762,6 +741,45 @@
 		     EAP_TLV_TYPE_MANDATORY | EAP_TLV_RESULT_TLV);
 	WPA_PUT_BE16((u8 *) &result->length, 2);
 	WPA_PUT_BE16((u8 *) &result->status, EAP_TLV_RESULT_SUCCESS);
+
+	/* PAC TLV */
+	wpa_printf(MSG_DEBUG, "EAP-FAST: Add PAC TLV");
+	pac_tlv = wpabuf_put(buf, sizeof(*pac_tlv));
+	pac_tlv->tlv_type = host_to_be16(EAP_TLV_TYPE_MANDATORY |
+					 EAP_TLV_PAC_TLV);
+
+	/* PAC-Key */
+	eap_fast_put_tlv(buf, PAC_TYPE_PAC_KEY, pac_key, EAP_FAST_PAC_KEY_LEN);
+
+	/* PAC-Opaque */
+	eap_fast_put_tlv(buf, PAC_TYPE_PAC_OPAQUE, pac_opaque, pac_len);
+	os_free(pac_opaque);
+
+	/* PAC-Info */
+	pac_info = wpabuf_put(buf, sizeof(*pac_info));
+	pac_info->type = host_to_be16(PAC_TYPE_PAC_INFO);
+
+	/* PAC-Lifetime (inside PAC-Info) */
+	eap_fast_put_tlv_hdr(buf, PAC_TYPE_CRED_LIFETIME, 4);
+	wpabuf_put_be32(buf, now.sec + data->pac_key_lifetime);
+
+	/* A-ID (inside PAC-Info) */
+	eap_fast_put_tlv(buf, PAC_TYPE_A_ID, data->srv_id, data->srv_id_len);
+	
+	/* Note: headers may be misaligned after A-ID */
+
+	/* A-ID-Info (inside PAC-Info) */
+	eap_fast_put_tlv(buf, PAC_TYPE_A_ID_INFO, data->srv_id_info,
+			 srv_id_info_len);
+
+	/* PAC-Type (inside PAC-Info) */
+	eap_fast_put_tlv_hdr(buf, PAC_TYPE_PAC_TYPE, 2);
+	wpabuf_put_be16(buf, PAC_TYPE_TUNNEL_PAC);
+
+	/* Update PAC-Info and PAC TLV Length fields */
+	pos = wpabuf_put(buf, 0);
+	pac_info->len = host_to_be16(pos - (u8 *) (pac_info + 1));
+	pac_tlv->length = host_to_be16(pos - (u8 *) (pac_tlv + 1));
 
 	return buf;
 }
@@ -1012,20 +1030,21 @@
 	hdr = (struct eap_hdr *) in_data;
 	if (in_len < (int) sizeof(*hdr)) {
 		wpa_printf(MSG_INFO, "EAP-FAST: Too short Phase 2 "
-			   "EAP frame (len=%d)", in_len);
+			   "EAP frame (len=%lu)", (unsigned long) in_len);
 		eap_fast_req_failure(sm, data);
 		return;
 	}
 	len = be_to_host16(hdr->length);
 	if (len > in_len) {
 		wpa_printf(MSG_INFO, "EAP-FAST: Length mismatch in "
-			   "Phase 2 EAP frame (len=%d hdr->length=%d)",
-			   in_len, len);
+			   "Phase 2 EAP frame (len=%lu hdr->length=%lu)",
+			   (unsigned long) in_len, (unsigned long) len);
 		eap_fast_req_failure(sm, data);
 		return;
 	}
 	wpa_printf(MSG_DEBUG, "EAP-FAST: Received Phase 2: code=%d "
-		   "identifier=%d length=%d", hdr->code, hdr->identifier, len);
+		   "identifier=%d length=%lu", hdr->code, hdr->identifier,
+		   (unsigned long) len);
 	switch (hdr->code) {
 	case EAP_CODE_RESPONSE:
 		eap_fast_process_phase2_response(sm, data, (u8 *) hdr, len);
@@ -1239,6 +1258,28 @@
 		if (data->final_result) {
 			wpa_printf(MSG_DEBUG, "EAP-FAST: Authentication "
 				   "completed successfully");
+		}
+
+		if (data->anon_provisioning &&
+		    sm->eap_fast_prov != ANON_PROV &&
+		    sm->eap_fast_prov != BOTH_PROV) {
+			wpa_printf(MSG_DEBUG, "EAP-FAST: Client is trying to "
+				   "use unauthenticated provisioning which is "
+				   "disabled");
+			eap_fast_state(data, FAILURE);
+			return;
+		}
+
+		if (sm->eap_fast_prov != AUTH_PROV &&
+		    sm->eap_fast_prov != BOTH_PROV &&
+		    tlv.request_action == EAP_TLV_ACTION_PROCESS_TLV &&
+		    eap_fast_pac_type(tlv.pac, tlv.pac_len,
+				      PAC_TYPE_TUNNEL_PAC)) {
+			wpa_printf(MSG_DEBUG, "EAP-FAST: Client is trying to "
+				   "use authenticated provisioning which is "
+				   "disabled");
+			eap_fast_state(data, FAILURE);
+			return;
 		}
 
 		if (data->anon_provisioning ||

Modified: wpasupplicant/trunk/src/eap_server/eap_gpsk.c
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/src/eap_server/eap_gpsk.c?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/src/eap_server/eap_gpsk.c (original)
+++ wpasupplicant/trunk/src/eap_server/eap_gpsk.c Sun Nov  2 11:09:46 2008
@@ -433,7 +433,9 @@
 	miclen = eap_gpsk_mic_len(data->vendor, data->specifier);
 	if (end - pos < (int) miclen) {
 		wpa_printf(MSG_DEBUG, "EAP-GPSK: Message too short for MIC "
-			   "(left=%d miclen=%d)", end - pos, miclen);
+			   "(left=%lu miclen=%lu)",
+			   (unsigned long) (end - pos),
+			   (unsigned long) miclen);
 		eap_gpsk_state(data, FAILURE);
 		return;
 	}
@@ -454,8 +456,9 @@
 	pos += miclen;
 
 	if (pos != end) {
-		wpa_printf(MSG_DEBUG, "EAP-GPSK: Ignored %d bytes of extra "
-			   "data in the end of GPSK-2", end - pos);
+		wpa_printf(MSG_DEBUG, "EAP-GPSK: Ignored %lu bytes of extra "
+			   "data in the end of GPSK-2",
+			   (unsigned long) (end - pos));
 	}
 
 	eap_gpsk_state(data, GPSK_3);
@@ -499,7 +502,9 @@
 	miclen = eap_gpsk_mic_len(data->vendor, data->specifier);
 	if (end - pos < (int) miclen) {
 		wpa_printf(MSG_DEBUG, "EAP-GPSK: Message too short for MIC "
-			   "(left=%d miclen=%d)", end - pos, miclen);
+			   "(left=%lu miclen=%lu)",
+			   (unsigned long) (end - pos),
+			   (unsigned long) miclen);
 		eap_gpsk_state(data, FAILURE);
 		return;
 	}
@@ -520,8 +525,9 @@
 	pos += miclen;
 
 	if (pos != end) {
-		wpa_printf(MSG_DEBUG, "EAP-GPSK: Ignored %d bytes of extra "
-			   "data in the end of GPSK-4", end - pos);
+		wpa_printf(MSG_DEBUG, "EAP-GPSK: Ignored %lu bytes of extra "
+			   "data in the end of GPSK-4",
+			   (unsigned long) (end - pos));
 	}
 
 	eap_gpsk_state(data, SUCCESS);

Modified: wpasupplicant/trunk/src/eap_server/eap_i.h
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/src/eap_server/eap_i.h?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/src/eap_server/eap_i.h (original)
+++ wpasupplicant/trunk/src/eap_server/eap_i.h Sun Nov  2 11:09:46 2008
@@ -171,7 +171,14 @@
 	u8 *peer_challenge;
 
 	u8 *pac_opaque_encr_key;
-	char *eap_fast_a_id;
+	u8 *eap_fast_a_id;
+	size_t eap_fast_a_id_len;
+	char *eap_fast_a_id_info;
+	enum {
+		NO_PROV, ANON_PROV, AUTH_PROV, BOTH_PROV
+	} eap_fast_prov;
+	int pac_key_lifetime;
+	int pac_key_refresh_time;
 	int eap_sim_aka_result_ind;
 	int tnc;
 };

Modified: wpasupplicant/trunk/src/eapol_supp/eapol_supp_sm.c
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/src/eapol_supp/eapol_supp_sm.c?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/src/eapol_supp/eapol_supp_sm.c (original)
+++ wpasupplicant/trunk/src/eapol_supp/eapol_supp_sm.c Sun Nov  2 11:09:46 2008
@@ -1422,8 +1422,10 @@
 {
 	if (sm == NULL)
 		return;
+	wpa_printf(MSG_DEBUG, "EAPOL: PMKSA caching was used - skip EAPOL");
 	sm->SUPP_PAE_state = SUPP_PAE_AUTHENTICATED;
 	sm->suppPortStatus = Authorized;
+	sm->portValid = TRUE;
 	eap_notify_success(sm->eap);
 	eapol_sm_step(sm);
 }

Modified: wpasupplicant/trunk/src/radius/radius_server.c
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/src/radius/radius_server.c?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/src/radius/radius_server.c (original)
+++ wpasupplicant/trunk/src/radius/radius_server.c Sun Nov  2 11:09:46 2008
@@ -85,7 +85,12 @@
 	void *eap_sim_db_priv;
 	void *ssl_ctx;
 	u8 *pac_opaque_encr_key;
-	char *eap_fast_a_id;
+	u8 *eap_fast_a_id;
+	size_t eap_fast_a_id_len;
+	char *eap_fast_a_id_info;
+	int eap_fast_prov;
+	int pac_key_lifetime;
+	int pac_key_refresh_time;
 	int eap_sim_aka_result_ind;
 	int tnc;
 	int ipv6;
@@ -311,6 +316,11 @@
 	eap_conf.eap_server = 1;
 	eap_conf.pac_opaque_encr_key = data->pac_opaque_encr_key;
 	eap_conf.eap_fast_a_id = data->eap_fast_a_id;
+	eap_conf.eap_fast_a_id_len = data->eap_fast_a_id_len;
+	eap_conf.eap_fast_a_id_info = data->eap_fast_a_id_info;
+	eap_conf.eap_fast_prov = data->eap_fast_prov;
+	eap_conf.pac_key_lifetime = data->pac_key_lifetime;
+	eap_conf.pac_key_refresh_time = data->pac_key_refresh_time;
 	eap_conf.eap_sim_aka_result_ind = data->eap_sim_aka_result_ind;
 	eap_conf.tnc = data->tnc;
 	sess->eap = eap_server_sm_init(sess, &radius_server_eapol_cb,
@@ -1014,8 +1024,19 @@
 		os_memcpy(data->pac_opaque_encr_key, conf->pac_opaque_encr_key,
 			  16);
 	}
-	if (conf->eap_fast_a_id)
-		data->eap_fast_a_id = os_strdup(conf->eap_fast_a_id);
+	if (conf->eap_fast_a_id) {
+		data->eap_fast_a_id = os_malloc(conf->eap_fast_a_id_len);
+		if (data->eap_fast_a_id) {
+			os_memcpy(data->eap_fast_a_id, conf->eap_fast_a_id,
+				  conf->eap_fast_a_id_len);
+			data->eap_fast_a_id_len = conf->eap_fast_a_id_len;
+		}
+	}
+	if (conf->eap_fast_a_id_info)
+		data->eap_fast_a_id_info = os_strdup(conf->eap_fast_a_id_info);
+	data->eap_fast_prov = conf->eap_fast_prov;
+	data->pac_key_lifetime = conf->pac_key_lifetime;
+	data->pac_key_refresh_time = conf->pac_key_refresh_time;
 	data->get_eap_user = conf->get_eap_user;
 	data->eap_sim_aka_result_ind = conf->eap_sim_aka_result_ind;
 	data->tnc = conf->tnc;
@@ -1065,6 +1086,7 @@
 
 	os_free(data->pac_opaque_encr_key);
 	os_free(data->eap_fast_a_id);
+	os_free(data->eap_fast_a_id_info);
 	os_free(data);
 }
 

Modified: wpasupplicant/trunk/src/radius/radius_server.h
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/src/radius/radius_server.h?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/src/radius/radius_server.h (original)
+++ wpasupplicant/trunk/src/radius/radius_server.h Sun Nov  2 11:09:46 2008
@@ -25,7 +25,12 @@
 	void *eap_sim_db_priv;
 	void *ssl_ctx;
 	u8 *pac_opaque_encr_key;
-	char *eap_fast_a_id;
+	u8 *eap_fast_a_id;
+	size_t eap_fast_a_id_len;
+	char *eap_fast_a_id_info;
+	int eap_fast_prov;
+	int pac_key_lifetime;
+	int pac_key_refresh_time;
 	int eap_sim_aka_result_ind;
 	int tnc;
 	int ipv6;

Modified: wpasupplicant/trunk/src/utils/os_unix.c
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/src/utils/os_unix.c?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/src/utils/os_unix.c (original)
+++ wpasupplicant/trunk/src/utils/os_unix.c Sun Nov  2 11:09:46 2008
@@ -220,7 +220,12 @@
 		return NULL;
 	}
 
-	fread(buf, 1, *len, f);
+	if (fread(buf, 1, *len, f) != *len) {
+		fclose(f);
+		free(buf);
+		return NULL;
+	}
+
 	fclose(f);
 
 	return buf;

Modified: wpasupplicant/trunk/wpa_supplicant/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/wpa_supplicant/ChangeLog?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/wpa_supplicant/ChangeLog (original)
+++ wpasupplicant/trunk/wpa_supplicant/ChangeLog Sun Nov  2 11:09:46 2008
@@ -1,6 +1,6 @@
 ChangeLog for wpa_supplicant
 
-????-??-?? - v0.6.5
+2008-11-01 - v0.6.5
 	* added support for SHA-256 as X.509 certificate digest when using the
 	  internal X.509/TLSv1 implementation
 	* updated management frame protection to use IEEE 802.11w/D6.0

Modified: wpasupplicant/trunk/wpa_supplicant/Makefile
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/wpa_supplicant/Makefile?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/wpa_supplicant/Makefile (original)
+++ wpasupplicant/trunk/wpa_supplicant/Makefile Sun Nov  2 11:09:46 2008
@@ -925,7 +925,7 @@
 endif
 
 ifdef CONFIG_CLIENT_MLME
-OBJS += mlme.o
+OBJS += mlme.o ../src/common/ieee802_11_common.o
 CFLAGS += -DCONFIG_CLIENT_MLME
 endif
 

Modified: wpasupplicant/trunk/wpa_supplicant/README-Windows.txt
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/wpa_supplicant/README-Windows.txt?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/wpa_supplicant/README-Windows.txt (original)
+++ wpasupplicant/trunk/wpa_supplicant/README-Windows.txt Sun Nov  2 11:09:46 2008
@@ -67,10 +67,11 @@
 can also be used by creating a project that includes the files and
 defines mentioned in nmake.mak. Example VS2005 solution and project
 files are included in vs2005 subdirectory. This can be used as a
-starting point for building the programs with VS2005 IDE.
+starting point for building the programs with VS2005 IDE. Visual Studio
+2008 Express Edition is also able to use these project files.
 
 WinPcap development package is needed for the build and this can be
-downloaded from http://www.winpcap.org/install/bin/WpdPack_3_1.zip. The
+downloaded from http://www.winpcap.org/install/bin/WpdPack_4_0_2.zip. The
 default nmake.mak expects this to be unpacked into C:\dev\WpdPack so
 that Include and Lib directories are in this directory. The files can be
 stored elsewhere as long as the WINPCAPDIR in nmake.mak is updated to
@@ -79,10 +80,10 @@
 properties as additional include/library directories.
 
 OpenSSL source package can be downloaded from
-http://www.openssl.org/source/openssl-0.9.8b.tar.gz and built and
+http://www.openssl.org/source/openssl-0.9.8i.tar.gz and built and
 installed following instructions in INSTALL.W32. Note that if EAP-FAST
 support will be included in the wpa_supplicant, OpenSSL needs to be
-patched to# support it openssl-tls-extensions.patch. The example
+patched to# support it openssl-0.9.8i-tls-extensions.patch. The example
 nmake.mak file expects OpenSSL to be installed into C:\dev\openssl, but
 this directory can be modified by changing OPENSSLDIR variable in
 nmake.mak.

Modified: wpasupplicant/trunk/wpa_supplicant/ctrl_iface.c
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/wpa_supplicant/ctrl_iface.c?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/wpa_supplicant/ctrl_iface.c (original)
+++ wpasupplicant/trunk/wpa_supplicant/ctrl_iface.c Sun Nov  2 11:09:46 2008
@@ -1250,6 +1250,10 @@
 	char *pos, *end;
 	const u8 *ie, *ie2;
 
+	if (wpa_s->scan_res == NULL &&
+	    wpa_supplicant_get_scan_results(wpa_s) < 0)
+		return 0;
+
 	results = wpa_s->scan_res;
 	if (results == NULL)
 		return 0;
@@ -1269,32 +1273,32 @@
 	bss = results->res[i];
 	pos = buf;
 	end = buf + buflen;
-	ret = snprintf(pos, end - pos,
-		       "bssid=" MACSTR "\n"
-		       "freq=%d\n"
-		       "beacon_int=%d\n"
-		       "capabilities=0x%04x\n"
-		       "qual=%d\n"
-		       "noise=%d\n"
-		       "level=%d\n"
-		       "tsf=%016llu\n"
-		       "ie=",
-		       MAC2STR(bss->bssid), bss->freq, bss->beacon_int,
-		       bss->caps, bss->qual, bss->noise, bss->level,
-		       (unsigned long long) bss->tsf);
+	ret = os_snprintf(pos, end - pos,
+			  "bssid=" MACSTR "\n"
+			  "freq=%d\n"
+			  "beacon_int=%d\n"
+			  "capabilities=0x%04x\n"
+			  "qual=%d\n"
+			  "noise=%d\n"
+			  "level=%d\n"
+			  "tsf=%016llu\n"
+			  "ie=",
+			  MAC2STR(bss->bssid), bss->freq, bss->beacon_int,
+			  bss->caps, bss->qual, bss->noise, bss->level,
+			  (unsigned long long) bss->tsf);
 	if (ret < 0 || ret >= end - pos)
 		return pos - buf;
 	pos += ret;
 
 	ie = (const u8 *) (bss + 1);
 	for (i = 0; i < bss->ie_len; i++) {
-		ret = snprintf(pos, end - pos, "%02x", *ie++);
-		if (ret < 0 || ret >= end - pos)
-			return pos - buf;
-		pos += ret;
-	}
-
-	ret = snprintf(pos, end - pos, "\n");
+		ret = os_snprintf(pos, end - pos, "%02x", *ie++);
+		if (ret < 0 || ret >= end - pos)
+			return pos - buf;
+		pos += ret;
+	}
+
+	ret = os_snprintf(pos, end - pos, "\n");
 	if (ret < 0 || ret >= end - pos)
 		return pos - buf;
 	pos += ret;
@@ -1323,7 +1327,7 @@
 		pos += ret;
 	}
 
-	ret = snprintf(pos, end - pos, "\n");
+	ret = os_snprintf(pos, end - pos, "\n");
 	if (ret < 0 || ret >= end - pos)
 		return pos - buf;
 	pos += ret;

Modified: wpasupplicant/trunk/wpa_supplicant/mlme.c
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/wpa_supplicant/mlme.c?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/wpa_supplicant/mlme.c (original)
+++ wpasupplicant/trunk/wpa_supplicant/mlme.c Sun Nov  2 11:09:46 2008
@@ -23,6 +23,7 @@
 #include "wpa.h"
 #include "drivers/driver.h"
 #include "ieee802_11_defs.h"
+#include "ieee802_11_common.h"
 #include "mlme.h"
 
 
@@ -93,169 +94,6 @@
 static int ieee80211_sta_wep_configured(struct wpa_supplicant *wpa_s);
 static void ieee80211_sta_timer(void *eloop_ctx, void *timeout_ctx);
 static void ieee80211_sta_scan_timer(void *eloop_ctx, void *timeout_ctx);
-
-
-/* Parsed Information Elements */
-struct ieee802_11_elems {
-	u8 *ssid;
-	u8 ssid_len;
-	u8 *supp_rates;
-	u8 supp_rates_len;
-	u8 *fh_params;
-	u8 fh_params_len;
-	u8 *ds_params;
-	u8 ds_params_len;
-	u8 *cf_params;
-	u8 cf_params_len;
-	u8 *tim;
-	u8 tim_len;
-	u8 *ibss_params;
-	u8 ibss_params_len;
-	u8 *challenge;
-	u8 challenge_len;
-	u8 *wpa;
-	u8 wpa_len;
-	u8 *rsn;
-	u8 rsn_len;
-	u8 *erp_info;
-	u8 erp_info_len;
-	u8 *ext_supp_rates;
-	u8 ext_supp_rates_len;
-	u8 *wmm_info;
-	u8 wmm_info_len;
-	u8 *wmm_param;
-	u8 wmm_param_len;
-	u8 *mdie;
-	u8 mdie_len;
-	u8 *ftie;
-	u8 ftie_len;
-	u8 *assoc_comeback;
-	u8 assoc_comeback_len;
-};
-
-typedef enum { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 } ParseRes;
-
-
-static ParseRes ieee802_11_parse_elems(u8 *start, size_t len,
-				       struct ieee802_11_elems *elems)
-{
-	size_t left = len;
-	u8 *pos = start;
-	int unknown = 0;
-
-	os_memset(elems, 0, sizeof(*elems));
-
-	while (left >= 2) {
-		u8 id, elen;
-
-		id = *pos++;
-		elen = *pos++;
-		left -= 2;
-
-		if (elen > left) {
-#if 0
-			wpa_printf(MSG_MSGDUMP, "MLME: IEEE 802.11 element "
-				   "parse failed (id=%d elen=%d left=%d)",
-				   id, elen, left);
-#endif
-			return ParseFailed;
-		}
-
-		switch (id) {
-		case WLAN_EID_SSID:
-			elems->ssid = pos;
-			elems->ssid_len = elen;
-			break;
-		case WLAN_EID_SUPP_RATES:
-			elems->supp_rates = pos;
-			elems->supp_rates_len = elen;
-			break;
-		case WLAN_EID_FH_PARAMS:
-			elems->fh_params = pos;
-			elems->fh_params_len = elen;
-			break;
-		case WLAN_EID_DS_PARAMS:
-			elems->ds_params = pos;
-			elems->ds_params_len = elen;
-			break;
-		case WLAN_EID_CF_PARAMS:
-			elems->cf_params = pos;
-			elems->cf_params_len = elen;
-			break;
-		case WLAN_EID_TIM:
-			elems->tim = pos;
-			elems->tim_len = elen;
-			break;
-		case WLAN_EID_IBSS_PARAMS:
-			elems->ibss_params = pos;
-			elems->ibss_params_len = elen;
-			break;
-		case WLAN_EID_CHALLENGE:
-			elems->challenge = pos;
-			elems->challenge_len = elen;
-			break;
-		case WLAN_EID_VENDOR_SPECIFIC:
-			if (elen >= 4 && pos[0] == 0x00 && pos[1] == 0x50 &&
-			    pos[2] == 0xf2) {
-				/* Microsoft OUI (00:50:F2) */
-				if (pos[3] == 1) {
-					/* OUI Type 1 - WPA IE */
-					elems->wpa = pos;
-					elems->wpa_len = elen;
-				} else if (elen >= 5 && pos[3] == 2) {
-					if (pos[4] == 0) {
-						elems->wmm_info = pos;
-						elems->wmm_info_len = elen;
-					} else if (pos[4] == 1) {
-						elems->wmm_param = pos;
-						elems->wmm_param_len = elen;
-					}
-				}
-			}
-			break;
-		case WLAN_EID_RSN:
-			elems->rsn = pos;
-			elems->rsn_len = elen;
-			break;
-		case WLAN_EID_ERP_INFO:
-			elems->erp_info = pos;
-			elems->erp_info_len = elen;
-			break;
-		case WLAN_EID_EXT_SUPP_RATES:
-			elems->ext_supp_rates = pos;
-			elems->ext_supp_rates_len = elen;
-			break;
-		case WLAN_EID_MOBILITY_DOMAIN:
-			elems->mdie = pos;
-			elems->mdie_len = elen;
-			break;
-		case WLAN_EID_FAST_BSS_TRANSITION:
-			elems->ftie = pos;
-			elems->ftie_len = elen;
-			break;
-		case WLAN_EID_ASSOC_COMEBACK_TIME:
-			elems->assoc_comeback = pos;
-			elems->assoc_comeback_len = elen;
-			break;
-		default:
-#if 0
-			wpa_printf(MSG_MSGDUMP "MLME: IEEE 802.11 element "
-				   "parse ignored unknown element (id=%d "
-				   "elen=%d)", id, elen);
-#endif
-			unknown++;
-			break;
-		}
-
-		left -= elen;
-		pos += elen;
-	}
-
-	if (left)
-		return ParseFailed;
-
-	return unknown ? ParseUnknown : ParseOK;
-}
 
 
 static int ieee80211_sta_set_channel(struct wpa_supplicant *wpa_s,
@@ -906,7 +744,7 @@
 
 	wpa_printf(MSG_DEBUG, "MLME: replying to auth challenge");
 	pos = mgmt->u.auth.variable;
-	if (ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems)
+	if (ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems, 0)
 	    == ParseFailed) {
 		wpa_printf(MSG_DEBUG, "MLME: failed to parse Auth(challenge)");
 		return;
@@ -1238,7 +1076,7 @@
 		   capab_info, status_code, aid);
 
 	pos = mgmt->u.assoc_resp.variable;
-	if (ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems)
+	if (ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems, 0)
 	    == ParseFailed) {
 		wpa_printf(MSG_DEBUG, "MLME: failed to parse AssocResp");
 		return;
@@ -1336,10 +1174,9 @@
 #if 0 /* FIX? */
 	sta->assoc_ap = 1;
 
-	if (elems.wmm_param && wpa_s->mlme.wmm_enabled) {
+	if (elems.wme && wpa_s->mlme.wmm_enabled) {
 		sta->flags |= WLAN_STA_WME;
-		ieee80211_sta_wmm_params(wpa_s, elems.wmm_param,
-					 elems.wmm_param_len);
+		ieee80211_sta_wmm_params(wpa_s, elems.wme, elems.wme_len);
 	}
 #endif
 
@@ -1492,7 +1329,7 @@
 
 	ie_pos = mgmt->u.beacon.variable;
 	ie_len = len - baselen;
-	if (ieee802_11_parse_elems(ie_pos, ie_len, &elems) == ParseFailed)
+	if (ieee802_11_parse_elems(ie_pos, ie_len, &elems, 0) == ParseFailed)
 		invalid = 1;
 
 #if 0 /* FIX */
@@ -1616,52 +1453,52 @@
 		bss->supp_rates_len += clen;
 	}
 
-	if (elems.wpa &&
-	    (bss->wpa_ie == NULL || bss->wpa_ie_len != elems.wpa_len ||
-	     os_memcmp(bss->wpa_ie, elems.wpa, elems.wpa_len))) {
+	if (elems.wpa_ie &&
+	    (bss->wpa_ie == NULL || bss->wpa_ie_len != elems.wpa_ie_len ||
+	     os_memcmp(bss->wpa_ie, elems.wpa_ie, elems.wpa_ie_len))) {
 		os_free(bss->wpa_ie);
-		bss->wpa_ie = os_malloc(elems.wpa_len + 2);
+		bss->wpa_ie = os_malloc(elems.wpa_ie_len + 2);
 		if (bss->wpa_ie) {
-			os_memcpy(bss->wpa_ie, elems.wpa - 2,
-				  elems.wpa_len + 2);
-			bss->wpa_ie_len = elems.wpa_len + 2;
+			os_memcpy(bss->wpa_ie, elems.wpa_ie - 2,
+				  elems.wpa_ie_len + 2);
+			bss->wpa_ie_len = elems.wpa_ie_len + 2;
 		} else
 			bss->wpa_ie_len = 0;
-	} else if (!elems.wpa && bss->wpa_ie) {
+	} else if (!elems.wpa_ie && bss->wpa_ie) {
 		os_free(bss->wpa_ie);
 		bss->wpa_ie = NULL;
 		bss->wpa_ie_len = 0;
 	}
 
-	if (elems.rsn &&
-	    (bss->rsn_ie == NULL || bss->rsn_ie_len != elems.rsn_len ||
-	     os_memcmp(bss->rsn_ie, elems.rsn, elems.rsn_len))) {
+	if (elems.rsn_ie &&
+	    (bss->rsn_ie == NULL || bss->rsn_ie_len != elems.rsn_ie_len ||
+	     os_memcmp(bss->rsn_ie, elems.rsn_ie, elems.rsn_ie_len))) {
 		os_free(bss->rsn_ie);
-		bss->rsn_ie = os_malloc(elems.rsn_len + 2);
+		bss->rsn_ie = os_malloc(elems.rsn_ie_len + 2);
 		if (bss->rsn_ie) {
-			os_memcpy(bss->rsn_ie, elems.rsn - 2,
-				  elems.rsn_len + 2);
-			bss->rsn_ie_len = elems.rsn_len + 2;
+			os_memcpy(bss->rsn_ie, elems.rsn_ie - 2,
+				  elems.rsn_ie_len + 2);
+			bss->rsn_ie_len = elems.rsn_ie_len + 2;
 		} else
 			bss->rsn_ie_len = 0;
-	} else if (!elems.rsn && bss->rsn_ie) {
+	} else if (!elems.rsn_ie && bss->rsn_ie) {
 		os_free(bss->rsn_ie);
 		bss->rsn_ie = NULL;
 		bss->rsn_ie_len = 0;
 	}
 
-	if (elems.wmm_param &&
-	    (bss->wmm_ie == NULL || bss->wmm_ie_len != elems.wmm_param_len ||
-	     os_memcmp(bss->wmm_ie, elems.wmm_param, elems.wmm_param_len))) {
+	if (elems.wme &&
+	    (bss->wmm_ie == NULL || bss->wmm_ie_len != elems.wme_len ||
+	     os_memcmp(bss->wmm_ie, elems.wme, elems.wme_len))) {
 		os_free(bss->wmm_ie);
-		bss->wmm_ie = os_malloc(elems.wmm_param_len + 2);
+		bss->wmm_ie = os_malloc(elems.wme_len + 2);
 		if (bss->wmm_ie) {
-			os_memcpy(bss->wmm_ie, elems.wmm_param - 2,
-				  elems.wmm_param_len + 2);
-			bss->wmm_ie_len = elems.wmm_param_len + 2;
+			os_memcpy(bss->wmm_ie, elems.wme - 2,
+				  elems.wme_len + 2);
+			bss->wmm_ie_len = elems.wme_len + 2;
 		} else
 			bss->wmm_ie_len = 0;
-	} else if (!elems.wmm_param && bss->wmm_ie) {
+	} else if (!elems.wme && bss->wmm_ie) {
 		os_free(bss->wmm_ie);
 		bss->wmm_ie = NULL;
 		bss->wmm_ie_len = 0;
@@ -1739,7 +1576,7 @@
 		return;
 
 	if (ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen,
-				   &elems) == ParseFailed)
+				   &elems, 0) == ParseFailed)
 		return;
 
 	use_protection = 0;
@@ -1757,9 +1594,9 @@
 		wpa_s->mlme.cts_protect_erp_frames = use_protection;
 	}
 
-	if (elems.wmm_param && wpa_s->mlme.wmm_enabled) {
-		ieee80211_sta_wmm_params(wpa_s, elems.wmm_param,
-					 elems.wmm_param_len);
+	if (elems.wme && wpa_s->mlme.wmm_enabled) {
+		ieee80211_sta_wmm_params(wpa_s, elems.wme,
+					 elems.wme_len);
 	}
 }
 

Modified: wpasupplicant/trunk/wpa_supplicant/vs2005/eapol_test/eapol_test.vcproj
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/wpa_supplicant/vs2005/eapol_test/eapol_test.vcproj?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/wpa_supplicant/vs2005/eapol_test/eapol_test.vcproj (original)
+++ wpasupplicant/trunk/wpa_supplicant/vs2005/eapol_test/eapol_test.vcproj Sun Nov  2 11:09:46 2008
@@ -263,6 +263,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\eap_common\eap_peap_common.c"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\eap_peer\eap_sim.c"
 				>
 			</File>
@@ -279,10 +283,6 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\..\src\eap_peer\eap_tlv.c"
-				>
-			</File>
-			<File
 				RelativePath="..\..\..\src\eap_peer\eap_tnc.c"
 				>
 			</File>
@@ -320,6 +320,10 @@
 			</File>
 			<File
 				RelativePath="..\..\..\src\crypto\ms_funcs.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\eap_peer\mschapv2.c"
 				>
 			</File>
 			<File

Modified: wpasupplicant/trunk/wpa_supplicant/vs2005/wpa_supplicant/wpa_supplicant.vcproj
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/wpa_supplicant/vs2005/wpa_supplicant/wpa_supplicant.vcproj?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/wpa_supplicant/vs2005/wpa_supplicant/wpa_supplicant.vcproj (original)
+++ wpasupplicant/trunk/wpa_supplicant/vs2005/wpa_supplicant/wpa_supplicant.vcproj Sun Nov  2 11:09:46 2008
@@ -271,6 +271,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\eap_common\eap_peap_common.c"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\eap_peer\eap_tls.c"
 				>
 			</File>
@@ -279,10 +283,6 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\..\src\eap_peer\eap_tlv.c"
-				>
-			</File>
-			<File
 				RelativePath="..\..\..\src\eap_peer\eap_tnc.c"
 				>
 			</File>
@@ -320,6 +320,10 @@
 			</File>
 			<File
 				RelativePath="..\..\..\src\crypto\ms_funcs.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\eap_peer\mschapv2.c"
 				>
 			</File>
 			<File

Modified: wpasupplicant/trunk/wpa_supplicant/vs2005/wpasvc/wpasvc.vcproj
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/wpa_supplicant/vs2005/wpasvc/wpasvc.vcproj?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/wpa_supplicant/vs2005/wpasvc/wpasvc.vcproj (original)
+++ wpasupplicant/trunk/wpa_supplicant/vs2005/wpasvc/wpasvc.vcproj Sun Nov  2 11:09:46 2008
@@ -271,6 +271,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\eap_common\eap_peap_common.c"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\eap_peer\eap_tls.c"
 				>
 			</File>
@@ -279,10 +283,6 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\..\src\eap_peer\eap_tlv.c"
-				>
-			</File>
-			<File
 				RelativePath="..\..\..\src\eap_peer\eap_tnc.c"
 				>
 			</File>
@@ -320,6 +320,10 @@
 			</File>
 			<File
 				RelativePath="..\..\..\src\crypto\ms_funcs.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\eap_peer\mschapv2.c"
 				>
 			</File>
 			<File

Modified: wpasupplicant/trunk/wpa_supplicant/wpa_cli.c
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/wpa_supplicant/wpa_cli.c?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/wpa_supplicant/wpa_cli.c (original)
+++ wpasupplicant/trunk/wpa_supplicant/wpa_cli.c Sun Nov  2 11:09:46 2008
@@ -1152,6 +1152,7 @@
 	char *cmd;
 	size_t len;
 	int res;
+	int ret = 0;
 
 	len = os_strlen(program) + os_strlen(arg1) + os_strlen(arg2) + 3;
 	cmd = os_malloc(len);
@@ -1164,11 +1165,12 @@
 	}
 	cmd[len - 1] = '\0';
 #ifndef _WIN32_WCE
-	system(cmd);
+	if (system(cmd) < 0)
+		ret = -1;
 #endif /* _WIN32_WCE */
 	os_free(cmd);
 
-	return 0;
+	return ret;
 }
 
 

Modified: wpasupplicant/trunk/wpa_supplicant/wpa_gui-qt4/networkconfig.cpp
URL: http://svn.debian.org/wsvn/pkg-wpa/wpasupplicant/trunk/wpa_supplicant/wpa_gui-qt4/networkconfig.cpp?rev=1281&op=diff
==============================================================================
--- wpasupplicant/trunk/wpa_supplicant/wpa_gui-qt4/networkconfig.cpp (original)
+++ wpasupplicant/trunk/wpa_supplicant/wpa_gui-qt4/networkconfig.cpp Sun Nov  2 11:09:46 2008
@@ -305,7 +305,7 @@
 				snprintf(phase2, sizeof(phase2), "auth=%s",
 					 inner.toAscii().constData());
 		} else if (eap.compare("FAST") == 0) {
-			char *provisioning = NULL;
+			const char *provisioning = NULL;
 			if (inner.startsWith("EAP-")) {
 				snprintf(phase2, sizeof(phase2), "auth=%s",
 					 inner.right(inner.size() - 4).
@@ -316,7 +316,8 @@
 				snprintf(phase2, sizeof(phase2),
 					 "auth=GTC auth=MSCHAPV2");
 				provisioning = "fast_provisioning=1";
-			}
+			} else
+				provisioning = "fast_provisioning=3";
 			if (provisioning) {
 				char blob[32];
 				setNetworkParam(id, "phase1", provisioning,




More information about the Pkg-wpa-devel mailing list