]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
7 years agotests: WPA2-PSK-FT AP Reassociation Request frame processing
Jouni Malinen [Sun, 19 Feb 2017 09:55:51 +0000 (11:55 +0200)] 
tests: WPA2-PSK-FT AP Reassociation Request frame processing

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: WPA2-PSK-FT AP and RIC
Jouni Malinen [Sat, 18 Feb 2017 19:15:30 +0000 (21:15 +0200)] 
tests: WPA2-PSK-FT AP and RIC

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFT: Support addition of RIC elements into Reassociation Request frame
Jouni Malinen [Sat, 18 Feb 2017 19:14:10 +0000 (21:14 +0200)] 
FT: Support addition of RIC elements into Reassociation Request frame

The new "SET ric_ies <hexdump>" control interface command can now be
used to request wpa_supplicant to add the specified RIC elements into
Reassociation Request frame when using FT protocol. This is mainly for
testing purposes.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoMark RSN msg 1/2 key data debug dump as key material
Jouni Malinen [Fri, 17 Feb 2017 09:35:35 +0000 (11:35 +0200)] 
Mark RSN msg 1/2 key data debug dump as key material

This debug print can include GTK and IGTK, so use wpa_hexdump_key()
instead of wpa_hexdump() for it to avoid undesired exposure of keys in
debug log.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Renew expired server certificates
Jouni Malinen [Sat, 18 Feb 2017 19:38:42 +0000 (21:38 +0200)] 
tests: Renew expired server certificates

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFILS: Fix PMK length for initial connection with FILS SHA384 AKM
Jouni Malinen [Thu, 16 Feb 2017 19:18:18 +0000 (21:18 +0200)] 
FILS: Fix PMK length for initial connection with FILS SHA384 AKM

While the FILS authentication cases were already using the proper PMK
length (48 octets instead of the old hardcoded 32 octet), the initial
association case had not yet been updated to cover the new FILS SHA384
AKM and ended up using only a 32-octet PMK. Fix that to use 48-octet PMK
when using FILS SHA384 AKM.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Fix ifdef for PTK derivation with SHA384-based AKM
Jouni Malinen [Thu, 16 Feb 2017 19:12:40 +0000 (21:12 +0200)] 
FILS: Fix ifdef for PTK derivation with SHA384-based AKM

sha384_prf() is used both with Suite B and FILS, so add CONFIG_FILS as
another alternative to building in this functionality.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Add HMAC-SHA256 and HMAC-SHA384 test vectors from RFC 4231
Jouni Malinen [Thu, 16 Feb 2017 18:40:02 +0000 (20:40 +0200)] 
tests: Add HMAC-SHA256 and HMAC-SHA384 test vectors from RFC 4231

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAdd HMAC-SHA384 with internal crypto
Jouni Malinen [Thu, 16 Feb 2017 18:37:19 +0000 (20:37 +0200)] 
Add HMAC-SHA384 with internal crypto

This is a copy of the internal HMAC-SHA256 implementation with the hash
block size and output length updated to match SHA384 parameters.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoOpenSSL: Fix hmac_sha384_vector() implementation
Jouni Malinen [Thu, 16 Feb 2017 18:38:09 +0000 (20:38 +0200)] 
OpenSSL: Fix hmac_sha384_vector() implementation

The output length was incorrect (32 from the copy-pasted SHA256
version). Fix this to return the correct number of octets (48) for
SHA384. This fixes incorrect key derivation in FILS when using the
SHA384-based AKM.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Enable SO_REUSEADDR for FILS HLP testing sockets
Jouni Malinen [Thu, 16 Feb 2017 18:58:07 +0000 (20:58 +0200)] 
tests: Enable SO_REUSEADDR for FILS HLP testing sockets

This is needed to avoid "Address already in use" issues in some test
sequences.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agobrowser-wpadebug: Send HTTP response with HTTP/1.1 header
Purushottam Kushwaha [Thu, 16 Feb 2017 06:22:46 +0000 (11:52 +0530)] 
browser-wpadebug: Send HTTP response with HTTP/1.1 header

HTTP response was previously sent as a plaintext without the HTTP header
on port 12345. By default Android webview/Chrome assumes plaintext as
HTTP/0.9 data. Android webview/Chrome has removed support of HTTP/0.9
request/response on non-standard ports, i.e., other than port 80. This
results in error while opening URL 'http://localhost:12345/'.

Fix this by prefixing the HTTP response with the HTTP/1.1 header.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: WNM BSS Transition Management with RSN
Jouni Malinen [Thu, 16 Feb 2017 11:33:45 +0000 (13:33 +0200)] 
tests: WNM BSS Transition Management with RSN

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: P2P channel selection with driver frequency preference list
Jouni Malinen [Wed, 15 Feb 2017 14:06:41 +0000 (16:06 +0200)] 
tests: P2P channel selection with driver frequency preference list

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoP2P: Verify local driver preferred frequencies for P2P use cases
Jouni Malinen [Thu, 16 Feb 2017 09:42:47 +0000 (11:42 +0200)] 
P2P: Verify local driver preferred frequencies for P2P use cases

Previously the peer operating channel preference was accepted if the
indicated frequency was listed in the local preference list from the
driver. This was assuming that the driver included only channels that
are currently enabled for GO operation. Since that might not be the
case, filter the local preference list by doing an explicit validation
of the indicated channels for P2P support.

This moves the similar validation steps from two other code paths in
p2p_check_pref_chan_recv() and p2p_check_pref_chan_no_recv() into a
common filtering step in p2p_check_pref_chan() for all three cases.

This avoids issues to start the GO in cases where the preferred
frequency list from the driver may include channels that are not
currently enabled for P2P GO use (e.g., 5 GHz band in world roaming
configuration).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoP2P: Add P2P_SET override_pref_op_chan to allow overriding preference
Jouni Malinen [Wed, 15 Feb 2017 14:07:13 +0000 (16:07 +0200)] 
P2P: Add P2P_SET override_pref_op_chan to allow overriding preference

This new P2P_SET parameter uses <op_class>:<channel> format and is used
mainly for testing purposes to allow overriding the value of the GO
Negotiation Response frame Operating Channel attribute.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: wpa_supplicant get_pref_freq_list_override
Jouni Malinen [Wed, 15 Feb 2017 13:41:17 +0000 (15:41 +0200)] 
tests: wpa_supplicant get_pref_freq_list_override

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAdd wpa_supplicant SET get_pref_freq_list_override
Jouni Malinen [Wed, 15 Feb 2017 13:38:59 +0000 (15:38 +0200)] 
Add wpa_supplicant SET get_pref_freq_list_override

This can be used to override driver get_pref_freq_list() operation for
more convenient testing of preferred frequency list functionality.

Override string format:
<if_type1>:<freq1>,<freq2>,... <if_type2>:...

if_type: 0=STATION, 2=AP, 3=P2P_GO, 4=P2P_CLIENT, 8=TDLS, 9=IBSS

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoUse throughput estimate-based BSS selection with larger SNR difference
Jouni Malinen [Thu, 16 Feb 2017 09:09:04 +0000 (11:09 +0200)] 
Use throughput estimate-based BSS selection with larger SNR difference

Previously, the est_throughput comparison was done only when SNR
difference was less than 5 dB. Since the throughput estimation take into
account SNR, this can be done in more cases. For now, add a conservative
2 dB more to the difference so that any SNR difference below 7 dB
results in BSS selection based on throughput estimates.

In addition, the throughput estimates require SNR values to be
available, so separate this from the 5 GHz preference that can be done
based on either SNR or qual values.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoDrop GREAT_SNR definition from 30 to 25 dB
Jouni Malinen [Thu, 16 Feb 2017 09:07:12 +0000 (11:07 +0200)] 
Drop GREAT_SNR definition from 30 to 25 dB

This allows throughput estimates and 5 GHz preference over 2.4 GHz band
to be used in more cases. The previously used value of 30 was
significantly more conservative than the SNR limits used for the highest
rate in scan_est_throughput() and this resulted in cases where 5 GHz AP
was ignored while SNR with it would have been close to reaching the
maximum TX rate.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: WPA2-PSK-FT AP over DS protocol testing for AP processing
Jouni Malinen [Wed, 15 Feb 2017 09:17:37 +0000 (11:17 +0200)] 
tests: WPA2-PSK-FT AP over DS protocol testing for AP processing

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: WPA2-PSK-FT and AP OOM
Jouni Malinen [Tue, 14 Feb 2017 09:10:58 +0000 (11:10 +0200)] 
tests: WPA2-PSK-FT and AP OOM

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFT: Check key derivation results explicitly in AP operations
Jouni Malinen [Tue, 14 Feb 2017 09:09:30 +0000 (11:09 +0200)] 
FT: Check key derivation results explicitly in AP operations

Previously, any potential (even if very unlikely) local operation error
was ignored. Now these will result in aborting the negotiation.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Add TEST_FAIL() to OpenSSL aes_wrap() and aes_unwrap()
Jouni Malinen [Tue, 14 Feb 2017 08:53:10 +0000 (10:53 +0200)] 
tests: Add TEST_FAIL() to OpenSSL aes_wrap() and aes_unwrap()

This makes it easier to add more testing coverage for error paths.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Remove CRC32 dependency from build
Jouni Malinen [Mon, 13 Feb 2017 17:45:51 +0000 (19:45 +0200)] 
FILS: Remove CRC32 dependency from build

The published P802.11ai version does not use CRC32 anymore, so remove
inclusion of crc32.o into wpa_supplicant and hostapd builds based on
CONFIG_FILS=y.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: FILS SK HLP and DHCP response parsing
Jouni Malinen [Mon, 13 Feb 2017 11:42:31 +0000 (13:42 +0200)] 
tests: FILS SK HLP and DHCP response parsing

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: FILS SK HLP request parsing
Jouni Malinen [Mon, 13 Feb 2017 09:51:25 +0000 (11:51 +0200)] 
tests: FILS SK HLP request parsing

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: FILS SK HLP and hostapd OOM
Jouni Malinen [Mon, 13 Feb 2017 09:09:02 +0000 (11:09 +0200)] 
tests: FILS SK HLP and hostapd OOM

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: FILS SK HLP (rapid commit server timeout)
Jouni Malinen [Mon, 13 Feb 2017 08:56:01 +0000 (10:56 +0200)] 
tests: FILS SK HLP (rapid commit server timeout)

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: WNM Disassociation Imminent failure cases
Jouni Malinen [Sun, 12 Feb 2017 16:15:37 +0000 (18:15 +0200)] 
tests: WNM Disassociation Imminent failure cases

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotestS: Additional BSS TM error case coverage
Jouni Malinen [Sun, 12 Feb 2017 16:10:25 +0000 (18:10 +0200)] 
testS: Additional BSS TM error case coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: WNM BSS TM - protocol testing for AP message parsing
Jouni Malinen [Sun, 12 Feb 2017 16:01:03 +0000 (18:01 +0200)] 
tests: WNM BSS TM - protocol testing for AP message parsing

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: WNM Sleep Mode - open (fail)
Jouni Malinen [Sun, 12 Feb 2017 15:52:20 +0000 (17:52 +0200)] 
tests: WNM Sleep Mode - open (fail)

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: WNM BSS Transition Management OOM
Jouni Malinen [Sun, 12 Feb 2017 15:47:58 +0000 (17:47 +0200)] 
tests: WNM BSS Transition Management OOM

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoWNM: Remove unused code from BSS TM Req generation
Jouni Malinen [Sun, 12 Feb 2017 15:40:34 +0000 (17:40 +0200)] 
WNM: Remove unused code from BSS TM Req generation

The url argument to ieee802_11_send_bss_trans_mgmt_request() was
hardcoded to NULL in the only caller, so this code cannot be reached.
wnm_send_bss_tm_req() construct the same frame with more generic
parameters, including option for including the URL, so
ieee802_11_send_bss_trans_mgmt_request() can be simplified.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoWNM: Use a common error path in ieee802_11_send_wnmsleep_resp()
Jouni Malinen [Sun, 12 Feb 2017 09:49:21 +0000 (11:49 +0200)] 
WNM: Use a common error path in ieee802_11_send_wnmsleep_resp()

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: WNM Sleep Mode - protocol testing
Jouni Malinen [Sun, 12 Feb 2017 09:46:13 +0000 (11:46 +0200)] 
tests: WNM Sleep Mode - protocol testing

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoWNM: Fix WNM-Sleep Mode Request parsing for WNM-Sleep element
Jouni Malinen [Sun, 12 Feb 2017 09:43:54 +0000 (11:43 +0200)] 
WNM: Fix WNM-Sleep Mode Request parsing for WNM-Sleep element

The length of the WNM-Sleep element was not verified before using it.
This could result in reading the subfields in this element (total of
four octets) beyond the end of the buffer. Fix this by ignoring the
element if it is not long enough to contain all the subfields.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: RSN AP deinit during PeerKey negotiation
Jouni Malinen [Sun, 12 Feb 2017 09:18:03 +0000 (11:18 +0200)] 
tests: RSN AP deinit during PeerKey negotiation

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoPeerKey: Remove dead code related to STSL negotiation state
Jouni Malinen [Sun, 12 Feb 2017 09:15:49 +0000 (11:15 +0200)] 
PeerKey: Remove dead code related to STSL negotiation state

The struct wpa_stsl_negotiation seemed to have been for some kind of
tracking of state of PeerKey negotiations within hostapd. However,
nothing is actually adding any entries to wpa_auth->stsl_negotiations or
using this state. Since PeerKey does not look like something that would
be deployed in practice, there is no justification to spend time on
making this any more complete. Remove the dead code now instead of
trying to figure out what it might be used for.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoOSU server: Remove invalid options from documentation
Masashi Honma [Sat, 11 Feb 2017 09:38:23 +0000 (18:38 +0900)] 
OSU server: Remove invalid options from documentation

Remove -d and -I options which causes "Illegal option" error.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
7 years agotests: Additional WMM AP parsing coverage
Jouni Malinen [Sat, 11 Feb 2017 10:12:41 +0000 (12:12 +0200)] 
tests: Additional WMM AP parsing coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoWMM: Fix estimated medium time calculation for some corner cases
Jouni Malinen [Sat, 11 Feb 2017 10:09:11 +0000 (12:09 +0200)] 
WMM: Fix estimated medium time calculation for some corner cases

It was possible for the int medium_time variable to overflow, so use a
64-bit unsigned integer to get a large enough value for the
multiplication.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFix "IEEE 802.11: Ignored Action frame" debug message
Jouni Malinen [Sat, 11 Feb 2017 10:08:12 +0000 (12:08 +0200)] 
Fix "IEEE 802.11: Ignored Action frame" debug message

The arguments to printf were in incorrect order which resulted in
incorrect STA address in the debug message.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoWMM: Remove obsolete TODO comments
Jouni Malinen [Sat, 11 Feb 2017 08:29:18 +0000 (10:29 +0200)] 
WMM: Remove obsolete TODO comments

These are more about kernel behavior than anything that hostapd would
implement.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoSync android.config with wpa_supplicant defconfig changes
Jouni Malinen [Sat, 11 Feb 2017 08:21:56 +0000 (10:21 +0200)] 
Sync android.config with wpa_supplicant defconfig changes

This adds new edits from defconfig to android.config. No new build
options are enabled, i.e., this is only bringing in comment updates and
new parameters in commented out form.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoAdd bgscan options to wpa_supplicant defconfig
Jouni Malinen [Sat, 11 Feb 2017 08:21:24 +0000 (10:21 +0200)] 
Add bgscan options to wpa_supplicant defconfig

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agoFix wpa_supplicant defconfig copy-paste description
Jouni Malinen [Sat, 11 Feb 2017 08:12:16 +0000 (10:12 +0200)] 
Fix wpa_supplicant defconfig copy-paste description

This is obviously for the wpa_supplicant binary, not hostapd.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: wpa_supplicant SET relative RSSI
Jouni Malinen [Fri, 10 Feb 2017 17:41:21 +0000 (19:41 +0200)] 
tests: wpa_supplicant SET relative RSSI

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAdd support to sched scan to report relatively better BSSs
vamsi krishna [Tue, 15 Nov 2016 09:42:44 +0000 (15:12 +0530)] 
Add support to sched scan to report relatively better BSSs

Add support to set sched scan relative RSSI parameters so that the
drivers can report BSSs after relative comparision with the current
connected BSS. This feature is applicable only when in connected mode.

The below commands can be used to configure relative RSSI parameters
SET relative_rssi <disable|rssi_value>
disable - to disable the feature
rssi_value - amount of relative RSSI in dB
SET relative_band_adjust <band:adjust_value>
band - "2G" or "5G" for 2.4 GHz or 5 GHz respectively
adjust_value - amount of RSSI to be adjusted in dB

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agonl80211: sched_scan relative RSSI parameters
vamsi krishna [Tue, 15 Nov 2016 09:42:44 +0000 (15:12 +0530)] 
nl80211: sched_scan relative RSSI parameters

Add driver interface support to set sched_scan relative RSSI parameters
and to indicate driver support for this.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agomka: Send MKPDUs forever if mode is PSK
Badrish Adiga H R [Tue, 7 Feb 2017 08:58:31 +0000 (14:28 +0530)] 
mka: Send MKPDUs forever if mode is PSK

Issue: When 2 peers are running MACsec in PSK mode with CA
established, if the interface goes down and comes up after
time > 10 seconds, CA does not get re-established.

Root cause: This is because retry_count of both the peers
would have reached MAX_RETRY_CNT and stays idle for other to
respond. This is clear deadlock situation where peer A waits
for MKA packets from peer B to wake up and vice-versa.

Fix: If MACsec is running in PSK mode, we should send MKPDUs
forever for every 2 seconds.

Signed-off-by: Badrish Adiga H R <badrish.adigahr@gmail.com>
7 years agotests: EAP-AKA within EAP-TTLS/PEAP/FAST tunnel and reauth
Jouni Malinen [Fri, 10 Feb 2017 16:56:30 +0000 (18:56 +0200)] 
tests: EAP-AKA within EAP-TTLS/PEAP/FAST tunnel and reauth

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoEAP: Call deinit_for_reauth() for Phase 2 EAP methods
Jouni Malinen [Fri, 10 Feb 2017 16:55:26 +0000 (18:55 +0200)] 
EAP: Call deinit_for_reauth() for Phase 2 EAP methods

EAP-TTLS/PEAP/FAST were previously doing this for init_for_reauth(), but
not for deinit_for_reauth(). Add the deinit_for_reauth() call as well to
cover cases like EAP-AKA cleaup of AT_CHECKCODE data.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoEAP-AKA: Don't use anonymous identity in phase2
Jouni Malinen [Fri, 10 Feb 2017 16:54:20 +0000 (18:54 +0200)] 
EAP-AKA: Don't use anonymous identity in phase2

This adds the same changes to EAP-AKA that were previous done for
EAP-SIM to allow functionality within an EAP-TTLS/PEAP/FAST tunnel
without causing issues to the phase 1 identity string.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: EAP-SIM tunneled within EAP-TTLS/PEAP/FAST
Jouni Malinen [Fri, 10 Feb 2017 14:05:33 +0000 (16:05 +0200)] 
tests: EAP-SIM tunneled within EAP-TTLS/PEAP/FAST

This verifies both the internal and external GSM authentication
operation when EAP-SIM is tunneled within EAP-TTLS/PEAP/FAST.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoEAP-SIM: Don't use anonymous identity in phase2
Paul Stewart [Thu, 9 Feb 2017 01:47:57 +0000 (17:47 -0800)] 
EAP-SIM: Don't use anonymous identity in phase2

The "anonymous_identity" configuration field has more than one
semantic meaning. For tunneled EAP methods, this refers to the
outer EAP identity. For EAP-SIM, this refers to the pseudonym
identity. Also, interestingly, EAP-SIM can overwrite the
"anonymous_identity" field if one is provided to it by the
authenticator.

When EAP-SIM is tunneled within an outer method, it makes sense
to only use this value for the outer method, since it's unlikely
that this will also be valid as an identity for the inner EAP-SIM
method. Also, presumably since the outer method protects the
EAP-SIM transaction, there is no need for a pseudonym in this
usage.

Similarly, if EAP-SIM is being used as an inner method, it must
not push the pseudonym identity using eap_set_anon_id() since it
could overwrite the identity for the outer EAP method.

Signed-off-by: Paul Stewart <pstew@google.com>
7 years agoEAP peer: Cache decrypted requests for EAP-SIM/AKA/AKA'
Paul Stewart [Thu, 9 Feb 2017 00:46:41 +0000 (16:46 -0800)] 
EAP peer: Cache decrypted requests for EAP-SIM/AKA/AKA'

Add an internal flag which indicates to tunneled EAP methods (FAST,
PEAP, TTLS) that they should cache decrypted EAP-SIM/AKA/AKA' requests.
This allows EAP-SIM/AKA/AKA' to be tunneled within these outer methods
while using an external SIM authenticator over the control interface.

Signed-off-by: Paul Stewart <pstew@google.com>
7 years agotests: WPA-PSK/TKIP countermeasures (detected by two STAs)
Jouni Malinen [Fri, 10 Feb 2017 09:51:00 +0000 (11:51 +0200)] 
tests: WPA-PSK/TKIP countermeasures (detected by two STAs)

This includes check for hostapd ending TKIP countermeasures.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoSME: Remove null ie param from CTRL-EVENT-AUTH-REJECT
Jouni Malinen [Fri, 10 Feb 2017 09:49:36 +0000 (11:49 +0200)] 
SME: Remove null ie param from CTRL-EVENT-AUTH-REJECT

Clean up the event message by removing the ie=<value> parameter when the
IEs are not available instead of printing out "ie=(null)".

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Additional RRM testing coverage for hostapd
Jouni Malinen [Thu, 9 Feb 2017 10:27:30 +0000 (12:27 +0200)] 
tests: Additional RRM testing coverage for hostapd

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoRRM: Fix a memory leak in beacon request handling
Jouni Malinen [Thu, 9 Feb 2017 14:54:26 +0000 (16:54 +0200)] 
RRM: Fix a memory leak in beacon request handling

Free the pending frequency list if a second beacon request is received
before the scan for the previous one has been completed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoRRM: Fix range request overriding
Jouni Malinen [Thu, 9 Feb 2017 11:25:29 +0000 (13:25 +0200)] 
RRM: Fix range request overriding

This was supposed to cancel the existing eloop timeout instead of
registering another one.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoRRM: Merge similar error returns to a single one
Jouni Malinen [Thu, 9 Feb 2017 11:24:26 +0000 (13:24 +0200)] 
RRM: Merge similar error returns to a single one

There is no need to maintain different return paths for STA being
completely not present and not authorized, so merge these into a single
case.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoRRM: Fix Range Request max age parsing
Jouni Malinen [Thu, 9 Feb 2017 11:23:00 +0000 (13:23 +0200)] 
RRM: Fix Range Request max age parsing

This 16-bit field uses little endian encoding and it must be read with
WPA_GET_LE16() instead of assuming host byte order is little endian. In
addition, this could be misaligned, so using a u16 pointer here was not
appropriate.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: More WPA2 PSK from RADIUS Tunnel-Password coverage
Jouni Malinen [Wed, 8 Feb 2017 18:15:10 +0000 (20:15 +0200)] 
tests: More WPA2 PSK from RADIUS Tunnel-Password coverage

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: RADIUS MAC ACL and server unreachable
Jouni Malinen [Wed, 8 Feb 2017 15:41:21 +0000 (17:41 +0200)] 
tests: RADIUS MAC ACL and server unreachable

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFix MAC ACL query freeing on deinit
Jouni Malinen [Wed, 8 Feb 2017 15:37:50 +0000 (17:37 +0200)] 
Fix MAC ACL query freeing on deinit

hapd->acl_cache and hapd->acl_queries were not reset back to NULL in
hostapd_acl_deinit() when cached results and pending ACL queries were
freed. This left stale pointers to freed memory in hapd. While this was
normally followed by freeing of the hapd data, it is possible to re-use
that hapd when disabling and re-enabling an interface. That sequence
could result in use of freed memory if done while there were cached
results or pending ACL operations with a RADIUS server (especially, if
that server did not reply).

Fix this by setting hapd->acl_queries to NULL when the pending entries
are freed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: RADIUS MAC ACL and OOM
Jouni Malinen [Wed, 8 Feb 2017 15:28:49 +0000 (17:28 +0200)] 
tests: RADIUS MAC ACL and OOM

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: RADIUS Accounting in RSN and failure to add attributes due to OOM
Jouni Malinen [Wed, 8 Feb 2017 14:16:21 +0000 (16:16 +0200)] 
tests: RADIUS Accounting in RSN and failure to add attributes due to OOM

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAllow PNO scan also in connection completed state
vamsi krishna [Wed, 8 Feb 2017 12:10:34 +0000 (17:40 +0530)] 
Allow PNO scan also in connection completed state

Sched scan is supported by the kernel also in the connected state, so
allow PNO scan to be issued in the connected state from wpa_supplicant
as well.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Make ap_wps_er_http_proto less likely to fail
Jouni Malinen [Wed, 8 Feb 2017 11:53:11 +0000 (13:53 +0200)] 
tests: Make ap_wps_er_http_proto less likely to fail

The test step for concurrent HTTP connections seems to be failing quite
frequently when running in a virtual machine with run-tests.py (but not
that much with kvm and vm-run.sh). The failures are due to only 8 or 9
sockets getting a response from the HTTP server. This is sufficient for
testing purposes, to drop the pass criterium from 10 to 8 concurrent
connections. This avoids unnecessary test failures and also allows the
rest of the test case to be performed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Check for ebtables having been installed
Jouni Malinen [Wed, 8 Feb 2017 11:35:36 +0000 (13:35 +0200)] 
tests: Check for ebtables having been installed

This makes proxyarp_open_ebtables and proxyarp_open_ebtables_ipv6 return
SKIP cleanly if the ebtables binary is not installed or does not work.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAdd radio_work_is_connect() helper
Jouni Malinen [Tue, 7 Feb 2017 21:55:48 +0000 (23:55 +0200)] 
Add radio_work_is_connect() helper

This avoids duplicated code to check for different types of connection
radio work items.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoSerialize scan/p2p-scan if already scheduled on the same interface
Sunil Dutt [Thu, 2 Feb 2017 12:49:45 +0000 (18:19 +0530)] 
Serialize scan/p2p-scan if already scheduled on the same interface

The current implementation of QCA vendor scan does not handle the
simultaneous scan/p2p-scan operations on the same interface due to
missing support for tracking multiple scan cookie values. Hence
serialize such operations on the same interface for now.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Make radius_acct_interim more robust
Jouni Malinen [Tue, 7 Feb 2017 21:07:04 +0000 (23:07 +0200)] 
tests: Make radius_acct_interim more robust

Wait one more second to make the test case less likely to fail while
still being able to verify that interim updates are performed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Clear country code at the end of wpas_config_file
Jouni Malinen [Tue, 7 Feb 2017 21:03:35 +0000 (23:03 +0200)] 
tests: Clear country code at the end of wpas_config_file

This test case was mistakenly leaving the country code FI configured at
the end which could result in issues with the following test cases. Fix
this by explicitly clearing the country code back to world roaming 00 at
the end of wpas_config_file.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoP2P: Clear driver scan cache after BSS_FLUSH
Jouni Malinen [Tue, 7 Feb 2017 20:48:20 +0000 (22:48 +0200)] 
P2P: Clear driver scan cache after BSS_FLUSH

The only_new_results=1 scan parameter was previously set on other scan
cases, but not on the two P2P specific scan triggers. Set this also for
those P2P cases to get consistent behavior after BSS_FLUSH.

This was showing up with number of hwsim P2P test cases maintaining
unexpected scan results from previous test cases due to the flush
operation not really working correctly since the cfg80211 BSS table was
not explicitly cleared.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFILS: Clean up HLP resize check
Jouni Malinen [Tue, 7 Feb 2017 18:50:33 +0000 (20:50 +0200)] 
FILS: Clean up HLP resize check

The "!wpabuf_resize(...) == 0" condition does not make any sense. It
happens to work, but this is really supposed to simple check with
wpabuf_resize() returns non-zero and "wpabuf_resize(...)" is the
cleanest way of doing so.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: Verify GAS/ANQP transmitter address randomization
Vamsi Krishna [Thu, 8 Dec 2016 16:23:40 +0000 (21:53 +0530)] 
tests: Verify GAS/ANQP transmitter address randomization

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoGAS: Add support to randomize transmitter address
Vamsi Krishna [Thu, 8 Dec 2016 16:21:25 +0000 (21:51 +0530)] 
GAS: Add support to randomize transmitter address

Add support to send GAS requests with a randomized transmitter address
if supported by the driver. The following control interface commands
(and matching configuration file parameters) can be used to configure
different types of randomization:

"SET gas_rand_mac_addr 0" to disable randomizing TX MAC address,
"SET gas_rand_mac_addr 1" to randomize the complete TX MAC address,
"SET gas_rand_mac_addr 2" to randomize the TX MAC address except for OUI.

A new random MAC address will be generated for every
gas_rand_addr_lifetime seconds and this can be configured with
"SET gas_rand_addr_lifetime <timeout>".

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agonl80211: Add support for mgmt_tx with random TA
Vamsi Krishna [Thu, 8 Dec 2016 16:21:25 +0000 (21:51 +0530)] 
nl80211: Add support for mgmt_tx with random TA

This adds support for specifying a random TA for management frame
transmission commands and driver capability flags for indicating whether
this is supported in not-connected and connected states.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoSync with mac80211-next.git include/uapi/linux/nl80211.h
Jouni Malinen [Tue, 7 Feb 2017 16:55:35 +0000 (18:55 +0200)] 
Sync with mac80211-next.git include/uapi/linux/nl80211.h

This brings in nl80211 definitions as of 2017-01-13.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agotests: Additional GAS server coverage
Jouni Malinen [Tue, 7 Feb 2017 13:46:20 +0000 (15:46 +0200)] 
tests: Additional GAS server coverage

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoGAS: Fix OSU Providers List response with invalid configuration
Jouni Malinen [Tue, 7 Feb 2017 15:46:29 +0000 (17:46 +0200)] 
GAS: Fix OSU Providers List response with invalid configuration

If the OSU Providers configuration was invalid (included osu_server_uri
but not osu_method_list), it was possible for the GAS response
generation to hit a NULL dereference. Fix this by checking for the
invalid configuration before trying to fill in the OSU methods.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: wpa_supplicant AP mode - 5 GHz
Jouni Malinen [Tue, 7 Feb 2017 09:22:29 +0000 (11:22 +0200)] 
tests: wpa_supplicant AP mode - 5 GHz

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoVHT: Fill VHT capability with hardware capability
Masashi Honma [Tue, 7 Feb 2017 02:50:57 +0000 (11:50 +0900)] 
VHT: Fill VHT capability with hardware capability

Previously, VHT capability was default value (=0x0000). This makes
VHT Capabilities Info in VHT Capabilities IE in mesh peering
open/confirm frame 0x0000. This patch fills it with hardware capability.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
7 years agotests: Make go_search_non_social more robust
Jouni Malinen [Tue, 7 Feb 2017 09:08:24 +0000 (11:08 +0200)] 
tests: Make go_search_non_social more robust

Try the initial scan on the operating channel twice before claiming a
test failure. It is possible for an active scan to fail to see the GO
especially if running the test under heavy load.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agotests: WPA2-PSK EAPOL-Key retry limit configuration
Jouni Malinen [Mon, 6 Feb 2017 21:59:41 +0000 (23:59 +0200)] 
tests: WPA2-PSK EAPOL-Key retry limit configuration

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoAdd a log message when GTK rekeying failed
Günther Kelleter [Mon, 6 Feb 2017 21:55:42 +0000 (23:55 +0200)] 
Add a log message when GTK rekeying failed

It can happen if the station is unreachable or sleeping longer than
the actual total GTK rekey timeout. To fix the latter case
wpa_group_update_count may be increased.

Signed-off-by: Günther Kelleter <guenther.kelleter@devolo.de>
7 years agoAdd hostapd options wpa_group_update_count and wpa_pairwise_update_count
Günther Kelleter [Thu, 5 Jan 2017 16:00:33 +0000 (17:00 +0100)] 
Add hostapd options wpa_group_update_count and wpa_pairwise_update_count

wpa_group_update_count and wpa_pairwise_update_count can now be used to
set the GTK and PTK rekey retry limits (dot11RSNAConfigGroupUpdateCount
and dot11RSNAConfigPairwiseUpdateCount). Defaults set to current
hardcoded value (4).

Some stations may suffer from frequent deauthentications due to GTK
rekey failures: EAPOL 1/2 frame is not answered during the total timeout
period of currently ~3.5 seconds. For example, a Galaxy S6 with Android
6.0.1 appears to go into power save mode for up to 5 seconds. Increasing
wpa_group_update_count to 6 fixed this issue.

Signed-off-by: Günther Kelleter <guenther.kelleter@devolo.de>
7 years agomka: Some bug fixes for MACsec in PSK mode
Badrish Adiga H R [Fri, 6 Jan 2017 09:57:10 +0000 (15:27 +0530)] 
mka: Some bug fixes for MACsec in PSK mode

Issue:
------
The test setup has 2 peers running MACsec in PSK mode, Peer A with
MAC address higher than MAC Address of peer B. Test sequence is
1. Peer B starts with actor_priority 255
2. Peer A starts with priority 16, becomes key server.
3. Peer A stops..
4. Peer A restarts with priority 255, but because of the stale values
participant->is_key_server(=TRUE) and participant->is_elected(=TRUE)
it continues to remain as Key Server.
5. For peer B, key server election happens and since it has lower MAC
address as compared to MAC address of A, it becomes the key server.
Now we have 2 key servers in CA and is not correct.

Root-cause & fix:
-----------------
When number of live peers become 0, the flags such lrx, ltx, orx,
otx, etc. need to be cleared. In MACsec PSK mode, these stale values
create problems while re-establishing CA.

Signed-off-by: Badrish Adiga H R <badrish.adigahr@gmail.com>
7 years agomka: Fix an incorrect update of participant->to_use_sak
Badrish Adiga H R [Fri, 6 Jan 2017 12:17:51 +0000 (17:47 +0530)] 
mka: Fix an incorrect update of participant->to_use_sak

API ieee802_1x_mka_decode_dist_sak_body() wrongly puts
participant->to_use_sak to TRUE, if Distributed SAK Parameter Set of
length 0 is received. In MACsec PSK mode, this stale incorrect value can
create problems while re-establishing CA. In MACsec PSK mode, CA goes
down if interface goes down and ideally we should be able to
re-establish the CA once interface comes up.

Signed-off-by: Badrish Adiga H R <badrish.adigahr@gmail.com>
7 years agohs20-osu-client: Hide a trivial compiler warning
Masashi Honma [Mon, 6 Feb 2017 11:07:44 +0000 (20:07 +0900)] 
hs20-osu-client: Hide a trivial compiler warning

This patch hides a compiler warning:

osu_client.c: In function ‘cmd_osu_select’:
osu_client.c:2200:2: warning: ‘osu_count’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  for (i = 0; i < osu_count; i++) {
  ^

osu_count is actually initialized in parse_osu_providers() if non-NULL
value is returned.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
7 years agotests: VHT and 40 MHz channel configuration falling back to 20 MHz
Jouni Malinen [Mon, 6 Feb 2017 17:22:47 +0000 (19:22 +0200)] 
tests: VHT and 40 MHz channel configuration falling back to 20 MHz

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agohw_features: Clean center freq for falling back HT40 channels
Eduardo Abinader [Tue, 17 Jan 2017 10:59:03 +0000 (11:59 +0100)] 
hw_features: Clean center freq for falling back HT40 channels

Some channels fail to be set, when falling back to 20 MHz, due to
remaining VHT info of center freq. As we are going to 20 MHz, reset the
VHT center frequency segment information as well.

Signed-off-by: Eduardo Abinader <eduardoabinader@gmail.com>
7 years agoP2P: Override P2P_PEER group_capab with 0 if no matching BSS entry found
Sunil Dutt [Tue, 31 Jan 2017 18:57:06 +0000 (00:27 +0530)] 
P2P: Override P2P_PEER group_capab with 0 if no matching BSS entry found

Relying on the group_capab from the P2P peer information can result in
improper information on whether the peer is currently operating as a GO.
However, there is a known implementation in Android that does this.

To reduce issues from this misuse in upper layer to try to determine
whether a specific peer is operationg a group, override the group_capab
value in P2P_PEER output with 0 if there are no BSS entries with the
peer P2P Device as a GO. This is not a perfect information since there
may not have been a recent scan on all channels, but this results in
less issues than trying to decide between new group formation and
joining an existing group based on stale or incorrect information.

Since no upper layer application is really supposed to use the
group_capab field value in P2P_PEER command, this change should not
cause any impact for properly design components and the possibility of
regressions is limited to cases that are already known to work
incorrectly in number of identifiable cases.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
7 years agoFix estimated throughput based skip-roam case
Jouni Malinen [Sun, 5 Feb 2017 19:52:26 +0000 (21:52 +0200)] 
Fix estimated throughput based skip-roam case

Commit 8d1e693186336f85bf5d86bd094b5c9bd6f8fd02 ('Use estimated
throughput to avoid signal based roaming decision') added a check for
the current BSS estimated throughput being significantly higher than the
selected BSS estimated throughput. However, this case for skipping a
roam used "return 1" which actually allows the roam. Fix this by
returning 0 in this case.

Signed-off-by: Jouni Malinen <j@w1.fi>
7 years agonl80211: Fix error while enabling AP mode with driver-SME
Dedy Lansky [Sun, 5 Feb 2017 10:52:09 +0000 (12:52 +0200)] 
nl80211: Fix error while enabling AP mode with driver-SME

Following commit a70cd0db876b2ffad7e3d608e3f9a2fcf2e7a879 ('Don't
register for Beacon frames for IEEE 802.11ad AP'),
nl80211_get_wiphy_data_ap() is unconditionally called when starting AP.
This function tries to register for Beacon frames RX which fails for
some driver which don't support such registration and do not need it in
case the driver implements AP mode SME functionality.

Fix this by conditionally calling nl80211_get_wiphy_data_ap() like prior
to commit a70cd0db876b2ffad7e3d608e3f9a2fcf2e7a879.

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
7 years agotests: RADIUS Accounting local failure cases
Jouni Malinen [Sun, 5 Feb 2017 15:11:29 +0000 (17:11 +0200)] 
tests: RADIUS Accounting local failure cases

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