]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
11 years agoFix AP mode default TXOP Limit values for AC_VI and AC_VO
Jouni Malinen [Mon, 17 Mar 2014 16:23:13 +0000 (18:23 +0200)] 
Fix AP mode default TXOP Limit values for AC_VI and AC_VO

These were previous set to 3.0 and 1.5 ms which ended up using values 93
and 46 in 36 usec inits. However, the default values for these are
actually defined as 3.008 ms and 1.504 ms (94/47) and those values are
also listed in the hostapd.conf example.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoTLS testing: Add new test cases for RSA-DHE primes
Jouni Malinen [Sun, 16 Mar 2014 10:28:49 +0000 (12:28 +0200)] 
TLS testing: Add new test cases for RSA-DHE primes

test-tls-4: Short 511-bit RSA-DHE prime
test-tls-5: Short 767-bit RSA-DHE prime
test-tls-6: Bogus RSA-DHE "prime" 15
test-tls-7: Very short 58-bit RSA-DHE prime in a long container
test-tls-8: Non-prime as RSA-DHE prime

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoTLS client: Reject RSA-DHE prime if it shorter than 768 bits
Jouni Malinen [Sun, 16 Mar 2014 10:27:52 +0000 (12:27 +0200)] 
TLS client: Reject RSA-DHE prime if it shorter than 768 bits

Such short primes cannot really be considered secure enough for
authentication purposes.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoTLS testing: Fix test_flags check for ApplData report
Jouni Malinen [Sun, 16 Mar 2014 08:59:17 +0000 (10:59 +0200)] 
TLS testing: Fix test_flags check for ApplData report

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: wpa_supplicant MIB command
Jouni Malinen [Sat, 15 Mar 2014 22:18:03 +0000 (00:18 +0200)] 
tests: wpa_supplicant MIB command

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: Supplicant-enforced PTK rekey
Jouni Malinen [Sat, 15 Mar 2014 22:13:23 +0000 (00:13 +0200)] 
tests: Supplicant-enforced PTK rekey

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: TDLS discovery
Jouni Malinen [Sat, 15 Mar 2014 22:03:07 +0000 (00:03 +0200)] 
tests: TDLS discovery

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: EAP TLS parameters using configuration blobs
Jouni Malinen [Sat, 15 Mar 2014 21:52:43 +0000 (23:52 +0200)] 
tests: EAP TLS parameters using configuration blobs

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoAllow config blobs to be set through ctrl_iface
Jouni Malinen [Sat, 15 Mar 2014 21:51:37 +0000 (23:51 +0200)] 
Allow config blobs to be set through ctrl_iface

"SET blob <name> <hexdump>" can now be used to set a configuration blob
through the wpa_supplicant control interface.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoACS: Fix VHT20
Michal Kazior [Fri, 28 Feb 2014 14:19:42 +0000 (15:19 +0100)] 
ACS: Fix VHT20

The center segment0 calculation for VHT20 ACS was incorrect. This caused
ACS to fail with: "Could not set channel for kernel driver".

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
11 years agotests: WPS AP PIN unlocking
Jouni Malinen [Sat, 15 Mar 2014 15:27:05 +0000 (17:27 +0200)] 
tests: WPS AP PIN unlocking

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: WPS AP configuration using external settings management
Jouni Malinen [Sat, 15 Mar 2014 15:21:05 +0000 (17:21 +0200)] 
tests: WPS AP configuration using external settings management

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: WPS PIN request file
Jouni Malinen [Sat, 15 Mar 2014 15:11:14 +0000 (17:11 +0200)] 
tests: WPS PIN request file

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: More HT40 co-ex scan cases
Jouni Malinen [Sat, 15 Mar 2014 14:11:45 +0000 (16:11 +0200)] 
tests: More HT40 co-ex scan cases

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoFix HT40 co-ex scan for some pri/sec channel switches
Jouni Malinen [Sat, 15 Mar 2014 14:42:29 +0000 (16:42 +0200)] 
Fix HT40 co-ex scan for some pri/sec channel switches

Secondary channel was compared incorrectly (-4/4 vs. actual channel
number) which broke matching neighboring 40 MHz BSSes and only the
no-beacons-on-secondary-channel rule was applied in practice. Once
sec_chan was fixed, this triggered another issue in this function where
both rules to switch pri/sec channels could end up getting applied in a
way that effectively canceled the switch.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: VLAN with tagged interface
Jouni Malinen [Sat, 15 Mar 2014 13:49:32 +0000 (15:49 +0200)] 
tests: VLAN with tagged interface

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: AP using inactivity poll/disconnect
Jouni Malinen [Sat, 15 Mar 2014 11:46:01 +0000 (13:46 +0200)] 
tests: AP using inactivity poll/disconnect

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: Go to listen state in go_neg_pin_authorized
Jouni Malinen [Sat, 15 Mar 2014 10:38:08 +0000 (12:38 +0200)] 
tests: Go to listen state in go_neg_pin_authorized

Previusly, the responding device was left in p2p_find state as a
consequence of using discover_peer() if the peer was not already known.
This was not the sequence that was supposed to be used here. Go to
listen-only state when waiting for the peer to initiate a previously
authorized GO Negotiation.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: RSN pre-authentication
Jouni Malinen [Sat, 15 Mar 2014 09:52:11 +0000 (11:52 +0200)] 
tests: RSN pre-authentication

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: WDS STA mode
Jouni Malinen [Sat, 15 Mar 2014 08:42:46 +0000 (10:42 +0200)] 
tests: WDS STA mode

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoRemove unused STA entry information
Jouni Malinen [Sat, 15 Mar 2014 07:57:10 +0000 (09:57 +0200)] 
Remove unused STA entry information

previous_ap and last_assoc_req were not really used for anything
meaninful, so get rid of them to reduce the size of per-STA memory
allocation.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: SAE mixed network and forced anti-clogging
Jouni Malinen [Sat, 15 Mar 2014 07:38:30 +0000 (09:38 +0200)] 
tests: SAE mixed network and forced anti-clogging

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: PeerKey attempt with unknown peer
Jouni Malinen [Fri, 14 Mar 2014 22:47:06 +0000 (00:47 +0200)] 
tests: PeerKey attempt with unknown peer

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoFix hostapd_add_iface error path to deinit partially initialized BSS
Jouni Malinen [Fri, 14 Mar 2014 19:10:47 +0000 (21:10 +0200)] 
Fix hostapd_add_iface error path to deinit partially initialized BSS

It was possible for the control interface and some of the BSS setup to
be left partially initialized in failure cases while the BSS structures
were still freed. Fix this by properly cleaning up anything that may
have passed initialization successfully before freeing memory.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoFix external radio_work deinit path
Jouni Malinen [Fri, 14 Mar 2014 18:33:56 +0000 (20:33 +0200)] 
Fix external radio_work deinit path

The radio_work type was stored within the dynamically allocated
wpa_radio_work buffer and that buffer ended up getting freed before the
final use of the type string within radio_work_done(). This resulted in
freed memory being used for a debug print. Avoid this by freeing the
wpa_external_work instance after having completed radio_work_done() for
the related work.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoAllow management group cipher to be configured
Jouni Malinen [Wed, 12 Mar 2014 18:26:37 +0000 (20:26 +0200)] 
Allow management group cipher to be configured

This allows hostapd to set a different management group cipher than the
previously hardcoded default BIP (AES-128-CMAC). The new configuration
file parameter group_mgmt_cipher can be set to BIP-GMAC-128,
BIP-GMAC-256, or BIP-CMAC-256 to select one of the ciphers defined in
IEEE Std 802.11ac-2013.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoP2P: Do not create another group interface on NFC Token enable
Manish Bansal [Fri, 14 Mar 2014 14:55:10 +0000 (16:55 +0200)] 
P2P: Do not create another group interface on NFC Token enable

If a group interface is present and the command was issued on the group
interface, enable the token for that interface instead of creating a new
one.

Signed-off-by: Manish <manish.bansal@broadcom.com>
11 years agowpa_supplicant: Apply VHT_OVERRIDES to wpas_start_assoc_cb()
Paul Stewart [Fri, 14 Mar 2014 04:33:43 +0000 (21:33 -0700)] 
wpa_supplicant: Apply VHT_OVERRIDES to wpas_start_assoc_cb()

A previous patch "Support VHT capability overrides" missed one
place where HT overrides were being applied and where it would
also be useful to apply VHT overrides.

Signed-hostap: Paul Stewart <pstew@chromium.org>

11 years agohostapd: Supply default parameters for OBSS scan
Paul Stewart [Wed, 12 Mar 2014 22:28:39 +0000 (15:28 -0700)] 
hostapd: Supply default parameters for OBSS scan

For some client OBSS implementations that are performed in
firmware, all OBSS parameters need to be set to valid values.
Do this, as well as supplying the "20/40 Coex Mgmt Support"
flag in the extended capabilities IE.

Signed-hostap: Paul Stewart <pstew@chromium.org>

11 years agoTDLS: Add get_capability tdls command
Dmitry Shmidt [Thu, 13 Mar 2014 22:12:38 +0000 (15:12 -0700)] 
TDLS: Add get_capability tdls command

Command returns info in format: UNSUPPORTED/INTERNAL/EXTERNAL

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
11 years agotests: Verify VHT20 with center freq seq0 set to zero
Johannes Berg [Fri, 14 Mar 2014 14:48:13 +0000 (16:48 +0200)] 
tests: Verify VHT20 with center freq seq0 set to zero

This was found through a mac80211 bug which didn't correctly accept a
center segment 0 value of zero, so the test will fail until the mac80211
bug is fixed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agohostapd: For VHT 20/40, allow center segment 0 to be zero
Johannes Berg [Fri, 14 Mar 2014 14:45:21 +0000 (16:45 +0200)] 
hostapd: For VHT 20/40, allow center segment 0 to be zero

The 802.11ac amendment specifies that that the center segment 0 field
is reserved, so it should be zero. Hostapd previously required it to
be set, which is likely a good idea for interoperability, but allow it
to be unset. However, don't allow it to be set to a random value, only
allow zero and the correct channel.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agotests: Static MAC ACL
Jouni Malinen [Thu, 13 Mar 2014 21:27:11 +0000 (23:27 +0200)] 
tests: Static MAC ACL

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: require_vht=1
Jouni Malinen [Thu, 13 Mar 2014 21:17:04 +0000 (23:17 +0200)] 
tests: require_vht=1

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: Use disable_dgaf=1 for more coverage
Jouni Malinen [Thu, 13 Mar 2014 21:14:08 +0000 (23:14 +0200)] 
tests: Use disable_dgaf=1 for more coverage

This runs one of the HS 2.0 test cases with DGAF disabled.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: RADIUS Disconnect-Request using CUI
Jouni Malinen [Thu, 13 Mar 2014 21:08:01 +0000 (23:08 +0200)] 
tests: RADIUS Disconnect-Request using CUI

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: WPS reconfiguration to open network
Jouni Malinen [Thu, 13 Mar 2014 20:56:07 +0000 (22:56 +0200)] 
tests: WPS reconfiguration to open network

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoGAS server: Remove incomplete remote ANQP processing
Jouni Malinen [Thu, 13 Mar 2014 19:12:39 +0000 (21:12 +0200)] 
GAS server: Remove incomplete remote ANQP processing

Some of the remote ANQP server concepts were introduces into gas_serv.c,
but these were not completed. Remote the unused implementation for now.
It can be added back if support for remote ANQP server is added at some
point.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: GAS with unknown advertisement protocol id
Jouni Malinen [Thu, 13 Mar 2014 18:58:14 +0000 (20:58 +0200)] 
tests: GAS with unknown advertisement protocol id

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: Verify hostapd ENABLE/DISABLE/ENABLE
Jouni Malinen [Thu, 13 Mar 2014 18:41:54 +0000 (20:41 +0200)] 
tests: Verify hostapd ENABLE/DISABLE/ENABLE

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: HS 2.0 subrem from control interface
Jouni Malinen [Thu, 13 Mar 2014 17:36:36 +0000 (19:36 +0200)] 
tests: HS 2.0 subrem from control interface

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: Per-station PSK with WPS
Jouni Malinen [Thu, 13 Mar 2014 11:28:31 +0000 (13:28 +0200)] 
tests: Per-station PSK with WPS

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoWPS: Extend per-station PSK to support ER case as well
Jouni Malinen [Thu, 13 Mar 2014 11:26:21 +0000 (13:26 +0200)] 
WPS: Extend per-station PSK to support ER case as well

When wpa_psk_file is used instead of wpa_psk/wpa_passphrase, each WPS
Enrollee was given a unique PSK. This did not work for the
station-as-Registrar case where ER would learn the current AP settings
instead of enrolling itself (i.e., when using the AP PIN instead of
station PIN). That case can be covered with a similar design, so
generate a per-device PSK when building M7 as an AP in wpa_psk_file
configuration.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: Verify PMF association comeback and STA initiated SA Query
Jouni Malinen [Wed, 12 Mar 2014 23:27:40 +0000 (01:27 +0200)] 
tests: Verify PMF association comeback and STA initiated SA Query

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agowpa_supplicant AP: Allow PMF to be enabled with ieee80211w
Jouni Malinen [Thu, 13 Mar 2014 16:00:08 +0000 (18:00 +0200)] 
wpa_supplicant AP: Allow PMF to be enabled with ieee80211w

The ieee80211w parameter was not previously copied to the hostapd BSS
structure from wpa_supplicant configuration, so PMF was practically
disabled. Allow it to be configured through the wpa_supplicant network
configuration block.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoAllow reason code to be specified for DEAUTH/DISASSOC test frame
Jouni Malinen [Wed, 12 Mar 2014 23:26:09 +0000 (01:26 +0200)] 
Allow reason code to be specified for DEAUTH/DISASSOC test frame

hostapd DEAUTHENTICATE and DISASSOCIATE control interface commands
accepted both a test=<0/1> and reason=<val> parameters, but these were
not supported in the same command as a combination. Move the code around
a bit to allow that as well since it can be helpful for automated test
scripts.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: VHT functionality
Jouni Malinen [Wed, 12 Mar 2014 11:56:08 +0000 (13:56 +0200)] 
tests: VHT functionality

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoTDLS: Use QoS info from WMM IE obtained in TDLS frames
Sunil Dutt [Mon, 10 Feb 2014 07:02:32 +0000 (12:32 +0530)] 
TDLS: Use QoS info from WMM IE obtained in TDLS frames

TDLS Setup Request/Response frames from the peers include the WMM IE,
hence parse the same and consider the QoS Info from the WMM IE. The
qos_info obtained in the WMM IE overwrites the one obtained through
WLAN_EID_QOS attribute.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoFix CONFIG_NO_SCAN_PROCESSING=y build
Jouni Malinen [Wed, 12 Mar 2014 19:31:46 +0000 (21:31 +0200)] 
Fix CONFIG_NO_SCAN_PROCESSING=y build

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoP2P: Report dev_found event (if not yet done) from GO Neg Req RX
Sunil Dutt Undekari [Thu, 6 Mar 2014 14:15:27 +0000 (19:45 +0530)] 
P2P: Report dev_found event (if not yet done) from GO Neg Req RX

p2p_find removes P2P_DEV_REPORTED flag from every existing P2P peer
entry. Thus, if a GO Negotiation Request frame is received before the
peer is re-discovered based on Probe Response frame, report
P2P-DEVICE-FOUND indication prior to the P2P-GO-NEG-REQUEST similarly to
how this is done the first time the peer is found.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: TKIP countermeasures
Jouni Malinen [Wed, 12 Mar 2014 15:58:27 +0000 (17:58 +0200)] 
tests: TKIP countermeasures

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: Check for AP-DISABLED when setting up AP
Jouni Malinen [Wed, 12 Mar 2014 11:35:10 +0000 (13:35 +0200)] 
tests: Check for AP-DISABLED when setting up AP

This allows a critical error to be noticed more quickly and reported
more clearly in the test log.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoMark AP disabled if initialization steps fail
Jouni Malinen [Wed, 12 Mar 2014 11:33:22 +0000 (13:33 +0200)] 
Mark AP disabled if initialization steps fail

Previously, some of the last initialization steps could fail without
clearly marking the interface disabled. For example, configuring the
channel to the driver could fail, but hostapd would not clearly identify
as the interface not being in functional state apart from not moving it
to the ENABLED state. Send an AP-DISABLED event and mark interface state
DISABLED if such a setup operation fails.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: Wait longer for hostapd REMOVE command to complete
Jouni Malinen [Wed, 12 Mar 2014 09:42:59 +0000 (11:42 +0200)] 
tests: Wait longer for hostapd REMOVE command to complete

Some kernel debugging options (especially
CONFIG_DEBUG_KOBJECT_RELEASE=y) can add significant blocking time to
interface removal with NL80211_CMD_DEL_INTERFACE and
SIOCGIFBR(BRCTL_DEL_BRIDGE) block for 1-8 seconds. This could result in
the VLAN test cases failing due to a wpaspy timeout on the REMOVE
command even though the issue was only in the kernel debugging code
making the operations significantly slower. Work around this by using a
longer timeout for that control interface command to allow this type of
debug kernel to be used.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoHS 2.0R2: Add parse_cert command for debugging purposes
Jouni Malinen [Tue, 11 Mar 2014 22:29:36 +0000 (00:29 +0200)] 
HS 2.0R2: Add parse_cert command for debugging purposes

This hs20-osu-client client command can be used to parse a DER encoded
X.509v3 certificate with the logotype extensions and
id-wfa-hotspot-friendlyName values shown in detail.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoHS 2.0R2: Add OSU client implementation
Jouni Malinen [Thu, 28 Mar 2013 08:27:27 +0000 (10:27 +0200)] 
HS 2.0R2: Add OSU client implementation

This adds a reference implementation of Hotspot 2.0 Release 2 OSU
client. While this implements all of the required functionality, it is
likely that a significant extensions would be used to integrate this
with user interfaces and operating system configuration components.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoAdd os_file_exists()
Jouni Malinen [Thu, 28 Mar 2013 08:38:17 +0000 (10:38 +0200)] 
Add os_file_exists()

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoHS 2.0R2: Add wrapper functions for libcurl
Jouni Malinen [Thu, 28 Mar 2013 08:23:12 +0000 (10:23 +0200)] 
HS 2.0R2: Add wrapper functions for libcurl

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoHS 2.0R2: Add wrapper functions for libxml2
Jouni Malinen [Thu, 28 Mar 2013 08:23:12 +0000 (10:23 +0200)] 
HS 2.0R2: Add wrapper functions for libxml2

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoHS 2.0R2: Add wrapper for system browser
Jouni Malinen [Wed, 9 Oct 2013 22:30:32 +0000 (15:30 -0700)] 
HS 2.0R2: Add wrapper for system browser

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoHS 2.0R2: Add wrapper for wpadebug browser on Android
Jouni Malinen [Tue, 6 Aug 2013 15:29:43 +0000 (18:29 +0300)] 
HS 2.0R2: Add wrapper for wpadebug browser on Android

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoHS 2.0R2: Add wrapper for Android browser for user interaction
Jouni Malinen [Tue, 30 Apr 2013 18:47:24 +0000 (21:47 +0300)] 
HS 2.0R2: Add wrapper for Android browser for user interaction

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoHS 2.0R2: Add wrapper functions for WebKit
Jouni Malinen [Thu, 28 Mar 2013 08:23:12 +0000 (10:23 +0200)] 
HS 2.0R2: Add wrapper functions for WebKit

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoAdd wpa_ctrl helper functions for upper level functionality
Jouni Malinen [Thu, 28 Mar 2013 08:19:33 +0000 (10:19 +0200)] 
Add wpa_ctrl helper functions for upper level functionality

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoClean up hostapd_config_fill() parsers
Jouni Malinen [Tue, 11 Mar 2014 20:55:39 +0000 (22:55 +0200)] 
Clean up hostapd_config_fill() parsers

Some of the parsing code was using a bit too complex design and could be
simplified after the earlier return-on-error cleanups.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoFix memory leaks on wpa_config_parse_string() error paths
Jouni Malinen [Tue, 11 Mar 2014 20:41:12 +0000 (22:41 +0200)] 
Fix memory leaks on wpa_config_parse_string() error paths

hostapd configuration parser did not free the temporary buffer on some
error paths.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoSimplify hostapd_config_fill() error reporting
Jouni Malinen [Tue, 11 Mar 2014 20:35:39 +0000 (22:35 +0200)] 
Simplify hostapd_config_fill() error reporting

There is no need for trying to count the number of errors in this
function since this is not a loop anymore and the return value will be
either 0 or 1.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoRemove extra indentation level from hostapd_config_fill()
Jouni Malinen [Tue, 11 Mar 2014 20:25:46 +0000 (22:25 +0200)] 
Remove extra indentation level from hostapd_config_fill()

The configuration file parsing routines were moved to a separate
function a while back, but left at the old indentation level to avoid
showing large diffs in the commit and to avoid conflicts with parallel
development in other branches. There is never a perfect time for this
type of changes, but we might as well finally get rid of that extra
indentation now with Hotspot 2.0 Rel 2 changes pulled in.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: Verify reassociate-to-same-BSS commands
Jouni Malinen [Tue, 11 Mar 2014 18:08:18 +0000 (20:08 +0200)] 
tests: Verify reassociate-to-same-BSS commands

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agonl80211: Hide deauth event due to forced deauth-during-auth
Jouni Malinen [Tue, 11 Mar 2014 18:02:23 +0000 (20:02 +0200)] 
nl80211: Hide deauth event due to forced deauth-during-auth

If NL80211_CMD_AUTHENTICATE fails due to exiting authentication, forced
deauthentication is used to clear cfg80211 start and a new
authentication command is retried. This resulted in an extra
disconnection event getting delivered to the core wpa_supplicant code
and that could end up confusing state there, e.g., by clearing
connection parameters like wpa_s->key_mgmt and preventing the following
association from reaching proper COMPLETED state with open networks.

Fix this by hiding the unnecessary disconnection event when using the
deauth-for-auth workaround.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoAdd a reattach command for fast reassociate-back-to-same-BSS
Peter Qiu [Thu, 6 Mar 2014 18:06:04 +0000 (10:06 -0800)] 
Add a reattach command for fast reassociate-back-to-same-BSS

Add "reattach" command to perform single-channel single-ssid scan
instead of full scan when trying to reconnect to the currently
"connected" network (assuming old scan results are not current enough to
skip the scan completely). This allows the scan result to come back in
much faster time. In ath9k, the scan took around 12 seconds with full
background scan, and only 0.1 second with the single-channel single-ssid
scan. Thus, take much less time for the client to re-establish
connection with the currently "connected" network.

Signed-hostap: Peter Qiu <zqiu@chromium.org>

11 years agohostapd: Document interworking realm EAP Method types
Ben Greear [Thu, 6 Mar 2014 00:19:58 +0000 (16:19 -0800)] 
hostapd: Document interworking realm EAP Method types

Add link to the EAP type definitions document.

Signed-hostap: Ben Greear <greearb@candelatech.com>

11 years agoDFS: Add extra debugging messages
Ben Greear [Thu, 6 Mar 2014 00:19:53 +0000 (16:19 -0800)] 
DFS: Add extra debugging messages

This might help someone realize why their hostapd config isn't working
properly.

Signed-off-by: Ben Greear <greearb@candelatech.com>
11 years agowpa_supplicant: Put upper bound on initial scan time delay
Ben Greear [Thu, 6 Mar 2014 00:19:49 +0000 (16:19 -0800)] 
wpa_supplicant: Put upper bound on initial scan time delay

This makes stations associate much faster when using lots of stations.
In addition, this avoids delaying the initial scan continuously for
dynamic interface removal/addition cases.

Signed-hostap: Ben Greear <greearb@candelatech.com>

11 years agonl80211: Fix P2P Device handling when starting with RF-kill blocked
Moshe Benji [Mon, 3 Mar 2014 12:53:21 +0000 (14:53 +0200)] 
nl80211: Fix P2P Device handling when starting with RF-kill blocked

On RF-kill, we should not request the kernel to start a P2P device. In
addition, we should call i802_set_iface_flags() both for a P2P Device
interface and any other interface instead of calling a dedicated
function for each.

Signed-off-by: Moshe Benji <Moshe.Benji@intel.com>
11 years agoPNO: Change sched_scan_stopped event to handle pending PNO properly
Alexander Bondar [Wed, 26 Feb 2014 06:04:11 +0000 (08:04 +0200)] 
PNO: Change sched_scan_stopped event to handle pending PNO properly

When a sched_scan_stopped event is received and there is a pending PNO,
it used regular scheduled scan parameters instead of PNO specific
parameters. Change it by calling wpas_start_pno().

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
11 years agoPNO: Move and rename pno_start()/pno_stop()
Alexander Bondar [Wed, 26 Feb 2014 06:04:10 +0000 (08:04 +0200)] 
PNO: Move and rename pno_start()/pno_stop()

Move pno_start() and pno_stop() to scan.c as a more relevant location
and rename them to wpas_start_pno()/wpas_stop_pno().

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
11 years agotests: Fix trace parameter invocation
Eduardo Abinader [Tue, 25 Feb 2014 21:27:03 +0000 (17:27 -0400)] 
tests: Fix trace parameter invocation

If trace-cmd command does not exist, run-tests.py could end up hanging
in a loop waiting for input. Fix this simply by checking whether the
trace-cmd command can be executed sucessfully and exiting the script if
not.

Signed-off-by: Eduardo Abinader <eduardo.abinader@openbossa.org>
11 years agohostapd: Process management frames only once per BSS
Simon Wunderlich [Mon, 10 Feb 2014 15:04:17 +0000 (16:04 +0100)] 
hostapd: Process management frames only once per BSS

At least in nl80211, broadcast management frames like Probe Request
frames, may be processed multiple times per BSS if multi-BSS is active
and NL80211_CMD_FRAME event is used to deliver them. In the case of
Probe Request frames, hostapd will create multiple redundant Probe
Response frames which are problematic when many BSS are on one channel.

This problem is caused by driver_nl80211 generating an event for
wpa_supplicant_event() for each BSS, and hostapd_mgmt_rx() calls
ieee802_11_mgmt() for each BSS, too.

Fix this by processing broadcast events only for the BSS the driver
intended to. The behavior is not changed for drivers not setting a BSS.

Signed-hostap: Simon Wunderlich <simon@open-mesh.com>

11 years agohostapd: Allow to switch to usable DFS channels
Simon Wunderlich [Thu, 6 Feb 2014 18:30:39 +0000 (19:30 +0100)] 
hostapd: Allow to switch to usable DFS channels

If channels are "available", change to "usable" DFS channels as a
fallback, too. This requires CAC, but it is still better to do that
instead of stopping service completely.

Signed-hostap: Simon Wunderlich <sw@simonwunderlich.de>

11 years agohostapd: Allow to switch to DFS channels if available
Simon Wunderlich [Thu, 6 Feb 2014 18:30:38 +0000 (19:30 +0100)] 
hostapd: Allow to switch to DFS channels if available

If DFS channels are marked as "available", an AP can switch to them
immediately without performing CAC. Therefore, the channel selection
function should consider these channels even though these are radar
channels.

Signed-hostap: Simon Wunderlich <sw@simonwunderlich.de>

11 years agohostapd: Add config option chanlist for DFS channels
Simon Wunderlich [Thu, 6 Feb 2014 18:30:37 +0000 (19:30 +0100)] 
hostapd: Add config option chanlist for DFS channels

Different channels allow different transmission power, at least in ETSI
countries. Also, ETSI requires a "channel plan" for DFS operation, and
channels should be randomly choosen from these channels.

Add a channel list configuration option for users to add channels
hostapd may pick from.

Signed-hostap: Simon Wunderlich <sw@simonwunderlich.de>

11 years agotests: Fix trace-cmd output for host case
Jouni Malinen [Tue, 11 Mar 2014 15:04:33 +0000 (17:04 +0200)] 
tests: Fix trace-cmd output for host case

Both the output file path and the current working directory included the
log directory and this failed if log directory was not absolute (e.g.,
when using the default logs/current in the case a VM is not used).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoUse internal FIPS 186-2 PRF if needed
Jouni Malinen [Tue, 11 Mar 2014 14:33:05 +0000 (16:33 +0200)] 
Use internal FIPS 186-2 PRF if needed

Previously, EAP-SIM/AKA/AKA' did not work with number of crypto
libraries (GnuTLS, CryptoAPI, NSS) since the required FIPS 186-2 PRF
function was not implemented. This resulted in somewhat confusing error
messages since the placeholder functions were silently returning an
error. Fix this by using the internal implementation of FIP 186-2 PRF
(including internal SHA-1 implementation) with crypto libraries that do
not implement this in case EAP-SIM/AKA/AKA' is included in the build.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: Fix reporting of skipped cipher suite tests
Jouni Malinen [Tue, 11 Mar 2014 13:03:38 +0000 (15:03 +0200)] 
tests: Fix reporting of skipped cipher suite tests

The return value was lost and GCMP, CCMP-256, and GCMP-256 test cases
were reporting PASS instead of SKIP.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoFix PTK derivation for CCMP-256 and GCMP-256
Jouni Malinen [Tue, 11 Mar 2014 13:00:09 +0000 (15:00 +0200)] 
Fix PTK derivation for CCMP-256 and GCMP-256

Incorrect PTK length was used in PMK-to-PTK derivation and the Michael
MIC TX/RX key swapping code was incorrectly executed for these ciphers
on supplicant side.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agonl80211: Add debug print of KEY_DATA and KEY_SEQ
Jouni Malinen [Tue, 11 Mar 2014 12:59:15 +0000 (14:59 +0200)] 
nl80211: Add debug print of KEY_DATA and KEY_SEQ

While these were already available from elsewhere in the debug log, it
is convenient to have the values also available at the location where
the actual nl80211 command is issued.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: HS 2.0 session information URL
Jouni Malinen [Mon, 10 Mar 2014 09:34:31 +0000 (11:34 +0200)] 
tests: HS 2.0 session information URL

Verify that session information is stored from Access-Accept and sent to
the station at the requested timeout. Verify that station processes this
notification.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: RADIUS Class attribute
Jouni Malinen [Mon, 10 Mar 2014 09:16:29 +0000 (11:16 +0200)] 
tests: RADIUS Class attribute

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: RADIUS attributes in Access-Request and Accounting-Request
Jouni Malinen [Mon, 10 Mar 2014 09:05:48 +0000 (11:05 +0200)] 
tests: RADIUS attributes in Access-Request and Accounting-Request

This verifies that hostapd can add extra RADIUS attributes using
radius_auth_req_attr and radius_acct_req_attr.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: hostapd as P2P Device manager
Jouni Malinen [Mon, 10 Mar 2014 08:58:01 +0000 (10:58 +0200)] 
tests: hostapd as P2P Device manager

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: Set country code and use 5 GHz band
Jouni Malinen [Mon, 10 Mar 2014 08:49:49 +0000 (10:49 +0200)] 
tests: Set country code and use 5 GHz band

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: hostapd adding vendor elements to Beacon/Probe Response frames
Jouni Malinen [Mon, 10 Mar 2014 08:42:41 +0000 (10:42 +0200)] 
tests: hostapd adding vendor elements to Beacon/Probe Response frames

This verifies that the configuration parameter vendor_elements works
correctly.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: hostapd control interface - STATUS commands
Jouni Malinen [Mon, 10 Mar 2014 08:39:23 +0000 (10:39 +0200)] 
tests: hostapd control interface - STATUS commands

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoRemove unused hostapd_wep_key_cmp()
Jouni Malinen [Mon, 10 Mar 2014 08:27:58 +0000 (10:27 +0200)] 
Remove unused hostapd_wep_key_cmp()

The only user was removed five years ago in commit
fb6d3575322369f33693a52d8e57759f6856ca9d.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: PMKSA cache and Chargeable-User-Identity
Jouni Malinen [Sun, 9 Mar 2014 22:51:14 +0000 (00:51 +0200)] 
tests: PMKSA cache and Chargeable-User-Identity

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoFix error path handling on radius_accept_attr
Jouni Malinen [Sun, 9 Mar 2014 22:44:26 +0000 (00:44 +0200)] 
Fix error path handling on radius_accept_attr

This error path must not try to free the user entry since that entry was
already added to the BSS list and will be freed when BSS is freed.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: Displayable message in EAP Request-Identity
Jouni Malinen [Sun, 9 Mar 2014 22:27:15 +0000 (00:27 +0200)] 
tests: Displayable message in EAP Request-Identity

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: Authenticator-initiated EAP reauthentication
Jouni Malinen [Sun, 9 Mar 2014 22:18:49 +0000 (00:18 +0200)] 
tests: Authenticator-initiated EAP reauthentication

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoTLS testing: Allow hostapd to be used as a TLS testing tool
Jouni Malinen [Sat, 1 Mar 2014 22:43:59 +0000 (00:43 +0200)] 
TLS testing: Allow hostapd to be used as a TLS testing tool

The internal TLS server implementation and RADIUS server implementation
in hostapd can be configured to allow EAP clients to be tested to
perform TLS validation steps correctly. This functionality is not
included in the default build; CONFIG_TESTING_OPTIONS=y in
hostapd/.config can be used to enable this.

When enabled, the RADIUS server will configure special TLS test modes
based on the received User-Name attribute value in this format:
<user>@test-tls-<id>.<rest-of-realm>. For example,
anonymous@test-tls-1.example.com. When this special format is used, TLS
test modes are enabled. For other cases, the RADIUS server works
normally.

The following TLS test cases are enabled in this commit:
1 - break verify_data in the server Finished message
2 - break signed_params hash in ServerKeyExchange
3 - break Signature in ServerKeyExchange

Correctly behaving TLS client must abort connection if any of these
failures is detected and as such, shall not transmit continue the
session.

Signed-off-by: Jouni Malinen <j@w1.fi>