mech_eap.git
13 years agowpa_cli: Add internal line edit implementation
Jouni Malinen [Sun, 14 Nov 2010 17:15:23 +0000 (19:15 +0200)]
wpa_cli: Add internal line edit implementation

CONFIG_WPA_CLI_EDIT=y can now be used to build wpa_cli with internal
implementation of line editing and history support. This can be used
as a replacement for CONFIG_READLINE=y.

13 years agowpa_cli: Replace CONFIG_WPA_CLI_FORK design with eloop
Jouni Malinen [Sun, 14 Nov 2010 11:16:51 +0000 (13:16 +0200)]
wpa_cli: Replace CONFIG_WPA_CLI_FORK design with eloop

Instead of using a separate process to receive and print event
messages, use a single-process design with eloop to simply
wpa_cli and interaction with readline.

13 years agowpa_cli: Split wpa_cli_interactive() into two versions
Jouni Malinen [Sun, 14 Nov 2010 09:30:19 +0000 (11:30 +0200)]
wpa_cli: Split wpa_cli_interactive() into two versions

Instead of multiple #ifdef blocks for readline within the function,
use two copies of the functions, one for readline, one without any
readline functionality.

13 years agowlantest: Add control interface and wlantest_cli
Jouni Malinen [Sat, 13 Nov 2010 16:38:19 +0000 (18:38 +0200)]
wlantest: Add control interface and wlantest_cli

This can be used to manage wlantest operation during run time.

13 years agowlantest: Validate EAPOL-Key reserved fields
Jouni Malinen [Sat, 13 Nov 2010 12:09:40 +0000 (14:09 +0200)]
wlantest: Validate EAPOL-Key reserved fields

In addition, this handles WPA difference in Key Info for Secure
bit in msg 3/4 and 4/4 (not set, since GTK is not yet available).

13 years agowlantest: Add debug print for ignored group addressed Action frames
Jouni Malinen [Sat, 13 Nov 2010 11:18:09 +0000 (13:18 +0200)]
wlantest: Add debug print for ignored group addressed Action frames

13 years agowlantest: Validate MMIE KeyID reserved bits
Jouni Malinen [Sat, 13 Nov 2010 11:14:09 +0000 (13:14 +0200)]
wlantest: Validate MMIE KeyID reserved bits

13 years agowlantest: Validate reserved bits in TKIP/CCMP header
Jouni Malinen [Sat, 13 Nov 2010 11:03:21 +0000 (13:03 +0200)]
wlantest: Validate reserved bits in TKIP/CCMP header

13 years agowlantest: Verify that TKIP/CCMP frames set ExtIV=1
Jouni Malinen [Sat, 13 Nov 2010 10:54:07 +0000 (12:54 +0200)]
wlantest: Verify that TKIP/CCMP frames set ExtIV=1

13 years agowlantest: Implement TKIP replay detection
Jouni Malinen [Sat, 13 Nov 2010 10:40:36 +0000 (12:40 +0200)]
wlantest: Implement TKIP replay detection

13 years agowlantest: Add support for WPA key handshakes
Jouni Malinen [Sat, 13 Nov 2010 09:59:43 +0000 (11:59 +0200)]
wlantest: Add support for WPA key handshakes

The Key Data field is handled differently in msg 3/4 and 1/2 in WPA,
so add separate code for processing non-RSN case.

13 years agowlantest: Add support for TKIP decryption
Jouni Malinen [Sat, 13 Nov 2010 09:36:37 +0000 (11:36 +0200)]
wlantest: Add support for TKIP decryption

13 years agowlantest: Use negotiated AKM/cipher to select PMK-to-PTK parameters
Jouni Malinen [Fri, 12 Nov 2010 21:33:42 +0000 (23:33 +0200)]
wlantest: Use negotiated AKM/cipher to select PMK-to-PTK parameters

13 years agowlantest: Fix mgmt CCMP decrypt to not crash on failures
Jouni Malinen [Fri, 12 Nov 2010 21:28:43 +0000 (23:28 +0200)]
wlantest: Fix mgmt CCMP decrypt to not crash on failures

13 years agowlantest: Verify that unicast robust mgmt frames are protected
Jouni Malinen [Fri, 12 Nov 2010 21:17:20 +0000 (23:17 +0200)]
wlantest: Verify that unicast robust mgmt frames are protected

13 years agowlantest: Verify MFP use in association with MFPR BSS
Jouni Malinen [Fri, 12 Nov 2010 21:16:38 +0000 (23:16 +0200)]
wlantest: Verify MFP use in association with MFPR BSS

13 years agowlantest: Use MFPC field instead of igtk_set to check if BIP is needed
Jouni Malinen [Fri, 12 Nov 2010 21:01:56 +0000 (23:01 +0200)]
wlantest: Use MFPC field instead of igtk_set to check if BIP is needed

13 years agowlantest: Verify that WPA/RSN IE matches in EAPOL-Key and mgmt frames
Jouni Malinen [Fri, 12 Nov 2010 20:54:28 +0000 (22:54 +0200)]
wlantest: Verify that WPA/RSN IE matches in EAPOL-Key and mgmt frames

Verify that WPA/RSN IE in (Re)Association Request is identical to the
one used in EAPOL-Key message 2/4.

Verify that WPA/RSN IE in Beacon/Probe Response is identical to the
one(s) used in EAPOL-Key message 3/4.

13 years agowlantest: Parse WPA/RSN IE and store info for BSS/STA
Jouni Malinen [Fri, 12 Nov 2010 20:40:59 +0000 (22:40 +0200)]
wlantest: Parse WPA/RSN IE and store info for BSS/STA

In addition, verify that the parameters that the STA is requesting
match with what is enabled in the BSS.

13 years agoShare WPA IE parser function for RSN authenticator/supplicant
Jouni Malinen [Fri, 12 Nov 2010 19:52:14 +0000 (21:52 +0200)]
Share WPA IE parser function for RSN authenticator/supplicant

There is no point in maintaining two almost identical versions
of this parser. Move WPA IE parser into wpa_common.c similarly
to what was already the case with RSN IE parse.

13 years agoP2P: Add network_added notification when p2p device becomes GO
Jean Trivelly [Fri, 12 Nov 2010 19:21:24 +0000 (21:21 +0200)]
P2P: Add network_added notification when p2p device becomes GO

Notification is done when you become P2P client but was missing
when you become GO.

Signed-off-by: Jean Trivelly <jeanx.trivelly@linux.intel.com>
13 years agoP2P: Fix HT40 secondary channel validation
Jouni Malinen [Fri, 12 Nov 2010 17:04:48 +0000 (19:04 +0200)]
P2P: Fix HT40 secondary channel validation

13 years agoAP: Verify that HT40 secondary channel is supported
Jouni Malinen [Fri, 12 Nov 2010 16:31:56 +0000 (18:31 +0200)]
AP: Verify that HT40 secondary channel is supported

Refuse to enable HT40 mode AP unless both the primary and secondary
channels are enabled for AP use.

13 years agoP2P: Add HT40 operating classes based on driver channel flags
Jouni Malinen [Fri, 12 Nov 2010 16:14:12 +0000 (18:14 +0200)]
P2P: Add HT40 operating classes based on driver channel flags

This allows P2P to negotiate HT40 channels. For now, only 5 GHz
HT40 operating classes are enabled.

13 years agoAdd HT40 flags into driver channel list
Jouni Malinen [Fri, 12 Nov 2010 16:13:37 +0000 (18:13 +0200)]
Add HT40 flags into driver channel list

This can be used to figure out whether the driver would allow
HT40-/HT40+ on any specific channel.

13 years agoP2P: Send WPS-OVERLAP-DETECTED also to the parent interface
Jouni Malinen [Fri, 12 Nov 2010 09:30:58 +0000 (11:30 +0200)]
P2P: Send WPS-OVERLAP-DETECTED also to the parent interface

When running "p2p_connect addr pbc join" command, send the
WPS-OVERLAP-DETECTED even also to the parent interface (i.e.,
the one on which the p2p_connect was issued) and not only the
group interface in case separate P2P group interfaces are used.

13 years agowlantest: Dump decrypted Key Data from Group Handshake msg 1/2
Jouni Malinen [Thu, 11 Nov 2010 23:02:45 +0000 (01:02 +0200)]
wlantest: Dump decrypted Key Data from Group Handshake msg 1/2

13 years agowlantest: Add option for writing a PCAP dump file
Jouni Malinen [Thu, 11 Nov 2010 23:00:31 +0000 (01:00 +0200)]
wlantest: Add option for writing a PCAP dump file

The output file includes all the capture (or read from wireless PCAP
file) frames in their original contents and another copy of each
frame that is decrypted in wlantest (including EAPOL-Key Key Data
field).

13 years agowlantest: Add Group Key handshake processing
Jouni Malinen [Thu, 11 Nov 2010 20:04:38 +0000 (22:04 +0200)]
wlantest: Add Group Key handshake processing

Decrypt GTK/IGTK updates in Group Key message 1/2 and update the
keys. In addition, verify the MIC on both Group Key handshake
messages.

13 years agowlantest: Fix Mgmt CCMP replay detection to use correct PN offset
Jouni Malinen [Thu, 11 Nov 2010 19:35:30 +0000 (21:35 +0200)]
wlantest: Fix Mgmt CCMP replay detection to use correct PN offset

13 years agowlantest: Process Action frames
Jouni Malinen [Thu, 11 Nov 2010 19:34:06 +0000 (21:34 +0200)]
wlantest: Process Action frames

Parse Action frames and verify SA Query transactions.

13 years agowlantest: Decrypt CCMP protected unicast Robust Management frames
Jouni Malinen [Thu, 11 Nov 2010 18:46:15 +0000 (20:46 +0200)]
wlantest: Decrypt CCMP protected unicast Robust Management frames

13 years agowlantest: Add replay detection for CCMP
Jouni Malinen [Thu, 11 Nov 2010 18:21:11 +0000 (20:21 +0200)]
wlantest: Add replay detection for CCMP

13 years agowlantest: Decrypt group addressed Data frames
Jouni Malinen [Thu, 11 Nov 2010 17:53:12 +0000 (19:53 +0200)]
wlantest: Decrypt group addressed Data frames

13 years agoWPS: Fix UPnP deinit order to avoid using freed memory
Jouni Malinen [Thu, 11 Nov 2010 14:56:36 +0000 (16:56 +0200)]
WPS: Fix UPnP deinit order to avoid using freed memory

When multiple wireless interfaces are used with WPS, the UPnP
subscriptions need to be removed whenever a matching Registrar
instance gets removed. This avoids a segfault due to access to
freed memory during hostapd shutdown.

In addition, the UPnP interface instance structure needs to be
freed to avoid memory leak.

13 years agoWPS ER: Fix compiler warning on non-WPS2 builds
Jouni Malinen [Thu, 11 Nov 2010 12:54:18 +0000 (14:54 +0200)]
WPS ER: Fix compiler warning on non-WPS2 builds

13 years agoWPS: Change concurrent radio AP to use only one WPS UPnP instance
Jouni Malinen [Thu, 11 Nov 2010 12:50:13 +0000 (14:50 +0200)]
WPS: Change concurrent radio AP to use only one WPS UPnP instance

WPS external Registrars can get confused about multiple UPnP
instances (one per radio) on a dual-concurrent APs. Simplify the
design by sharing a single UPnP state machine for all wireless
interfaces controlled by hostapd. This matches with the previous
changes that made a single command enable WPS functionality on
all interfaces.

This is relatively minimal change to address the sharing of the
state among multiple struct hostapd_data instances. More cleanup
can be done separately to remove unnecessary copies of information.

13 years agowlantest: Add support for decrypting CCMP protected unicast Data frames
Jouni Malinen [Wed, 10 Nov 2010 23:29:30 +0000 (01:29 +0200)]
wlantest: Add support for decrypting CCMP protected unicast Data frames

13 years agoUpdate for 0.8.x and include licensing terms in top level README
Jouni Malinen [Wed, 10 Nov 2010 20:10:02 +0000 (22:10 +0200)]
Update for 0.8.x and include licensing terms in top level README

This brings in the full licensing text from
{hostapd,wpa_supplicant}/README into the top level README file
for clarity.

13 years agoDrop local stations on broadcast deauth/disassoc request
Jouni Malinen [Wed, 10 Nov 2010 15:09:31 +0000 (17:09 +0200)]
Drop local stations on broadcast deauth/disassoc request

When hostapd_cli deauth/disassoc is used with ff:ff:ff:ff:ff:ff
address, drop all local STA entries in addition to sending out the
broadcast deauth/disassoc frame.

13 years agowlantest: Fix BIP replay detection
Jouni Malinen [Wed, 10 Nov 2010 14:59:45 +0000 (16:59 +0200)]
wlantest: Fix BIP replay detection

13 years agoP2P: Replace the default country with "XX" (non-country entity)
Jouni Malinen [Wed, 10 Nov 2010 14:22:22 +0000 (16:22 +0200)]
P2P: Replace the default country with "XX" (non-country entity)

13 years agoFix a typo in the comment
Jouni Malinen [Wed, 10 Nov 2010 12:23:57 +0000 (14:23 +0200)]
Fix a typo in the comment

13 years agoP2P: Reselect operating channel preference based on best channels
Jouni Malinen [Wed, 10 Nov 2010 11:34:33 +0000 (13:34 +0200)]
P2P: Reselect operating channel preference based on best channels

When the peer does not include our initial preference in the Channel
List attribute during GO Negotiation, try to use the best channel of
the other band as the new preference instead of falling back to the
first channel in the intersection.

13 years agoP2P: Add support for automatic channel selection at GO
Anil Gathala Sudha [Wed, 10 Nov 2010 11:33:47 +0000 (13:33 +0200)]
P2P: Add support for automatic channel selection at GO

The driver wrapper may now indicate the preferred channel (e.g., based
on scan results) on both 2.4 GHz and 5 GHz bands (and an overall best
frequency). When setting up a GO, this preference information is used
to select the operating channel if configuration does not include
hardcoded channel. Similarly, this information can be used during
GO Negotiation to indicate preference for a specific channel based
on current channel conditions.

p2p_group_add command can now use special values (freq=2 and freq=5)
to indicate that the GO is to be started on the specified band.

13 years agowlantest: Validate MMIE MIC
Jouni Malinen [Wed, 10 Nov 2010 00:06:59 +0000 (02:06 +0200)]
wlantest: Validate MMIE MIC

13 years agowlantest: Parse KDEs from message 2/4
Jouni Malinen [Tue, 9 Nov 2010 23:16:32 +0000 (01:16 +0200)]
wlantest: Parse KDEs from message 2/4

13 years agowlantest: Use more consistent debug levels for keys
Jouni Malinen [Tue, 9 Nov 2010 18:35:24 +0000 (20:35 +0200)]
wlantest: Use more consistent debug levels for keys

13 years agowlantest: Parse Key Data KDEs and store GTK and IGTK
Jouni Malinen [Tue, 9 Nov 2010 18:29:12 +0000 (20:29 +0200)]
wlantest: Parse Key Data KDEs and store GTK and IGTK

13 years agohostapd: Prohibit WEP configuration when HT is enabled
Yogesh Ashok Powar [Tue, 9 Nov 2010 14:49:03 +0000 (16:49 +0200)]
hostapd: Prohibit WEP configuration when HT is enabled

WFA 11n testing does not allow WEP when IEEE 802.11n is enabled.
Reject such combination when parsing hostapd configuration file.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
13 years agowpa_supplicant: Test all compiled drivers before failing
Samuel Ortiz [Tue, 9 Nov 2010 14:45:27 +0000 (16:45 +0200)]
wpa_supplicant: Test all compiled drivers before failing

wpa_supplicant_set_driver() is returning an error if the first driver
in the driver list is not built in. It should continue through the
driver list until it finds one that's built in.

13 years agohostapd: Add comment about CONFIG_FULL_DYNAMIC_VLAN to defconfig
Helmut Schaa [Tue, 9 Nov 2010 14:38:59 +0000 (16:38 +0200)]
hostapd: Add comment about CONFIG_FULL_DYNAMIC_VLAN to defconfig

Add comment about CONFIG_FULL_DYNAMIC_VLAN to defconfig. By default
this feature is still disabled.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
13 years agohostapd: Fix config reload for multi-BSS
Felix Fietkau [Tue, 9 Nov 2010 14:35:49 +0000 (16:35 +0200)]
hostapd: Fix config reload for multi-BSS

Secondary BSS interfaces need to be activated after the config has
been reloaded.

13 years agowpa_supplicant: Fix port state management without IEEE8021X_EAPOL
Felix Fietkau [Tue, 9 Nov 2010 14:31:33 +0000 (16:31 +0200)]
wpa_supplicant: Fix port state management without IEEE8021X_EAPOL

If IEE8021X_EAPOL is not enabled in the config, wpa_drv_set_supp_port
must be called from the supplicant, otherwise port will not be
activated after association.

13 years agoAllow client isolation to be configured (ap_isolate=1)
Felix Fietkau [Tue, 9 Nov 2010 14:27:15 +0000 (16:27 +0200)]
Allow client isolation to be configured (ap_isolate=1)

Client isolation can be used to prevent low-level bridging of frames
between associated stations in the BSS. By default, this bridging is
allowed.

13 years agoFix rate table handling
Felix Fietkau [Tue, 9 Nov 2010 14:17:50 +0000 (16:17 +0200)]
Fix rate table handling

With the nl80211 driver, the rate table is mode dependent, so it
must be initialized after the hardware mode has been selected.

13 years agoAdd bridge handling for WDS STA interfaces
Felix Fietkau [Tue, 9 Nov 2010 14:12:42 +0000 (16:12 +0200)]
Add bridge handling for WDS STA interfaces

By default, add them to the configured bridge of the AP interface
(if present), but allow the user to specify a separate bridge.

13 years agonl80211: Fix AP VLAN handling for WDS STA reassociation
Felix Fietkau [Tue, 9 Nov 2010 14:03:05 +0000 (16:03 +0200)]
nl80211: Fix AP VLAN handling for WDS STA reassociation

When a STA reassociates, the AP VLAN interface is still present,
do not attempt to create it in that case.

13 years agoFix WDS STA reassociation
Felix Fietkau [Tue, 9 Nov 2010 01:44:02 +0000 (02:44 +0100)]
Fix WDS STA reassociation

If the STA entry is present in hostapd, but not in the kernel driver, its
WDS status needs to be restored when the STA reassociates

13 years agodriver_roboswitch: include net/if.h instead of linux/if.h
Felix Fietkau [Tue, 9 Nov 2010 01:38:58 +0000 (02:38 +0100)]
driver_roboswitch: include net/if.h instead of linux/if.h

including linux/if.h clashes with other header files on some systems

13 years agodriver_madwifi: fix a compile error on big endian systems
Felix Fietkau [Tue, 9 Nov 2010 01:38:36 +0000 (02:38 +0100)]
driver_madwifi: fix a compile error on big endian systems

13 years agoWPS: Add wildcard AuthorizedMACs entry for PBC
Jouni Malinen [Tue, 9 Nov 2010 09:24:06 +0000 (11:24 +0200)]
WPS: Add wildcard AuthorizedMACs entry for PBC

13 years agowlantest: Decrypt EAPOL-Key 3/4 Key Data
Jouni Malinen [Mon, 8 Nov 2010 22:39:43 +0000 (00:39 +0200)]
wlantest: Decrypt EAPOL-Key 3/4 Key Data

13 years agoAllow TSN AP to be selected when configured for WEP
Jouni Malinen [Mon, 8 Nov 2010 19:14:32 +0000 (21:14 +0200)]
Allow TSN AP to be selected when configured for WEP

Commit d8d940b7469e505aec4d71a02d3f7ebab412eeae introduced a regression
that prevented TSN APs from being used with WEP since the AP was
rejected if it advertised WPA or RSN IE when we were configured to use
WEP. Resolve this by checking whether the AP is advertising a TSN, i.e.,
whether the AP allows WEP to be used as a group cipher. If so, allow
the AP to be selected if we are configured to use static WEP or
IEEE 802.1X (non-WPA).

It should be noted that this is still somewhat more restricted in AP
selection than earlier wpa_supplicant branches (0.7.x or older) that
ignore the WPA/RSN IE completely when configured for non-WPA.

13 years agowlantest: Derive PMK from RADIUS exchange
Jouni Malinen [Sun, 7 Nov 2010 17:43:10 +0000 (19:43 +0200)]
wlantest: Derive PMK from RADIUS exchange

Decrypt MPPE keys and derive PMK from RADIUS exchange if RADIUS
shared secret is known. Use the derived PMK when trying to derive
PTK during 4-Way Handshake.

13 years agowlantest: Add capturing and parsing of RADIUS messages
Jouni Malinen [Sun, 7 Nov 2010 15:59:50 +0000 (17:59 +0200)]
wlantest: Add capturing and parsing of RADIUS messages

Another interface (-I) or pcap file (-R) can now be specified as a
source of RADIUS packets. These packets are now parsed, but the
MSK is not yet derived for PMK use.

13 years agowlantest: Fix LLC debug print
Jouni Malinen [Sun, 7 Nov 2010 09:31:11 +0000 (11:31 +0200)]
wlantest: Fix LLC debug print

13 years agowlantest: Add PTK derivation based on passphrases
Jouni Malinen [Sat, 6 Nov 2010 20:57:49 +0000 (22:57 +0200)]
wlantest: Add PTK derivation based on passphrases

Allow pre-configuration of passphrases (-p<passphrase>) to provide
enough information for wlantest to be able to derive PMK for each
BSS and PTK for each STA going through 4-Way Handshake (at least
message 2 and 3 needs to be received).

13 years agowlantest: Parse EAPOL-Key frames
Jouni Malinen [Sat, 6 Nov 2010 19:49:57 +0000 (21:49 +0200)]
wlantest: Parse EAPOL-Key frames

13 years agowlantest: Maintain a copy of WPA/RSN IE from (Re)AssocReq
Jouni Malinen [Sat, 6 Nov 2010 16:10:34 +0000 (18:10 +0200)]
wlantest: Maintain a copy of WPA/RSN IE from (Re)AssocReq

13 years agowlantest: Move Mgmt and Data frame processing into their own files
Jouni Malinen [Sat, 6 Nov 2010 16:01:24 +0000 (18:01 +0200)]
wlantest: Move Mgmt and Data frame processing into their own files

13 years agowlantest: Move bss_update() into bss.c
Jouni Malinen [Sat, 6 Nov 2010 15:57:21 +0000 (17:57 +0200)]
wlantest: Move bss_update() into bss.c

13 years agowlantest: Maintain STA state based on auth/assoc/deauth/disassoc
Jouni Malinen [Sat, 6 Nov 2010 15:55:27 +0000 (17:55 +0200)]
wlantest: Maintain STA state based on auth/assoc/deauth/disassoc

13 years agowlantest: Create station list for each BSS
Jouni Malinen [Sat, 6 Nov 2010 15:31:02 +0000 (17:31 +0200)]
wlantest: Create station list for each BSS

13 years agowlantest: Maintain table of BSS information
Jouni Malinen [Sat, 6 Nov 2010 15:11:12 +0000 (17:11 +0200)]
wlantest: Maintain table of BSS information

Whenever a Beacon or Probe Response frame is observed, add or update
a BSS entry to maintain current information about the active BSSes.

13 years agowlantest: Add preliminary version of IEEE 802.11 protocol testing tool
Jouni Malinen [Sat, 6 Nov 2010 14:20:45 +0000 (16:20 +0200)]
wlantest: Add preliminary version of IEEE 802.11 protocol testing tool

This tool can be used to capture IEEE 802.11 frames either from a
monitor interface for realtime capturing or from pcap files for
offline analysis. This version is only adding basic infrastructure for
going through the frames and parsing their headers.

13 years agoFix EAP standalone server
Jouni Malinen [Sun, 7 Nov 2010 14:25:35 +0000 (16:25 +0200)]
Fix EAP standalone server

Commit c3fc47ea8e1d3730e11eb9978d13831212727902 fixed EAP passthrough
server to allow Logoff/Re-authentication to be used. However, it
broke EAP standalone server while doing that. Fix this by reverting
the earlier fix and by clearing the EAP Identity information in the
EAP server code whenever an EAPOL-Start or EAPOL-Logoff packet is
received.

13 years agoeapol_test: Unregister EAP server methods if CONFIG_AP=y
Jouni Malinen [Sun, 7 Nov 2010 09:38:26 +0000 (11:38 +0200)]
eapol_test: Unregister EAP server methods if CONFIG_AP=y

This fixes a memory leak in CONFIG_AP=y builds.

13 years agoP2P: Clear off_channel_freq when requesting new remain-on-channel
Jouni Malinen [Fri, 5 Nov 2010 16:39:42 +0000 (18:39 +0200)]
P2P: Clear off_channel_freq when requesting new remain-on-channel

The driver may end up leaving the current channel when we request
a new remain-on-channel and as such, it is better not assume we can
start new operations like sending an Action frame on the previous
off-channel.

13 years agoP2P: Cancel pending remain-on-channel request when stopping Listen
Jouni Malinen [Fri, 5 Nov 2010 16:39:15 +0000 (18:39 +0200)]
P2P: Cancel pending remain-on-channel request when stopping Listen

If we have already asked the driver to start a new remain-on-channel,
we need to cancel it even if the actual remain-on-channel has not yet
started at the point when a new operation or timeout etc. triggers
Listen state to be stopped.

13 years agoP2P: Do not skip call to p2p_scan_res_handled()
Jouni Malinen [Fri, 5 Nov 2010 16:17:42 +0000 (18:17 +0200)]
P2P: Do not skip call to p2p_scan_res_handled()

Even if p2p_scan_res_handler() returns 1 to indicate that scan result
iteration should be stopped, the p2p_scan_res_handled() needs to be
called to clear p2p_scan_running and to get a callback that will start
any operations that were delayed because of the running scan.

13 years agoP2P: Drop pending TX frame on new p2p_connect
Jouni Malinen [Fri, 5 Nov 2010 16:17:20 +0000 (18:17 +0200)]
P2P: Drop pending TX frame on new p2p_connect

We need to drop the pending frame to avoid issues with the new GO
Negotiation, e.g., when the pending frame was from a previous attempt at
starting a GO Negotiation.

13 years agoRemove unused TX queue parameters related to Beacon frames
Jouni Malinen [Thu, 4 Nov 2010 23:23:17 +0000 (01:23 +0200)]
Remove unused TX queue parameters related to Beacon frames

These are not used by any driver wrapper, i.e., only the four
data queues (BK, BE, VI, VO) are configurable. Better remove these
so that there is no confusion about being able to configure
something additional.

13 years agoWPS: Send WSC_NACK if message without Message Type is received
Jouni Malinen [Thu, 4 Nov 2010 16:17:00 +0000 (18:17 +0200)]
WPS: Send WSC_NACK if message without Message Type is received

13 years agoWPS: Share common function for building WSC ACK/NACK
Jouni Malinen [Thu, 4 Nov 2010 16:16:14 +0000 (18:16 +0200)]
WPS: Share common function for building WSC ACK/NACK

These are identical functions in Enrollee and Registrar and there
is no need to maintain two copies of the same functionality.

13 years agoWPS: Do not advertise support for WEP in WPS 2.0 build
Jouni Malinen [Thu, 4 Nov 2010 15:37:20 +0000 (17:37 +0200)]
WPS: Do not advertise support for WEP in WPS 2.0 build

There is no point in advertising support for WEP or Shared Key
authentication if we are going to reject those anyway based on
WPS 2.0 rules.

13 years agoWPS: Remove PushButton from M1 ConfigMethods on AP
Jouni Malinen [Thu, 4 Nov 2010 15:29:48 +0000 (17:29 +0200)]
WPS: Remove PushButton from M1 ConfigMethods on AP

These config methods are for the Enrollee role, i.e., for adding
external Registrars, and as such, PushButton should not be claimed
to be supported.

13 years agonl80211: Allow libnl to be replaced with libnl-tiny
Jouni Malinen [Thu, 4 Nov 2010 15:14:58 +0000 (17:14 +0200)]
nl80211: Allow libnl to be replaced with libnl-tiny

CONFIG_LIBNL_TINY=y can be used to select libnl-tiny instead of
libnl.

13 years agoWPS: Comment out WEP configuration lines on reconfig
Jouni Malinen [Thu, 4 Nov 2010 15:02:16 +0000 (17:02 +0200)]
WPS: Comment out WEP configuration lines on reconfig

13 years agoP2P: Copy p2p_intra_bss setting to the group interface
Jouni Malinen [Thu, 4 Nov 2010 14:53:09 +0000 (16:53 +0200)]
P2P: Copy p2p_intra_bss setting to the group interface

This is needed to allow p2p_intra_bss take effect when using
separate group interfaces.

13 years agoP2P: Allow p2p_cancel to cancel P2P client that has not yet connected
Jouni Malinen [Thu, 4 Nov 2010 09:59:44 +0000 (11:59 +0200)]
P2P: Allow p2p_cancel to cancel P2P client that has not yet connected

This can now be used to cancel a P2P client interface that has not
yet completed the first 4-way handshake with a GO.

13 years agoP2P: Skip extra remain-on-channel if oper channel matches
Jouni Malinen [Tue, 2 Nov 2010 17:35:40 +0000 (19:35 +0200)]
P2P: Skip extra remain-on-channel if oper channel matches

There is no need to separately move to the correct channel
for transmitting an Action frame that is using the group
interface (i.e., source address is P2P Interface Address).
This removes extra latency from P2P Action frame operations
within a P2P group.

13 years agoWPS ER: Clear WPS state if PutMessage does not include NewOutMessage
Jouni Malinen [Tue, 2 Nov 2010 09:20:54 +0000 (11:20 +0200)]
WPS ER: Clear WPS state if PutMessage does not include NewOutMessage

This is needed to avoid getting stuck with pending WPS operation, e.g.,
when an AP replies to WSC_NACK with HTTP OK, but without following
message.

13 years agonl80211: Pass data frames from unknown STAs to hostapd
Helmut Schaa [Sun, 31 Oct 2010 19:36:43 +0000 (21:36 +0200)]
nl80211: Pass data frames from unknown STAs to hostapd

Pass data frames from unknown STAs to hostapd in order to reply with
a Deauthentication or Disassociation frame. This fixes compliance
with IEEE Std 802.11-2007, 11.3.

Furthermore, this does not cause a lot of overhead (at least with
mac80211 drivers) since mac80211 does not pass all data frames (but
at least from unauthenticated and unassociated STAs) to cooked monitor
interfaces.

Tested with rt2800pci on a MIPS board.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
13 years agoAdd ctrl_iface command 'GET version'
Jouni Malinen [Sun, 31 Oct 2010 15:07:31 +0000 (17:07 +0200)]
Add ctrl_iface command 'GET version'

This can be used to fetch the wpa_supplicant/hostapd version
string.

13 years agoAdd WPA_IGNORE_CONFIG_ERRORS option to continue in case of bad config
Dmitry Shmidt [Sun, 31 Oct 2010 10:38:49 +0000 (12:38 +0200)]
Add WPA_IGNORE_CONFIG_ERRORS option to continue in case of bad config

This is an option to continue with wpa_supplicant and hostapd even if
config file has errors. The problem is that these daemons are the best
"candidates" for the config change, so if they can not start because
config file was let's say corrupted, you can not fix it easily.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agoP2P: Fix random channel selection to use os_get_random
Jouni Malinen [Sun, 31 Oct 2010 10:27:37 +0000 (12:27 +0200)]
P2P: Fix random channel selection to use os_get_random

This could have been using an uninitialized variable instead of
purposefully random value in picking up the channel. There is not
much of a difference for the use case here, but anyway, we may
as well do what was initially planned here and.

13 years agoP2P: Reorder code to avoid memory leak on error path
Jouni Malinen [Sun, 31 Oct 2010 10:24:21 +0000 (12:24 +0200)]
P2P: Reorder code to avoid memory leak on error path

13 years agoFix copy-paste bug in p2p_serv_disc_resp handling
Jouni Malinen [Sun, 31 Oct 2010 10:17:30 +0000 (12:17 +0200)]
Fix copy-paste bug in p2p_serv_disc_resp handling

The destination address for p2p_serv_disc_resp must always be set
to an individual MAC address unlike p2p_serv_disc_req which may use
00:00:00:00:00:00 to indicate wildcard query. As such, we should not
try to check for this special case here.

13 years agoP2P: Add NULL pointer validation for ssid for group started event
Jouni Malinen [Sun, 31 Oct 2010 10:12:07 +0000 (12:12 +0200)]
P2P: Add NULL pointer validation for ssid for group started event

It looks likely that ssid is not NULL here, but better keep this
consistent with other uses of ssid pointer in this function.