From owner-svn-src-head@FreeBSD.ORG Tue Jan 27 22:18:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D84FF106564A; Tue, 27 Jan 2009 22:18:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C405E8FC08; Tue, 27 Jan 2009 22:18:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0RMI5XY098398; Tue, 27 Jan 2009 22:18:05 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0RMI4O6098370; Tue, 27 Jan 2009 22:18:04 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901272218.n0RMI4O6098370@svn.freebsd.org> From: Sam Leffler Date: Tue, 27 Jan 2009 22:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187791 - in head/contrib/wpa_supplicant: . doc/docbook wpa_gui wpa_gui-qt4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2009 22:18:06 -0000 Author: sam Date: Tue Jan 27 22:18:04 2009 New Revision: 187791 URL: http://svn.freebsd.org/changeset/base/187791 Log: update to 0.5.11: some useful bug fixes (check ChangeLog) Submitted by: scf MFC after: 3 weeks Modified: head/contrib/wpa_supplicant/ (props changed) head/contrib/wpa_supplicant/ChangeLog head/contrib/wpa_supplicant/Makefile head/contrib/wpa_supplicant/base64.c head/contrib/wpa_supplicant/ctrl_iface.c head/contrib/wpa_supplicant/ctrl_iface_dbus.c head/contrib/wpa_supplicant/ctrl_iface_unix.c head/contrib/wpa_supplicant/dbus_dict_helpers.c head/contrib/wpa_supplicant/doc/docbook/wpa_background.8 head/contrib/wpa_supplicant/doc/docbook/wpa_cli.8 head/contrib/wpa_supplicant/doc/docbook/wpa_cli.sgml head/contrib/wpa_supplicant/doc/docbook/wpa_passphrase.8 head/contrib/wpa_supplicant/doc/docbook/wpa_supplicant.8 head/contrib/wpa_supplicant/doc/docbook/wpa_supplicant.conf.5 head/contrib/wpa_supplicant/doc/docbook/wpa_supplicant.conf.sgml head/contrib/wpa_supplicant/doc/docbook/wpa_supplicant.sgml head/contrib/wpa_supplicant/driver_ndis.c head/contrib/wpa_supplicant/eap.c head/contrib/wpa_supplicant/eap_aka.c head/contrib/wpa_supplicant/eap_gpsk.c head/contrib/wpa_supplicant/eap_gpsk_common.c head/contrib/wpa_supplicant/eap_ttls.c head/contrib/wpa_supplicant/eloop.c head/contrib/wpa_supplicant/eloop.h head/contrib/wpa_supplicant/eloop_none.c head/contrib/wpa_supplicant/mlme.c head/contrib/wpa_supplicant/os_unix.c head/contrib/wpa_supplicant/preauth_test.c head/contrib/wpa_supplicant/radius.c head/contrib/wpa_supplicant/sha1.c head/contrib/wpa_supplicant/tls_openssl.c head/contrib/wpa_supplicant/version.h head/contrib/wpa_supplicant/wpa.c head/contrib/wpa_supplicant/wpa.h head/contrib/wpa_supplicant/wpa_cli.c head/contrib/wpa_supplicant/wpa_gui-qt4/networkconfig.cpp head/contrib/wpa_supplicant/wpa_gui-qt4/scanresults.cpp head/contrib/wpa_supplicant/wpa_gui-qt4/wpagui.cpp head/contrib/wpa_supplicant/wpa_gui/networkconfig.ui.h head/contrib/wpa_supplicant/wpa_gui/userdatarequest.ui.h head/contrib/wpa_supplicant/wpa_gui/wpagui.ui.h head/contrib/wpa_supplicant/wpa_i.h head/contrib/wpa_supplicant/wpa_supplicant.c Modified: head/contrib/wpa_supplicant/ChangeLog ============================================================================== --- head/contrib/wpa_supplicant/ChangeLog Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/ChangeLog Tue Jan 27 22:18:04 2009 (r187791) @@ -1,5 +1,31 @@ ChangeLog for wpa_supplicant +2008-11-28 - v0.5.11 + * fixed race condition between disassociation event and group key + handshake to avoid getting stuck in incorrect state [Bug 261] + * updated D-Bus usage to avoid deprecated functions + * silence SIOCSIWAUTH ioctl failure message (these can be ignored in + most cases and are now only shown in debug output) + * increase timeout for IBSS connection + * driver_wext: do not overwrite BSS frequency if channel was already + received + * driver_wext: set interface down for mode switches, if needed (e.g., + for mac80211) + * driver_wext: fixed re-initialization of a removed and re-inserted + interface (e.g., USB dongle or on resume if driver was unloaded for + suspend) + * improve per-SSID scanning for drivers that report background scan + results frequently + * fixed scanning behavior after a failed initial association + * driver_wext: fixed processing of invalid event messages from kernel + not to crash wpa_supplicant (this could happen when using 64-bit + kernel with 32-bit userspace) + * fixed EAP-AKA to use RES Length field in AT_RES as length in bits, + not bytes + * fixed canceling of PMKSA caching when using drivers that generate + RSN IE and refuse to drop PMKIDs that wpa_supplicant does not know + about + 2008-02-19 - v0.5.10 * added support for Makefile builds to include debug-log-to-a-file functionality (CONFIG_DEBUG_FILE=y and -f on command line) Modified: head/contrib/wpa_supplicant/Makefile ============================================================================== --- head/contrib/wpa_supplicant/Makefile Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/Makefile Tue Jan 27 22:18:04 2009 (r187791) @@ -149,7 +149,10 @@ endif ifdef CONFIG_DRIVER_NDIS CFLAGS += -DCONFIG_DRIVER_NDIS -OBJS_d += driver_ndis.o driver_ndis_.o +OBJS_d += driver_ndis.o +ifdef CONFIG_NDIS_EVENTS_INTEGRATED +OBJS_d += driver_ndis_.o +endif ifndef CONFIG_L2_PACKET CONFIG_L2_PACKET=pcap endif Modified: head/contrib/wpa_supplicant/base64.c ============================================================================== --- head/contrib/wpa_supplicant/base64.c Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/base64.c Tue Jan 27 22:18:04 2009 (r187791) @@ -115,7 +115,7 @@ unsigned char * base64_decode(const unsi count++; } - if (count % 4) + if (count == 0 || count % 4) return NULL; olen = count / 4 * 3; Modified: head/contrib/wpa_supplicant/ctrl_iface.c ============================================================================== --- head/contrib/wpa_supplicant/ctrl_iface.c Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/ctrl_iface.c Tue Jan 27 22:18:04 2009 (r187791) @@ -76,6 +76,7 @@ static int wpa_supplicant_ctrl_iface_set } +#ifdef IEEE8021X_EAPOL static int wpa_supplicant_ctrl_iface_preauth(struct wpa_supplicant *wpa_s, char *addr) { @@ -94,6 +95,7 @@ static int wpa_supplicant_ctrl_iface_pre return 0; } +#endif /* IEEE8021X_EAPOL */ #ifdef CONFIG_PEERKEY @@ -1126,9 +1128,11 @@ char * wpa_supplicant_ctrl_iface_process wpa_s->reassociate = 1; wpa_supplicant_req_scan(wpa_s, 0, 0); } +#ifdef IEEE8021X_EAPOL } else if (os_strncmp(buf, "PREAUTH ", 8) == 0) { if (wpa_supplicant_ctrl_iface_preauth(wpa_s, buf + 8)) reply_len = -1; +#endif /* IEEE8021X_EAPOL */ #ifdef CONFIG_PEERKEY } else if (os_strncmp(buf, "STKSTART ", 9) == 0) { if (wpa_supplicant_ctrl_iface_stkstart(wpa_s, buf + 9)) Modified: head/contrib/wpa_supplicant/ctrl_iface_dbus.c ============================================================================== --- head/contrib/wpa_supplicant/ctrl_iface_dbus.c Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/ctrl_iface_dbus.c Tue Jan 27 22:18:04 2009 (r187791) @@ -30,10 +30,10 @@ #include "wpa_ctrl.h" #include "eap.h" -#define DBUS_VERSION (DBUS_VERSION_MAJOR << 8 | DBUS_VERSION_MINOR) +#define _DBUS_VERSION (DBUS_VERSION_MAJOR << 8 | DBUS_VERSION_MINOR) #define DBUS_VER(major, minor) ((major) << 8 | (minor)) -#if DBUS_VERSION < DBUS_VER(1,1) +#if _DBUS_VERSION < DBUS_VER(1,1) #define dbus_watch_get_unix_fd dbus_watch_get_fd #endif Modified: head/contrib/wpa_supplicant/ctrl_iface_unix.c ============================================================================== --- head/contrib/wpa_supplicant/ctrl_iface_unix.c Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/ctrl_iface_unix.c Tue Jan 27 22:18:04 2009 (r187791) @@ -305,7 +305,7 @@ wpa_supplicant_ctrl_iface_init(struct wp /* Group name not found - try to parse this as gid */ gid = strtol(gid_str, &endp, 10); if (*gid_str == '\0' || *endp != '\0') { - wpa_printf(MSG_DEBUG, "CTRL: Invalid group " + wpa_printf(MSG_ERROR, "CTRL: Invalid group " "'%s'", gid_str); goto fail; } Modified: head/contrib/wpa_supplicant/dbus_dict_helpers.c ============================================================================== --- head/contrib/wpa_supplicant/dbus_dict_helpers.c Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/dbus_dict_helpers.c Tue Jan 27 22:18:04 2009 (r187791) @@ -629,36 +629,56 @@ 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: @@ -666,8 +686,11 @@ 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; @@ -677,13 +700,7 @@ 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"); @@ -696,18 +713,15 @@ 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; @@ -723,6 +737,13 @@ 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: @@ -734,7 +755,6 @@ 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; @@ -743,20 +763,14 @@ 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; @@ -946,9 +960,17 @@ 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: { + unsigned int i; + for (i = 0; i < entry->array_len; i++) + free(entry->strarray_value[i]); + free(entry->strarray_value); + break; + } } break; } Modified: head/contrib/wpa_supplicant/doc/docbook/wpa_background.8 ============================================================================== --- head/contrib/wpa_supplicant/doc/docbook/wpa_background.8 Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/doc/docbook/wpa_background.8 Tue Jan 27 22:18:04 2009 (r187791) @@ -3,7 +3,7 @@ .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . -.TH "WPA_BACKGROUND" "8" "19 February 2008" "" "" +.TH "WPA_BACKGROUND" "8" "28 November 2008" "" "" .SH NAME wpa_background \- Background information on Wi-Fi Protected Access and IEEE 802.11i Modified: head/contrib/wpa_supplicant/doc/docbook/wpa_cli.8 ============================================================================== --- head/contrib/wpa_supplicant/doc/docbook/wpa_cli.8 Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/doc/docbook/wpa_cli.8 Tue Jan 27 22:18:04 2009 (r187791) @@ -3,7 +3,7 @@ .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . -.TH "WPA_CLI" "8" "19 February 2008" "" "" +.TH "WPA_CLI" "8" "28 November 2008" "" "" .SH NAME wpa_cli \- WPA command line client @@ -57,17 +57,18 @@ current network. is description o case of OTP request, it includes the challenge from the authentication server. .PP -The reply to these requests can be given with 'identity', -'password', and 'otp' commands. needs to be copied from the -the matching request. 'password' and 'otp' commands can be used -regardless of whether the request was for PASSWORD or OTP. The -main difference between these two commands is that values given -with 'password' are remembered as long as wpa_supplicant is -running whereas values given with 'otp' are used only once and -then forgotten, i.e., wpa_supplicant will ask frontend for a new -value for every use. This can be used to implement -one-time-password lists and generic token card -based -authentication. +The reply to these requests can be given with +\fBidentity\fR, \fBpassword\fR, and +\fBotp\fR commands. needs to be copied from +the matching request. \fBpassword\fR and +\fBotp\fR commands can be used regardless of whether +the request was for PASSWORD or OTP. The main difference between these +two commands is that values given with \fBpassword\fR are +remembered as long as wpa_supplicant is running whereas values given +with \fBotp\fR are used only once and then forgotten, +i.e., wpa_supplicant will ask frontend for a new value for every use. +This can be used to implement one-time-password lists and generic token +card -based authentication. .PP Example request for password and a matching reply: .sp Modified: head/contrib/wpa_supplicant/doc/docbook/wpa_cli.sgml ============================================================================== --- head/contrib/wpa_supplicant/doc/docbook/wpa_cli.sgml Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/doc/docbook/wpa_cli.sgml Tue Jan 27 22:18:04 2009 (r187791) @@ -72,17 +72,18 @@ case of OTP request, it includes the challenge from the authentication server. - The reply to these requests can be given with 'identity', - 'password', and 'otp' commands. <id> needs to be copied from the - the matching request. 'password' and 'otp' commands can be used - regardless of whether the request was for PASSWORD or OTP. The - main difference between these two commands is that values given - with 'password' are remembered as long as wpa_supplicant is - running whereas values given with 'otp' are used only once and - then forgotten, i.e., wpa_supplicant will ask frontend for a new - value for every use. This can be used to implement - one-time-password lists and generic token card -based - authentication. + The reply to these requests can be given with + identity, password, and + otp commands. <id> needs to be copied from + the matching request. password and + otp commands can be used regardless of whether + the request was for PASSWORD or OTP. The main difference between these + two commands is that values given with password are + remembered as long as wpa_supplicant is running whereas values given + with otp are used only once and then forgotten, + i.e., wpa_supplicant will ask frontend for a new value for every use. + This can be used to implement one-time-password lists and generic token + card -based authentication. Example request for password and a matching reply: Modified: head/contrib/wpa_supplicant/doc/docbook/wpa_passphrase.8 ============================================================================== --- head/contrib/wpa_supplicant/doc/docbook/wpa_passphrase.8 Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/doc/docbook/wpa_passphrase.8 Tue Jan 27 22:18:04 2009 (r187791) @@ -3,7 +3,7 @@ .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . -.TH "WPA_PASSPHRASE" "8" "19 February 2008" "" "" +.TH "WPA_PASSPHRASE" "8" "28 November 2008" "" "" .SH NAME wpa_passphrase \- Generate a WPA PSK from an ASCII passphrase for a SSID Modified: head/contrib/wpa_supplicant/doc/docbook/wpa_supplicant.8 ============================================================================== --- head/contrib/wpa_supplicant/doc/docbook/wpa_supplicant.8 Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/doc/docbook/wpa_supplicant.8 Tue Jan 27 22:18:04 2009 (r187791) @@ -3,7 +3,7 @@ .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . -.TH "WPA_SUPPLICANT" "8" "19 February 2008" "" "" +.TH "WPA_SUPPLICANT" "8" "28 November 2008" "" "" .SH NAME wpa_supplicant \- Wi-Fi Protected Access client and IEEE 802.1X supplicant @@ -214,7 +214,11 @@ PMKSA caching .RE .SH "AVAILABLE DRIVERS" .PP -The available drivers to specify with the -D option are: +A summary of available driver backends is below. Support for each +of the driver backends is chosen at wpa_supplicant compile time. For a +list of supported driver backends that may be used with the -D option on +your system, refer to the help output of wpa_supplicant +(\fBwpa_supplicant -h\fR). .TP \fBhostap\fR (default) Host AP driver (Intersil Prism2/2.5/3). @@ -250,33 +254,47 @@ BSD 802.11 support (Atheros, etc.). \fBndis\fR Windows NDIS driver. .SH "COMMAND LINE OPTIONS" +.PP +Most command line options have global scope. Some are given per +interface, and are only valid if at least one \fB-i\fR option +is specified, otherwise they're ignored. Option groups for different +interfaces must be separated by \fB-N\fR option. +.TP +\fB-b br_ifname\fR +Optional bridge interface name. (Per interface) .TP \fB-B\fR Run daemon in the background. .TP \fB-i ifname\fR -Interface to listen on. +Interface to listen on. Multiple instances of this option can +be present, one per interface, separated by \fB-N\fR +option (see below). .TP \fB-c filename\fR -Path to configuration file. +Path to configuration file. (Per interface) .TP \fB-P PID_file\fR Path to PID file. .TP \fB-C ctrl_interface\fR -Path to ctrl_interface socket (only used if -c is not). +Path to ctrl_interface socket (Per interface. Only used if +\fB-c\fR is not). .TP \fB-g global ctrl_interface\fR -Path to global ctrl_interface socket. +Path to global ctrl_interface socket. If specified, interface +definitions may be omitted. .TP \fB-D driver\fR -Driver to use. See the available options below. +Driver to use. (Per interface, see the available options +below.) .TP \fB-f output file\fR Log output to specified file instead of stdout. .TP \fB-d\fR -Increase debugging verbosity (-dd even more). +Increase debugging verbosity (\fB-dd\fR even +more). .TP \fB-K\fR Include keys (passwords, etc.) in debug output. @@ -296,7 +314,12 @@ Help. Show a usage message. Show license (GPL and BSD). .TP \fB-q\fR -Decrease debugging verbosity (-qq even less). +Decrease debugging verbosity (\fB-qq\fR even +less). +.TP +\fB-u\fR +Enabled DBus control interface. If enabled, interface +definitions may be omitted. .TP \fB-v\fR Show version. @@ -367,9 +390,9 @@ with other versions) .TP \fBHost AP driver for Prism2/2.5/3 (development snapshot/v0.2.x)\fR (http://hostap.epitest.fi/) Driver needs to be set in -Managed mode ('iwconfig wlan0 mode managed'). Please note -that station firmware version needs to be 1.7.0 or newer to -work in WPA mode. +Managed mode (\fBiwconfig wlan0 mode managed\fR). +Please note that station firmware version needs to be 1.7.0 or +newer to work in WPA mode. .TP \fBLinuxant DriverLoader\fR (http://www.linuxant.com/driverloader/) @@ -506,8 +529,8 @@ can be used to enable WPA support: Add MODE="Managed" and WPA="y" to the network scheme in \fI/etc/pcmcia/wireless.opts\fR\&. .PP -Add the following block to the end of 'start' action handler -in \fI/etc/pcmcia/wireless\fR: +Add the following block to the end of \fBstart\fR +action handler in \fI/etc/pcmcia/wireless\fR: .sp .RS @@ -519,8 +542,8 @@ fi .fi .RE .PP -Add the following block to the end of 'stop' action handler -(may need to be separated from other actions) in +Add the following block to the end of \fBstop\fR +action handler (may need to be separated from other actions) in \fI/etc/pcmcia/wireless\fR: .sp .RS Modified: head/contrib/wpa_supplicant/doc/docbook/wpa_supplicant.conf.5 ============================================================================== --- head/contrib/wpa_supplicant/doc/docbook/wpa_supplicant.conf.5 Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/doc/docbook/wpa_supplicant.conf.5 Tue Jan 27 22:18:04 2009 (r187791) @@ -3,7 +3,7 @@ .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . -.TH "WPA_SUPPLICANT.CONF" "5" "19 February 2008" "" "" +.TH "WPA_SUPPLICANT.CONF" "5" "28 November 2008" "" "" .SH NAME wpa_supplicant.conf \- configuration file for wpa_supplicant @@ -24,7 +24,7 @@ run in the background. Changes to configuration file can be reloaded be sending SIGHUP signal to \fBwpa_supplicant\fR ('killall -HUP wpa_supplicant'). Similarly, reloading can be triggered with -the 'wpa_cli reconfigure' command. +the \fBwpa_cli reconfigure\fR command. .PP Configuration file can include one or more network blocks, e.g., one for each used SSID. wpa_supplicant will automatically @@ -179,7 +179,7 @@ network={ .TP 3 6. Authentication for wired Ethernet. This can be used with -'wired' interface (-Dwired on command line). +\fBwired\fR interface (-Dwired on command line). .sp .RS Modified: head/contrib/wpa_supplicant/doc/docbook/wpa_supplicant.conf.sgml ============================================================================== --- head/contrib/wpa_supplicant/doc/docbook/wpa_supplicant.conf.sgml Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/doc/docbook/wpa_supplicant.conf.sgml Tue Jan 27 22:18:04 2009 (r187791) @@ -26,7 +26,7 @@ Changes to configuration file can be reloaded be sending SIGHUP signal to wpa_supplicant ('killall -HUP wpa_supplicant'). Similarly, reloading can be triggered with - the 'wpa_cli reconfigure' command. + the wpa_cli reconfigure command. Configuration file can include one or more network blocks, e.g., one for each used SSID. wpa_supplicant will automatically @@ -179,7 +179,7 @@ network={ Authentication for wired Ethernet. This can be used with - 'wired' interface (-Dwired on command line). + wired interface (-Dwired on command line).
ctrl_interface=/var/run/wpa_supplicant Modified: head/contrib/wpa_supplicant/doc/docbook/wpa_supplicant.sgml ============================================================================== --- head/contrib/wpa_supplicant/doc/docbook/wpa_supplicant.sgml Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/doc/docbook/wpa_supplicant.sgml Tue Jan 27 22:18:04 2009 (r187791) @@ -241,7 +241,11 @@ Available Drivers - The available drivers to specify with the -D option are: + A summary of available driver backends is below. Support for each + of the driver backends is chosen at wpa_supplicant compile time. For a + list of supported driver backends that may be used with the -D option on + your system, refer to the help output of wpa_supplicant + (wpa_supplicant -h). @@ -326,8 +330,19 @@ Command Line Options + Most command line options have global scope. Some are given per + interface, and are only valid if at least one option + is specified, otherwise they're ignored. Option groups for different + interfaces must be separated by option. + -b br_ifname + + Optional bridge interface name. (Per interface) + + + + -B Run daemon in the background. @@ -337,14 +352,16 @@ -i ifname - Interface to listen on. + Interface to listen on. Multiple instances of this option can + be present, one per interface, separated by + option (see below). -c filename - Path to configuration file. + Path to configuration file. (Per interface) @@ -358,21 +375,24 @@ -C ctrl_interface - Path to ctrl_interface socket (only used if -c is not). + Path to ctrl_interface socket (Per interface. Only used if + is not). -g global ctrl_interface - Path to global ctrl_interface socket. + Path to global ctrl_interface socket. If specified, interface + definitions may be omitted. -D driver - Driver to use. See the available options below. + Driver to use. (Per interface, see the available options + below.) @@ -386,7 +406,8 @@ -d - Increase debugging verbosity (-dd even more). + Increase debugging verbosity ( even + more). @@ -430,9 +451,19 @@ -q - Decrease debugging verbosity (-qq even less). + Decrease debugging verbosity ( even + less). + + + -u + + Enabled DBus control interface. If enabled, interface + definitions may be omitted. + + + -v @@ -523,9 +554,9 @@ wpa_supplicant \ snapshot/v0.2.x) (http://hostap.epitest.fi/) Driver needs to be set in - Managed mode ('iwconfig wlan0 mode managed'). Please note - that station firmware version needs to be 1.7.0 or newer to - work in WPA mode. + Managed mode (iwconfig wlan0 mode managed). + Please note that station firmware version needs to be 1.7.0 or + newer to work in WPA mode. @@ -729,8 +760,8 @@ wpa_supplicant -iwlan0 -c/etc/wpa_suppli Add MODE="Managed" and WPA="y" to the network scheme in /etc/pcmcia/wireless.opts. - Add the following block to the end of 'start' action handler - in /etc/pcmcia/wireless: + Add the following block to the end of start + action handler in /etc/pcmcia/wireless:
if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then @@ -739,8 +770,8 @@ fi
- Add the following block to the end of 'stop' action handler - (may need to be separated from other actions) in + Add the following block to the end of stop + action handler (may need to be separated from other actions) in /etc/pcmcia/wireless:
Modified: head/contrib/wpa_supplicant/driver_ndis.c ============================================================================== --- head/contrib/wpa_supplicant/driver_ndis.c Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/driver_ndis.c Tue Jan 27 22:18:04 2009 (r187791) @@ -42,7 +42,9 @@ int close(int fd); #include "driver_ndis.h" int wpa_driver_register_event_cb(struct wpa_driver_ndis_data *drv); +#ifdef CONFIG_NDIS_EVENTS_INTEGRATED void wpa_driver_ndis_event_pipe_cb(void *eloop_data, void *user_data); +#endif /* CONFIG_NDIS_EVENTS_INTEGRATED */ static void wpa_driver_ndis_deinit(void *priv); static void wpa_driver_ndis_poll(void *drv); Modified: head/contrib/wpa_supplicant/eap.c ============================================================================== --- head/contrib/wpa_supplicant/eap.c Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/eap.c Tue Jan 27 22:18:04 2009 (r187791) @@ -892,7 +892,7 @@ static int eap_sm_imsi_identity(struct e #endif /* PCSC_FUNCS */ -static int eap_sm_get_scard_identity(struct eap_sm *sm, struct wpa_ssid *ssid) +static int eap_sm_set_scard_pin(struct eap_sm *sm, struct wpa_ssid *ssid) { #ifdef PCSC_FUNCS if (scard_set_pin(sm->scard_ctx, ssid->pin)) { @@ -907,6 +907,17 @@ static int eap_sm_get_scard_identity(str eap_sm_request_pin(sm); return -1; } + return 0; +#else /* PCSC_FUNCS */ + return -1; +#endif /* PCSC_FUNCS */ +} + +static int eap_sm_get_scard_identity(struct eap_sm *sm, struct wpa_ssid *ssid) +{ +#ifdef PCSC_FUNCS + if (eap_sm_set_scard_pin(sm, ssid)) + return -1; return eap_sm_imsi_identity(sm, ssid); #else /* PCSC_FUNCS */ @@ -973,6 +984,9 @@ u8 * eap_sm_buildIdentity(struct eap_sm eap_sm_request_identity(sm); return NULL; } + } else if (config->pcsc) { + if (eap_sm_set_scard_pin(sm, config) < 0) + return NULL; } *len = sizeof(struct eap_hdr) + 1 + identity_len; Modified: head/contrib/wpa_supplicant/eap_aka.c ============================================================================== --- head/contrib/wpa_supplicant/eap_aka.c Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/eap_aka.c Tue Jan 27 22:18:04 2009 (r187791) @@ -292,7 +292,7 @@ static u8 * eap_aka_response_challenge(s msg = eap_sim_msg_init(EAP_CODE_RESPONSE, req->identifier, EAP_TYPE_AKA, EAP_AKA_SUBTYPE_CHALLENGE); wpa_printf(MSG_DEBUG, " AT_RES"); - eap_sim_msg_add(msg, EAP_SIM_AT_RES, data->res_len, + eap_sim_msg_add(msg, EAP_SIM_AT_RES, data->res_len * 8, data->res, data->res_len); wpa_printf(MSG_DEBUG, " AT_MAC"); eap_sim_msg_add_mac(msg, EAP_SIM_AT_MAC); Modified: head/contrib/wpa_supplicant/eap_gpsk.c ============================================================================== --- head/contrib/wpa_supplicant/eap_gpsk.c Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/eap_gpsk.c Tue Jan 27 22:18:04 2009 (r187791) @@ -240,8 +240,8 @@ const u8 * eap_gpsk_process_csuite_list( return NULL; } if (*list_len == 0 || (*list_len % sizeof(struct eap_gpsk_csuite))) { - wpa_printf(MSG_DEBUG, "EAP-GPSK: Invalid CSuite_List len %d", - *list_len); + wpa_printf(MSG_DEBUG, "EAP-GPSK: Invalid CSuite_List len %lu", + (unsigned long) *list_len); return NULL; } *list = pos; @@ -460,6 +460,7 @@ const u8 * eap_gpsk_validate_id_server(s data->id_server, data->id_server_len); wpa_hexdump_ascii(MSG_DEBUG, "EAP-GPSK: ID_Server in GPSK-3", pos, len); + return NULL; } pos += len; @@ -537,7 +538,9 @@ const u8 * eap_gpsk_validate_gpsk_3_mic( 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); return NULL; } if (eap_gpsk_compute_mic(data->sk, data->sk_len, data->vendor, @@ -589,8 +592,9 @@ static u8 * eap_gpsk_process_gpsk_3(stru return NULL; } 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)); } req = (const struct eap_hdr *) reqData; Modified: head/contrib/wpa_supplicant/eap_gpsk_common.c ============================================================================== --- head/contrib/wpa_supplicant/eap_gpsk_common.c Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/eap_gpsk_common.c Tue Jan 27 22:18:04 2009 (r187791) @@ -376,8 +376,8 @@ static int eap_gpsk_compute_mic_aes(cons const u8 *data, size_t len, u8 *mic) { if (sk_len != 16) { - wpa_printf(MSG_DEBUG, "EAP-GPSK: Invalid SK length %d for " - "AES-CMAC MIC", sk_len); + wpa_printf(MSG_DEBUG, "EAP-GPSK: Invalid SK length %lu for " + "AES-CMAC MIC", (unsigned long) sk_len); return -1; } Modified: head/contrib/wpa_supplicant/eap_ttls.c ============================================================================== --- head/contrib/wpa_supplicant/eap_ttls.c Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/eap_ttls.c Tue Jan 27 22:18:04 2009 (r187791) @@ -673,7 +673,7 @@ static int eap_ttls_phase2_request_mscha /* MS-CHAP-Challenge */ challenge = eap_ttls_implicit_challenge( - sm, data, EAP_TTLS_MSCHAPV2_CHALLENGE_LEN * 2 + 1); + sm, data, EAP_TTLS_MSCHAPV2_CHALLENGE_LEN + 1); if (challenge == NULL) { os_free(buf); wpa_printf(MSG_ERROR, "EAP-TTLS/MSCHAPV2: Failed to derive " @@ -777,7 +777,8 @@ static int eap_ttls_phase2_request_mscha config->identity, config->identity_len); /* MS-CHAP-Challenge */ - challenge = eap_ttls_implicit_challenge(sm, data, EAP_TLS_KEY_LEN); + challenge = eap_ttls_implicit_challenge( + sm, data, EAP_TTLS_MSCHAP_CHALLENGE_LEN + 1); if (challenge == NULL) { os_free(buf); wpa_printf(MSG_ERROR, "EAP-TTLS/MSCHAP: Failed to derive " @@ -907,7 +908,8 @@ static int eap_ttls_phase2_request_chap( config->identity, config->identity_len); /* CHAP-Challenge */ - challenge = eap_ttls_implicit_challenge(sm, data, EAP_TLS_KEY_LEN); + challenge = eap_ttls_implicit_challenge( + sm, data, EAP_TTLS_CHAP_CHALLENGE_LEN + 1); if (challenge == NULL) { os_free(buf); wpa_printf(MSG_ERROR, "EAP-TTLS/CHAP: Failed to derive " Modified: head/contrib/wpa_supplicant/eloop.c ============================================================================== --- head/contrib/wpa_supplicant/eloop.c Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/eloop.c Tue Jan 27 22:18:04 2009 (r187791) @@ -232,7 +232,10 @@ int eloop_register_timeout(unsigned int timeout = os_malloc(sizeof(*timeout)); if (timeout == NULL) return -1; - os_get_time(&timeout->time); + if (os_get_time(&timeout->time) < 0) { + os_free(timeout); + return -1; + } timeout->time.sec += secs; timeout->time.usec += usecs; while (timeout->time.usec >= 1000000) { @@ -302,6 +305,25 @@ int eloop_cancel_timeout(eloop_timeout_h } +int eloop_is_timeout_registered(eloop_timeout_handler handler, + void *eloop_data, void *user_data) +{ + struct eloop_timeout *tmp; + + tmp = eloop.timeout; + while (tmp != NULL) { + if (tmp->handler == handler && + tmp->eloop_data == eloop_data && + tmp->user_data == user_data) + return 1; + + tmp = tmp->next; + } + + return 0; +} + + #ifndef CONFIG_NATIVE_WINDOWS static void eloop_handle_alarm(int sig) { Modified: head/contrib/wpa_supplicant/eloop.h ============================================================================== --- head/contrib/wpa_supplicant/eloop.h Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/eloop.h Tue Jan 27 22:18:04 2009 (r187791) @@ -207,6 +207,19 @@ int eloop_cancel_timeout(eloop_timeout_h void *eloop_data, void *user_data); /** + * eloop_is_timeout_registered - Check if a timeout is already registered + * @handler: Matching callback function + * @eloop_data: Matching eloop_data + * @user_data: Matching user_data + * Returns: 1 if the timeout is registered, 0 if the timeout is not registered + * + * Determine if a matching timeout is registered + * with eloop_register_timeout(). + */ +int eloop_is_timeout_registered(eloop_timeout_handler handler, + void *eloop_data, void *user_data); + +/** * eloop_register_signal - Register handler for signals * @sig: Signal number (e.g., SIGHUP) * @handler: Callback function to be called when the signal is received Modified: head/contrib/wpa_supplicant/eloop_none.c ============================================================================== --- head/contrib/wpa_supplicant/eloop_none.c Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/eloop_none.c Tue Jan 27 22:18:04 2009 (r187791) @@ -197,6 +197,26 @@ int eloop_cancel_timeout(void (*handler) } +int eloop_is_timeout_registered(void (*handler)(void *eloop_ctx, + void *timeout_ctx), + void *eloop_data, void *user_data) +{ + struct eloop_timeout *tmp; + + tmp = eloop.timeout; + while (tmp != NULL) { + if (tmp->handler == handler && + tmp->eloop_data == eloop_data && + tmp->user_data == user_data) + return 1; + + tmp = tmp->next; + } + + return 0; +} + + /* TODO: replace with suitable signal handler */ #if 0 static void eloop_handle_signal(int sig) Modified: head/contrib/wpa_supplicant/mlme.c ============================================================================== --- head/contrib/wpa_supplicant/mlme.c Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/mlme.c Tue Jan 27 22:18:04 2009 (r187791) @@ -985,8 +985,6 @@ static void ieee80211_send_probe_req(str supp_rates[1] = 0; for (i = 0; i < wpa_s->mlme.num_curr_rates; i++) { struct wpa_rate_data *rate = &wpa_s->mlme.curr_rates[i]; - if (!(rate->flags & WPA_RATE_SUPPORTED)) - continue; if (esupp_rates) { pos = buf + len; len++; @@ -996,6 +994,7 @@ static void ieee80211_send_probe_req(str esupp_rates[0] = WLAN_EID_EXT_SUPP_RATES; esupp_rates[1] = 1; pos = &esupp_rates[2]; + len += 3; } else { pos = buf + len; len++; Modified: head/contrib/wpa_supplicant/os_unix.c ============================================================================== --- head/contrib/wpa_supplicant/os_unix.c Tue Jan 27 21:48:47 2009 (r187790) +++ head/contrib/wpa_supplicant/os_unix.c Tue Jan 27 22:18:04 2009 (r187791) @@ -216,7 +216,12 @@ char * os_readfile(const char *name, siz 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: head/contrib/wpa_supplicant/preauth_test.c ============================================================================== --- head/contrib/wpa_supplicant/preauth_test.c Tue Jan 27 21:48:47 2009 (r187790) *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***