Jouni Malinen [Fri, 19 Nov 2010 10:58:31 +0000 (12:58 +0200)]
P2P: Accept invitations to already running persistent group
We can automatically accept invitations that are for a persistent
group that is already running. There is no need to confirm this
separately or preparare a new group interface.
Jouni Malinen [Fri, 19 Nov 2010 10:58:03 +0000 (12:58 +0200)]
P2P: Stop p2p_find/p2p_listen when Invitation is accepted
When an Invitation to reinvoke a persistent group is accepted,
we need to make sure that any pending p2p_find or p2p_listen
operation gets stopped to avoid consuming all radio resources
doing device discovery while the group is being set up.
Jouni Malinen [Thu, 18 Nov 2010 22:35:13 +0000 (00:35 +0200)]
wlantest: Add preliminary infrastructure for injecting frames
This adds new commands for wlantest_cli to request wlantest to
inject frames. This version can only send out Authentication
frames and unprotected SA Query Request frames, but there is
now place to add more frames and encryption with future commits.
Jouni Malinen [Thu, 18 Nov 2010 10:42:02 +0000 (12:42 +0200)]
P2P: Indicate WPS events from AP mode only during group formation
The duplicated WPS event in the parent interface should only be used
during P2P group formation, i.e., when the WPS operation was actually
started using the parent interface. When authorizing a client to
connect to an already running group, the WPS command is issued on
the group interface and there is no need to duplicate the event to
the parent interface.
Jouni Malinen [Thu, 18 Nov 2010 10:41:27 +0000 (12:41 +0200)]
P2P: Make sure wpa_s->global->p2p_group_formation gets cleared
This pointer is now used in number of places to check whether an
interface is in P2P Group Formation, so we better make sure it gets
cleared when group formation has been completed. This was done in
only some of the cases.
Jouni Malinen [Wed, 17 Nov 2010 14:48:39 +0000 (16:48 +0200)]
WPS: Add special AP Setup Locked mode to allow read only ER
ap_setup_locked=2 can now be used to enable a special mode where
WPS ER can learn the current AP settings, but cannot change then.
In other words, the protocol is allowed to continue past M2, but
is stopped at M7 when AP is in this mode. WPS IE does not
advertise AP Setup Locked in this case to avoid interoperability
issues.
In wpa_supplicant, use ap_setup_locked=2 by default. Since the AP PIN
is disabled by default, this does not enable any new functionality
automatically. To allow the read-only ER to go through the protocol,
wps_ap_pin command needs to be used to enable the AP PIN.
Jouni Malinen [Tue, 16 Nov 2010 13:22:06 +0000 (15:22 +0200)]
P2P: Fix invitation-to-running-group handling
The pending_invite_ssid_id of -1 (running group, not persistent) was
being stored incorrectly in the group interface, not device interface
(i.e., parent of the group interface) and consequently, the incorrect
information was used when processing the Invitation Response.
If there was a persistent group credentials stored with network id
0, those were used instead to try to set up a persistent group
instead of using the already running group.
Albert Liu [Mon, 15 Nov 2010 14:16:39 +0000 (16:16 +0200)]
P2P: Update pending join interface address during scans
Since the P2P peer entry may not have been available at the time the
join request was issued, we need to allow the P2P Interface Address
to be updated during join-scans when the P2P peer entry for the GO
may be added.
Jouni Malinen [Mon, 15 Nov 2010 14:15:38 +0000 (16:15 +0200)]
P2P: Allow multiple scan runs to find GO for p2p_connect join
If the GO is not found, we cannot send Provisioning Discovery Request
frame and cannot really connect anyway. Since the Provisioning
Discovery is a mandatory part, it is better to continue join-scan
until the GO is found instead of moving to the next step where
normal connection scan is used (PD would not be used from there).
Use a limit of 10 scan attempts for p2p_connect join to avoid getting
in infinite loop trying to join. If the GO is not found with those
scans, indicate failure (P2P-GROUP-FORMATION-FAILURE) and stop the
join attempt.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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).