Commit Graph

2111 Commits

Author SHA1 Message Date
Jouni Malinen 3eaee4bf4b GAS server: Add support for ANQP Roaming Consortium list
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-26 22:53:16 +02:00
Jay Katabathuni dca30c3fb7 Interworking: Add GAS server support for AP mode
This adds GAS/ANQP implementation into hostapd. This commit brings in
the basic GAS/ANQP functionality, but only the ANQP Capability List
element is supported.

For testing purposes, hostapd control interface SET command can be used
to set the gas_frag_limit parameter dynamically.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-26 22:52:53 +02:00
Jay Katabathuni fb80e86e7d Add hostapd_drv_send_action()
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-26 22:52:37 +02:00
Jouni Malinen 6bcf537833 pcsc: Allow T1 protocol to be enabled
The previous implementation was hardcoding only T0 protocol to be
acceptable. Allow T1 to be selected, too.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-02-26 13:14:46 +02:00
Jouni Malinen f64adcd71e Allow PC/SC reader to be selected and initialized at start
New global configuration parameters pcsc_reader and pcsc_pin can now be
used to initialize PC/SC reader context at start of wpa_supplicant.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-02-26 13:09:30 +02:00
Jouni Malinen 3825a19bfa Generate random ANonce instead of one based on Counter
Definition of ANonce selection in IEEE Std 802.11i-2004 is somewhat
ambiguous. The Authenticator state machine uses a counter that is
incremented by one for each 4-way handshake. However, the security
analysis of 4-way handshake points out that unpredictable nonces help in
preventing precomputation attacks. Instead of the state machine
definition, use an unpredictable nonce value here to provide stronger
protection against potential precomputation attacks.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-02-26 12:06:36 +02:00
Jithu Jance e60b295186 Add wpa_supplicant AP mode STA deauthenticate/disassociate commands
Move disassociate and deauthenticate commands to ctrl_iface_ap.c, so
that they ares accessible for wpa_supplicant AP mode and wpa_cli (with
CONFIG_AP option enabled).

Signed-hostap: Jithu Jance <jithu@broadcom.com>
2012-02-25 17:22:48 +02:00
Jouni Malinen 974c56ac24 WPS UPnP: Clean up URL parser
Remove unnecessary second copy of the URL and too long memory
allocation. In addition, avoid use of strcpy() to keep static analyzers
happier.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-02-19 13:19:34 +02:00
Jouni Malinen 4a0d25f08a Android: Extend debug logging to include wpa_dbg and hexdump
This makes the Android debug logs from logcat quite a bit more helpful
in debugging wpa_supplicant.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-02-18 20:59:24 +02:00
Jouni Malinen 6d441b0da2 wext: Filter unexpected interface added/up events
It looks like a RTM_NEWLINK event claiming the interface to be UP is
delivered just before removing an interface after having first indicated
that the interface was going down/removed. Ignore this event if the
interface is not present anymore at the moment the event is processed.
This fixes issues where an interface that was re-added after being
removed did not get reconfigured properly.

Signed-hostap: Jouni Malinen <j@w1.fi>
intended-for: hostap-1
2012-02-18 13:28:21 +02:00
Jouni Malinen d1f4942ba1 nl80211: Filter unexpected interface added/up events
It looks like a RTM_NEWLINK event claiming the interface to be UP is
delivered just before removing an interface after having first indicated
that the interface was going down/removed. Ignore this event if the
interface is not present anymore at the moment the event is processed.
This fixes issues where an interface that was re-added after being
removed did not get reconfigured properly.

Signed-hostap: Jouni Malinen <j@w1.fi>
intended-for: hostap-1
2012-02-18 13:13:23 +02:00
Jouni Malinen 8a6a1e1b14 nl80211: Indicate p2p_probe in debug log as scan parameter
Signed-hostap: Jouni Malinen <j@w1.fi>
2012-02-18 12:39:01 +02:00
Jouni Malinen 0047c047fc EAP-SIM/AKA server: Fix re-authentication not to update pseudonym
AT_NEXT_PSEUDONYM is supposed to be included only in the Challenge
messages, not in the Re-authentication messages. This attribute was
incorrectly included in the Re-authentication messages and could have
been used to update the pseudonym state on the server without the peer
updating its state.

Signed-hostap: Jouni Malinen <j@w1.fi>
intended-for: hostap-1
2012-02-16 23:31:30 +02:00
Jouni Malinen 05c15c897d EAP-AKA peer: Clean up forgetting-id debug prints
Do not show forgetting of old id values if no value was stored.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-02-16 23:25:53 +02:00
Shan Palanisamy deca6eff74 atheros: Add new IEEE 802.11r driver_ops
Add support to send Action frames to the driver.
Add support for TSPEC req and adding STA node to the driver.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-16 19:57:33 +02:00
Shan Palanisamy e03c3069ba Clear WEP configuration on interface deinit
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-16 19:48:48 +02:00
Shan Palanisamy 4b8a59e40e Split hostapd_cleanup_iface() into two parts
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-16 19:47:54 +02:00
Shan Palanisamy ed53dec023 Split hostapd_cleanup() into two parts
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-16 19:47:14 +02:00
Jouni Malinen 07bcdbb150 Move hostapd_for_each_interface() and hapd_interfaces into src/ap
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-16 19:46:27 +02:00
Shan Palanisamy 9e7d033ef4 hostapd: Make sure ctrl_iface is not initialized multiple times
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-16 19:44:43 +02:00
Jouni Malinen 8b9d0bfa00 Add mechanism for disabling radio for testing purposes
"wpa_cli set radio_disabled 1/0" can be used to disable/enable
radio to simulate out-of-radio-range condition in a testbed
device.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-16 16:26:44 +02:00
Shan Palanisamy 56c2588aa8 atheros: Reset frame filter on deinit
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-16 16:25:07 +02:00
Jouni Malinen 0c01d65d6d Ignore TX status for Data frames from not associated STA
Commit d9a38716cc did this for
hostapd_eapol_tx_status() but missed the older hostapd_tx_status()
path. Address that case, too.

The TX status event may be received after a station has been
disassociated in cases where the disassociation is following a
transmission of a Data frame. Ignore such events if the STA is not
associated at the moment the event is being processed. This avoids
confusing debug entries and rescheduling of the EAPOL TX timeouts for
STAs that are still in the STA table, but are not really in active EAPOL
session.

Signed-hostap: Jouni Malinen <j@w1.fi>
intended-for: hostap-1
2012-02-14 21:04:14 +02:00
Jouni Malinen ff22d1e10e WPS: Fix clearing of SetSelectedRegistrar with multiple interfaces
The SetSelectedRegistrar timeout was registered for each registrar
instance, but the only context pointer (struct subscription *) was
shared with each registrar which resulted in the timeout getting
cancelled for some of the registrar instances before the selected
registrar (ER) information was cleared.

In addition, when an ER unsubscribed from receiving events, the
selected registrar information got cleared only from a single
registrar.

Fix these issues by registering a pointer to the registrar
instance in the timeout and by iterating over all UPnP interfaces
when removing a subscription.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-13 23:02:57 +02:00
Jouni Malinen 2624ed4311 eloop: Fix allocation failure handling in poll() version
eloop_sock_table_add_sock() needs to fail if pollfd array allocation
fails instead of returning success and leaving behind no buffer.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-02-12 21:33:42 +02:00
Antonio Quartulli e640888c5e IBSS RSN: Support authorization
In IBSS RSN cfg80211/mac80211 now waits for userspace to authorize new
stations. This patch makes wpa_supplicant notify the driver when a
station can be considered authorized.

Signed-hostap: Antonio Quartulli <ordex@autistici.org>
2012-02-12 21:12:22 +02:00
Ben Greear 2df4c4ef2f eloop: Support poll() in eloop
When using more than around 200 virtual stations, we start hitting the
max number of file descriptors supported by select(). This patch adds
support for poll(), which has no hard upper limit.

Signed-hostap: Ben Greear <greearb@candelatech.com>
2012-02-12 21:12:22 +02:00
Jouni Malinen 0f3d578efc Remove the GPL notification from files contributed by Jouni Malinen
Remove the GPL notification text from the files that were
initially contributed by myself.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-02-11 19:39:36 +02:00
Jouni Malinen e22d4d957b Remove the GPL notification from files contributed by Atheros
Remove the GPL notification text from files that were initially
contributed by Atheros Communications or Qualcomm Atheros.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-02-11 19:39:36 +02:00
Jouni Malinen 0dd1603c3f Remove the GPL notification from EAP-pwd implementation
Remove the GPL notification text from EAP-pwd implementation per
approval from Dan Harkins who contributed these files.
(email from Dan Harkins <dharkins@lounge.org> dated
Wed, 4 Jan 2012 16:25:48 -0800)

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-02-11 19:39:36 +02:00
Dan Harkins 5ea93947ca EAP-pwd: Add support for fragmentation
Signed-hostap: Dan Harkins <dharkins@lounge.org>
2012-02-11 12:46:30 +02:00
Dan Harkins a7cbb4753c EAP-pwd: Fix the argument name in compute_keys()
The parameters used here are confirm, not commit values.

Signed-hostap: Dan Harkins <dharkins@lounge.org>
2012-02-11 12:14:31 +02:00
Antonio Quartulli 78debc7529 Fix pmksa_cache_get() arguments in !IEEE80211_X_EAPOL builds
In case of !defined(IEEE8021X_EAPOL) the definition of the stub
pmksa_cache_get() in rsn_supp/pmksa_cache.h is not correct. This patch
adds the missing argument to the function definition to fix a
regression from commit 96efeeb66b.

Signed-hostap: Antonio Quartulli <ordex@autistici.org>
2012-02-11 10:45:24 +02:00
Jouni Malinen 59acfe87aa P2P: Avoid re-starting p2p_search in some corner cases
Search (p2p_scan) could already have been started at the point
remain-on-channel end event is being processed, e.g., if an Action frame
TX is reported immediately aftet the end of an earlier remain-on-channel
operation and the response frame is sent using an offchannel operation
while p2p_find is still in progress. Avoid trying to re-run p2p_scan
while the previous one is still running.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-09 12:49:36 +02:00
Jouni Malinen 165ec73053 P2P: Fix p2p_scan() error processing in p2p_search()
Commit 39185dfa54 changed the p2p_scan()
callback to return 1 in some cases, but forgot to change this p2p_scan()
call to handle that properly. Fix this by processing any non-zero value
as an error. This regression could leave the P2P module in state where
it believed a P2P scan was still running and refused to start some
operations until that scan gets completed (which would never happen
since it was not really started).

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-09 12:46:44 +02:00
Ganesh Prasadh 84751b98c1 WPS: Allow wildcard UUID PIN to be used twice
Previously, PINs that are added with a wildcard UUID were allowed to
be used only by a single Enrollee. However, there may be more than one
Enrollee trying to connect when an AP indicates that active Registrar
is present. As a minimal workaround, allow two Enrollees to try to use
the wildcard PIN. More complete extension could use timeout and allow
larger set of Enrollees to try to connect (while still keeping in mind
PIN disabling requirement after 10 failed attempts).

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-08 12:37:57 +02:00
Jouni Malinen 59c8500f18 P2P: Move p2p_add_device() prototype to correct header file
This was supposed to be an internal API to be used only within
src/p2p/*.c.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-07 16:26:20 +02:00
Jouni Malinen 0a70f34f22 P2P: Allow BSS entry to be fetched based on GO P2P Device Address
"BSS p2p_dev_addr=<P2P Device Address>" can now be used to fetch a
specific BSS entry based on the P2P Device Address of the GO to avoid
having to iterate through the full BSS table when an external program
needs to figure out whether a specific peer is currently operating as
a GO.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-02-07 16:23:21 +02:00
Johannes Berg e12b85d324 P2P: Remove unneeded go_neg_peer check from PD
When the GO negotiation peer is assigned, the state also cannot be IDLE,
SEARCH, or LISTEN_ONLY.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-02-05 19:05:45 +02:00
Jouni Malinen 96efeeb66b Use PMKSA cache entries with only a single network context
When looking for PMKSA cache entries to use with a new association, only
accept entries created with the same network block that was used to
create the cache entry.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-02-04 12:32:35 +02:00
Jouni Malinen c7bce24dc9 Clear EAPOL authenticator authFail for PMKSA caching/FT
This fixes a corner case where a STA that has PMKSA cache entry (or
valid FT keys) could try to use full EAPOL/EAP authentication and fail.
If the STA will then try to use the still valid PMKSA cache entry (or
FT) before the STA entry has been cleared, authFail could have been left
to TRUE. That will make EAPOL authenticator PAE state machine enter HELD
state even though authSuccess was already forced to TRUE. This results
in the STA getting disconnected even though it should be allowed to
continue with 4-way handshake. While this is unlikely to happen in
practice, it is better to get this fixed by clearing authFail when
setting authSuccess.

Signed-hostap: Jouni Malinen <j@w1.fi>
intended-for: hostap-1
2012-02-04 12:21:42 +02:00
Jouni Malinen d9a38716cc Ignore TX status for Data frames from not associated STA
The TX status event may be received after a stations has been
disassociated in cases where the disassociation is following a
transmission of a Data frame. Ignore such events if the STA is not
associated at the moment the event is being processed. This avoids
confusing debug entries and rescheduling of the EAPOL TX timeouts for
STAs that are still in the STA table, but are not really in active EAPOL
session.

Signed-hostap: Jouni Malinen <j@w1.fi>
intended-for: hostap-1
2012-02-04 12:18:56 +02:00
Jouni Malinen 32cdcf15b2 WPS: Disable AP PIN after 10 consecutive failures
While the exponential increase in the lockout period provides an
efficient mitigation mechanism against brute force attacks, this
additional trigger to enter indefinite lockout period (cleared by
restarting hostapd) will limit attacks even further by giving maximum of
10 attempts (without authorized user action) even in a very long term
attack.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-01-30 17:36:14 +02:00
Ben Greear 80e8a5eef1 Support HT capability overrides
This allows HT capabilities overrides on kernels that
support these features.

MCS Rates can be disabled to force to slower speeds when using HT.
Rates cannot be forced higher.

HT can be disabled, forcing an 802.11a/b/g/n station to act like
an 802.11a/b/g station.

HT40 can be disabled.

MAX A-MSDU can be disabled.
A-MPDU Factor and A-MPDU Density can be modified.

Please note that these are suggestions to the kernel. Only mac80211
drivers will work at all. The A-MPDU Factor can only be decreased and
the A-MPDU Density can only be increased currently.

Signed-hostap: Ben Greear <greearb@candelatech.com>
2012-01-29 21:01:31 +02:00
Jouni Malinen ad612c2ace nl80211: Sync with linux/nl80211.h in wireless-testing.git
Signed-hostap: Jouni Malinen <j@w1.fi>
2012-01-29 19:53:34 +02:00
Nicolas Cavallari 40d00d2bfe wpa_auth: Fix race in rejecting 4-way handshake for entropy
When there is not enough entropy and there are two station associating
at the same time, one of the stations will be rejected, but during
that rejection, the "reject_4way_hs_for_entropy" flag gets cleared. This
may allow the second station to avoid rejection and complete a 4-Way
Handshake with a GTK that will be cleared as soon as more entropy is
available and another station connects.

This reworks the logic to ban all 4-way handshakes until enough entropy
is available.

Signed-hostap: Nicolas Cavallari <cavallar@lri.fr>
2012-01-29 18:11:43 +02:00
Yogesh Ashok Powar 3dd1d8906d nl80211: Subscribe management frames for WPA_IF_AP_BSS types
In multiple BSSes scenario for the drivers that do not use
monitor interface and do not implement AP SME, RX MGMT
frame subscription happens only for the default bss (first_bss).

Subscribe for RX MGMT frames for such BSSes.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
2012-01-29 12:34:38 +02:00
Yogesh Ashok Powar a7a6af4cba nl80211: Derive frequency for BSSes other than the first
Commit e4fb216769 moved frequency
storage from driver struct to bss struct and is assigned in
wpa_driver_nl80211_set_freq. As this wpa_driver_nl80211_set_freq is
triggered only on the first_bss, bss->freq for other BSSes is never
being set to the correct value. This sends MLME frames on frequency zero
(initialized value of freq) for BSSes other than the first.

To fix this derive frequency value from first_bss.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
2012-01-29 12:34:32 +02:00
Nicolas Cavallari f31e19df3a wpa_debug: Support outputting hexdumps into syslog
This patch allows to log hexdumps into syslog.

This is useful when testing, as syslog's network logging
helps to collect debug outputs from several machines.

Signed-hostapd: Nicolas Cavallari <cavallar@lri.fr>
2012-01-29 12:13:43 +02:00
Simon Baatz 4ac384c596 EAP-AKA peer: Append realm when learning the pseudonym
The pseudonym identity should use a realm in environments where a realm is
used. Thus, the realm of the permanent identity is added to the pseudonym
username sent by the server.

Signed-hostap: Simon Baatz <gmbnomis@gmail.com>
2012-01-28 19:41:19 +02:00