mech_eap.git
11 years agoP2P: Add some more details on Service Query TLV format
Jouni Malinen [Sun, 13 Jan 2013 11:43:54 +0000 (13:43 +0200)]
P2P: Add some more details on Service Query TLV format

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

11 years agowpa_supplicant: Add more DBus EAP status
Paul Stewart [Sat, 12 Jan 2013 17:51:18 +0000 (19:51 +0200)]
wpa_supplicant: Add more DBus EAP status

Signal the start of EAP authentication as well as when additional
credentials are required to complete.

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

11 years agoUpdate ChangeLog files to match current implementation
Jouni Malinen [Sat, 12 Jan 2013 16:04:19 +0000 (18:04 +0200)]
Update ChangeLog files to match current implementation

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

11 years agonl80211: Add MFP information for NL80211_CMD_CONNECT
Jouni Malinen [Sat, 12 Jan 2013 07:54:54 +0000 (09:54 +0200)]
nl80211: Add MFP information for NL80211_CMD_CONNECT

This was previously included only with NL80211_CMD_ASSOCIATE, but the
information is as useful (if not even more useful) for
NL80211_CMD_CONNECT. It should be noted that cfg80211 does not yet use
this attribute with NL80211_CMD_CONNECT, but that can be added easily.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoP2P: Use the same Dialog Token value for every GO Negotiation retry
Sunil Dutt [Wed, 9 Jan 2013 14:05:18 +0000 (16:05 +0200)]
P2P: Use the same Dialog Token value for every GO Negotiation retry

Each GO Negotiation Request is (re)tried with an unique dialog token and
a GO Negotiation Response / Confirmation from the peer with a mismatched
dialog token is ignored which could result in a failure in this group
formation attempt. Thus, the P2P device would continue retrying the GO
Negotiation Request frames till the GO Negotiation Response frame with a
matching dialog token is received. To avoid the failures due to the
dialog token mismatch in retry cases if the peer is too slow to reply
within the timeout, the same dialog token value is used for every retry
in the same group formation handshake.

It should be noted that this can result in different contents of the GO
Negotiation Request frame being sent with the same dialog token value
since the tie breaker bit in GO Intent is still toggled for each
attempt. The specification is not very clear on what would be the
correct behavior here. Tie breaker bit is not updated on
"retransmissions", but that is more likely referring to the layer 2
retransmission and not the retry at higher layer using a new MMPDU.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoInclude session transfer stats into SIGUSR1 dump
Jan Vales [Sun, 6 Jan 2013 18:39:30 +0000 (20:39 +0200)]
Include session transfer stats into SIGUSR1 dump

Add the RX/TX packets/bytes into each station's SIGUSR1 dump
information.

Signed-off-by: Jan Vales <jan@jvales.net>
11 years agoSAE: Move temporary data into a separate data structure
Jouni Malinen [Sun, 6 Jan 2013 17:26:27 +0000 (19:26 +0200)]
SAE: Move temporary data into a separate data structure

This allows even more memory to be freed when the SAE instance enters
Accepted state. This leaves only the minimal needed memory allocated
during the association which is especially helpful for the AP
implementation where multiple stations may be associated concurrently.

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

11 years agoSAE: Free temporary buffers when moving to Accepted state
Jouni Malinen [Sun, 6 Jan 2013 17:06:59 +0000 (19:06 +0200)]
SAE: Free temporary buffers when moving to Accepted state

Most of the variables are not needed anymore once the SAE instance
has entered Accepted state. Free these to save memory.

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

11 years agoSAE: Remove unnecessary sae_derive_k() wrapper
Jouni Malinen [Sun, 6 Jan 2013 16:59:46 +0000 (18:59 +0200)]
SAE: Remove unnecessary sae_derive_k() wrapper

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

11 years agoSAE: Clean up exponent calculation for PWE
Jouni Malinen [Sun, 6 Jan 2013 16:56:46 +0000 (18:56 +0200)]
SAE: Clean up exponent calculation for PWE

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

11 years agoSAE: Share more commit value derivation between FFC and ECC cases
Jouni Malinen [Sun, 6 Jan 2013 16:47:52 +0000 (18:47 +0200)]
SAE: Share more commit value derivation between FFC and ECC cases

The rand/mask values and commit scalar are derived using the exact same
operations, so only use a separate function for deriving the commit
element.

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

11 years agoSAE: Replace comparison to one with crypto_bignum wrapper
Jouni Malinen [Sun, 6 Jan 2013 16:38:17 +0000 (18:38 +0200)]
SAE: Replace comparison to one with crypto_bignum wrapper

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

11 years agoSAE: Rename and move ECC/FFC functions to be next to each other
Jouni Malinen [Sun, 6 Jan 2013 16:30:11 +0000 (18:30 +0200)]
SAE: Rename and move ECC/FFC functions to be next to each other

This makes it easier to see where there is separate implementation for
ECC and FFC groups.

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

11 years agoSAE: Remove duplicated SAE field debug dumps
Jouni Malinen [Sun, 6 Jan 2013 16:18:01 +0000 (18:18 +0200)]
SAE: Remove duplicated SAE field debug dumps

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

11 years agoSAE: Store commit elements as EC point or bignum instead of octet string
Jouni Malinen [Sun, 6 Jan 2013 16:12:58 +0000 (18:12 +0200)]
SAE: Store commit elements as EC point or bignum instead of octet string

This avoids unnecessary EC point and bignum initialization steps during
the SAE exchange.

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

11 years agoSAE: Validate peer commit values as part of parsing the message
Jouni Malinen [Sun, 6 Jan 2013 15:34:05 +0000 (17:34 +0200)]
SAE: Validate peer commit values as part of parsing the message

There is no need to postpone this validation step to a separate
processing operation for the commit message, so move the minimal
validation tasks into the parsing functions.

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

11 years agoSAE: Split sae_parse_commit() into helper functions
Jouni Malinen [Sun, 6 Jan 2013 15:03:09 +0000 (17:03 +0200)]
SAE: Split sae_parse_commit() into helper functions

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

11 years agoSAE: Store commit scalars as bignum instead of octet string
Jouni Malinen [Sun, 6 Jan 2013 14:57:53 +0000 (16:57 +0200)]
SAE: Store commit scalars as bignum instead of octet string

This avoids unnecessary bignum initialization steps during the SAE
exchange.

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

11 years agoSAE: Store PWE as EC point or bignum instead of octet string
Jouni Malinen [Sun, 6 Jan 2013 14:10:48 +0000 (16:10 +0200)]
SAE: Store PWE as EC point or bignum instead of octet string

This avoids unnecessary EC point and bignum initialization steps during
the SAE exchange.

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

11 years agoSAE: Use more generic random bignum generation
Jouni Malinen [Sun, 6 Jan 2013 13:47:37 +0000 (15:47 +0200)]
SAE: Use more generic random bignum generation

Move the bignum comparison part into the bignum library to allow a
single implementation of rand generation for both ECC and FCC based
groups.

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

11 years agoSAE: Store rand value as bignum instead of octet string
Jouni Malinen [Sun, 6 Jan 2013 13:32:38 +0000 (15:32 +0200)]
SAE: Store rand value as bignum instead of octet string

This avoids unnecessary bignum initialization steps during the SAE
exchange.

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

11 years agoSAE: Add support for FFC groups that do not use a safe prime
Jouni Malinen [Sun, 6 Jan 2013 13:13:07 +0000 (15:13 +0200)]
SAE: Add support for FFC groups that do not use a safe prime

This allows DH groups 22, 23, 24 to be used with SAE.

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

11 years agoAdd Diffie-Hellman group definitions for MODP groups in RFC 5114
Jouni Malinen [Sun, 6 Jan 2013 11:22:44 +0000 (13:22 +0200)]
Add Diffie-Hellman group definitions for MODP groups in RFC 5114

The groups 22, 23, and 24 are not based on a safe prime and generate a
prime order subgroup. As such, struct dh_group is also extended to
include the order for previously defined groups (q=(p-1)/2 since these
were based on a safe prime).

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

11 years agoSAE: Add support for FFC groups
Jouni Malinen [Sat, 5 Jan 2013 19:22:00 +0000 (21:22 +0200)]
SAE: Add support for FFC groups

This allows FFC groups to be used with SAE. Though, these groups are not
included in the default sae_groups value based on what is available
since the FFC groups have the additional requirement of using a safe
prime with the current implementation (or specification of the group
order).

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

11 years agoSAE: Maintain bignum of group order and prime in context data
Jouni Malinen [Sat, 5 Jan 2013 19:12:29 +0000 (21:12 +0200)]
SAE: Maintain bignum of group order and prime in context data

This simplifies operations by not having to create bignum instances
multiple times during SAE exchange.

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

11 years agoAdd more crypto_bignum_*() wrappers
Jouni Malinen [Sat, 5 Jan 2013 18:59:46 +0000 (20:59 +0200)]
Add more crypto_bignum_*() wrappers

These operations will be needed for SAE FCC group operations.

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

11 years agoAllow AP mode deauth/disassoc reason code to be overridden
Jouni Malinen [Fri, 4 Jan 2013 10:19:02 +0000 (12:19 +0200)]
Allow AP mode deauth/disassoc reason code to be overridden

The optional "reason=<reason code>" parameter to the ctrl_iface
deauthenticate and disassociate commands can now be used to change the
reason code used in the disconnection frame. This can be used, e.g., by
P2P GO to disconnect a single P2P client from the group by sending it an
indication of the group getting terminated (Deauthentication frame with
reason code 3). It needs to be noted that the peer device is still in
possession on the PSK, so it can still reconnect to the group after this
if it does not follow the group termination indication.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoP2P: Publish more connected clients info in Probe Response frames
Sunil Dutt [Thu, 3 Jan 2013 15:28:50 +0000 (17:28 +0200)]
P2P: Publish more connected clients info in Probe Response frames

This commit increases the maximum buffer size for P2P Client Info
advertized by the Group Owner in the Probe Response frames.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoExtra validation to keep static analyzers happy
Jouni Malinen [Tue, 1 Jan 2013 18:35:10 +0000 (20:35 +0200)]
Extra validation to keep static analyzers happy

Use of two variables to track bounds checking seems to be a bit too much
for some static analyzers, so add an extra condition for buffer padding
to avoid incorrect warnings.

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

11 years agoTDLS: Use merge_byte_arrays() helper
Jouni Malinen [Tue, 1 Jan 2013 18:34:08 +0000 (20:34 +0200)]
TDLS: Use merge_byte_arrays() helper

This makes implementation simpler and easier for static analyzers to
understand.

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

11 years agoReplace macros with inline functions for WPA_{GET,PUT}_{BE,LE}*
Jouni Malinen [Tue, 1 Jan 2013 18:32:36 +0000 (20:32 +0200)]
Replace macros with inline functions for WPA_{GET,PUT}_{BE,LE}*

These verify that a proper pointer type is used and in addition, seems
to get rid of some false static analyzer warnings.

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

11 years agoAdd more debug info if wpa_supplicant_set_suites() fails
Jouni Malinen [Tue, 1 Jan 2013 18:31:35 +0000 (20:31 +0200)]
Add more debug info if wpa_supplicant_set_suites() fails

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

11 years agoWPS: Verify wpa_config_set() return value more consistently
Jouni Malinen [Tue, 1 Jan 2013 18:30:17 +0000 (20:30 +0200)]
WPS: Verify wpa_config_set() return value more consistently

Even though this command is very unlikely to fail, in theory, it could
and the WPS connection would fail in such a case. Return more clearer
failure indication in such a case without even trying to start
reassociation.

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

11 years agoUse more explicit way of copying pointer value to a buffer
Jouni Malinen [Tue, 1 Jan 2013 18:26:20 +0000 (20:26 +0200)]
Use more explicit way of copying pointer value to a buffer

The code initializing GMK Counter uses the group pointer value as extra
entropy and to distinguish different group instances. Some static
analyzers complain about the sizeof(pointer) with memcpy, so use a more
explicit type casting to make it more obvious what the code is doing.

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

11 years agoSAE: Check random_get_bytes() return value
Jouni Malinen [Tue, 1 Jan 2013 18:25:38 +0000 (20:25 +0200)]
SAE: Check random_get_bytes() return value

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

11 years agoSAE: Indicate used group in ctrl_iface STATUS
Jouni Malinen [Tue, 1 Jan 2013 14:33:25 +0000 (16:33 +0200)]
SAE: Indicate used group in ctrl_iface STATUS

The new "sae_group=<id>" line will be included in the ctrl_iface STATUS
output if SAE was used for the association.

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

11 years agoSAE: Allow enabled groups to be configured
Jouni Malinen [Tue, 1 Jan 2013 14:23:47 +0000 (16:23 +0200)]
SAE: Allow enabled groups to be configured

hostapd.conf sae_groups parameter can now be used to limit the set of
groups that the AP allows for SAE. Similarly, sae_groups parameter is
wpa_supplicant.conf can be used to set the preferred order of groups. By
default, all implemented groups are enabled.

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

11 years agoUpdate copyright notices to include year 2013
Jouni Malinen [Tue, 1 Jan 2013 12:05:25 +0000 (14:05 +0200)]
Update copyright notices to include year 2013

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

11 years agoSAE: Add support for ECC group 21 (521-bit random ECP group)
Jouni Malinen [Tue, 1 Jan 2013 12:00:40 +0000 (14:00 +0200)]
SAE: Add support for ECC group 21 (521-bit random ECP group)

In addition to the trivial change in adding the new group ientifier,
this required changes to KDF and random number generation to support
cases where the length of the prime in bits is not a multiple of eight.
The binary presentation of the value needs to be shifted so that the
unused most significant bits are the zero padding rather than the extra
bits in the end of the array.

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

11 years agoSAE: Add support for additional ECC groups
Jouni Malinen [Tue, 1 Jan 2013 11:07:56 +0000 (13:07 +0200)]
SAE: Add support for additional ECC groups

In addition to the mandatory group 19 (256-bit random ECP group) add
support for groups 20 (384-bit), 25 (192-bit), and 26 (224-bit).

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

11 years agoSAE: Fix PWE loop termination on excessive iterations
Jouni Malinen [Tue, 1 Jan 2013 10:50:27 +0000 (12:50 +0200)]
SAE: Fix PWE loop termination on excessive iterations

The counter>200 check needs to be done before the continue-on-not-found
case to be effective in stopping this loop.

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

11 years agoSAE: Set pwd-value length based on prime length
Jouni Malinen [Tue, 1 Jan 2013 10:45:18 +0000 (12:45 +0200)]
SAE: Set pwd-value length based on prime length

The buffer is set based on maximum group prime length, but pwd-value
needs to be correct length for the negotiated group.

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

11 years agoSAE: Use EC group context to get the group prime
Jouni Malinen [Tue, 1 Jan 2013 10:27:00 +0000 (12:27 +0200)]
SAE: Use EC group context to get the group prime

Do not use the hardcoded group19_prime buffer for this to allow group
negotiation.

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

11 years agoSAE: Use EC group context for peer-commit-scalar validation
Jouni Malinen [Tue, 1 Jan 2013 10:21:49 +0000 (12:21 +0200)]
SAE: Use EC group context for peer-commit-scalar validation

Do not use the hardcoded group19_order/group19_prime buffers for this to
allow group negotiation.

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

11 years agoSAE: Use EC group context for random number generation
Jouni Malinen [Tue, 1 Jan 2013 10:18:44 +0000 (12:18 +0200)]
SAE: Use EC group context for random number generation

Do not use the hardcoded group19_order/group19_prime buffers for this to
allow group negotiation.

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

11 years agoSAE: Store the group order in EC context data
Jouni Malinen [Tue, 1 Jan 2013 09:54:54 +0000 (11:54 +0200)]
SAE: Store the group order in EC context data

This makes the SAE implementation a bit simpler by not having to build
the bignum for group order during execution.

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

11 years agoSAE: Use defines for key lengths
Jouni Malinen [Tue, 1 Jan 2013 09:52:49 +0000 (11:52 +0200)]
SAE: Use defines for key lengths

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

11 years agoSAE: Add a define for maximum supported prime length
Jouni Malinen [Tue, 1 Jan 2013 09:49:01 +0000 (11:49 +0200)]
SAE: Add a define for maximum supported prime length

This can be used to increase buffer sizes when adding support for new
groups.

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

11 years agoSAE: Use sae->prime_len instead of hardcoded 32
Jouni Malinen [Tue, 1 Jan 2013 09:46:02 +0000 (11:46 +0200)]
SAE: Use sae->prime_len instead of hardcoded 32

This is needed to allow multiple groups to be supported.

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

11 years agoSAE: Use the EC context from struct sae_data
Jouni Malinen [Tue, 1 Jan 2013 09:37:58 +0000 (11:37 +0200)]
SAE: Use the EC context from struct sae_data

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

11 years agoSAE: Maintain EC group context in struct sae_data
Jouni Malinen [Tue, 1 Jan 2013 09:29:53 +0000 (11:29 +0200)]
SAE: Maintain EC group context in struct sae_data

This can be used to share same EC group context through the SAE
exchange.

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

11 years agoSAE: Use crypto wrappers instead of direct OpenSSL calls
Jouni Malinen [Mon, 31 Dec 2012 17:41:21 +0000 (19:41 +0200)]
SAE: Use crypto wrappers instead of direct OpenSSL calls

This makes the SAE implementation independent of the crypto/bignum
library.

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

11 years agocrypto: Add wrappers for OpenSSL BIGNUM and EC_POINT
Jouni Malinen [Mon, 31 Dec 2012 17:40:08 +0000 (19:40 +0200)]
crypto: Add wrappers for OpenSSL BIGNUM and EC_POINT

These new crypto wrappers can be used to implement bignum and EC
operations using various crypto libraries.

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

11 years agoSAE: Add support for Anti-Clogging mechanism
Jouni Malinen [Mon, 31 Dec 2012 14:58:36 +0000 (16:58 +0200)]
SAE: Add support for Anti-Clogging mechanism

hostapd can now be configured to use anti-clogging mechanism based on
the new sae_anti_clogging_threshold parameter (which is
dot11RSNASAEAntiCloggingThreshold in the standard). The token is
generated using a temporary key and the peer station's MAC address.
wpa_supplicant will re-try SAE authentication with the token included if
commit message is rejected with a token request.

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

11 years agoSAE: Do not allow re-use of peer-scalar in a new protocol instance
Jouni Malinen [Mon, 31 Dec 2012 09:20:04 +0000 (11:20 +0200)]
SAE: Do not allow re-use of peer-scalar in a new protocol instance

IEEE Std 802.11-2012, 11.3.8.6.1: If there is a protocol instance for
the peer and it is in Authenticated state, the new Commit Message
shall be dropped if the peer-scalar is identical to the one used in
the existing protocol instance.

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

11 years agoSAE: Rename state variables to match IEEE 802.11 standard
Jouni Malinen [Mon, 31 Dec 2012 09:05:42 +0000 (11:05 +0200)]
SAE: Rename state variables to match IEEE 802.11 standard

The enum values for struct sae_data::state now match the protocol
instance states as defined in IEEE Std 802.11-2012, 11.3.8.2.2

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

11 years agoSAE: Use PMK in 4-way handshake
Jouni Malinen [Sun, 30 Dec 2012 20:35:59 +0000 (22:35 +0200)]
SAE: Use PMK in 4-way handshake

Use the PMK that is derived as part of the SAE authentication in the
4-way handshake instead of the PSK.

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

11 years agoSAE: Add processing of the confirm message
Jouni Malinen [Sun, 30 Dec 2012 20:31:19 +0000 (22:31 +0200)]
SAE: Add processing of the confirm message

This adds validation of the received confirm messages for SAE.

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

11 years agoSAE: Add generation of the confirm message fields
Jouni Malinen [Sun, 30 Dec 2012 20:28:57 +0000 (22:28 +0200)]
SAE: Add generation of the confirm message fields

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

11 years agoSAE: Add processing of the commit message
Jouni Malinen [Sun, 30 Dec 2012 20:16:18 +0000 (22:16 +0200)]
SAE: Add processing of the commit message

This adds validation of the received commit messages and key derivation
for SAE.

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

11 years agoSAE: Add generation of the commit message fields
Jouni Malinen [Sun, 30 Dec 2012 20:06:11 +0000 (22:06 +0200)]
SAE: Add generation of the commit message fields

This adds derivation of PWE and the needed commit values so that the
full SAE commit message can be built.

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

11 years agoSAE: Move related operations next to each other
Jouni Malinen [Sun, 30 Dec 2012 19:54:16 +0000 (21:54 +0200)]
SAE: Move related operations next to each other

There is no need to keep the two SAE steps separated from each other.

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

11 years agoSAE: Use a shared data structure for AP and station
Jouni Malinen [Sun, 30 Dec 2012 19:48:19 +0000 (21:48 +0200)]
SAE: Use a shared data structure for AP and station

This makes it easier to share common functions for both roles.

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

11 years agonl80211: Pass station VHT capabilities to kernel
Johannes Berg [Fri, 28 Dec 2012 15:31:22 +0000 (17:31 +0200)]
nl80211: Pass station VHT capabilities to kernel

Signed-hostap: Johannes Berg <johannes.berg@intel.com>

11 years agohostapd: Pass VHT capabilities to driver wrapper
Johannes Berg [Fri, 28 Dec 2012 15:30:30 +0000 (17:30 +0200)]
hostapd: Pass VHT capabilities to driver wrapper

Signed-hostap: Johannes Berg <johannes.berg@intel.com>

11 years agonl80211: Support VHT configuration
Johannes Berg [Fri, 28 Dec 2012 15:29:20 +0000 (17:29 +0200)]
nl80211: Support VHT configuration

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoSync with linux/nl80211.h in wireless-testing.git
Jouni Malinen [Fri, 28 Dec 2012 15:28:49 +0000 (17:28 +0200)]
Sync with linux/nl80211.h in wireless-testing.git

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

11 years agohostapd: Allow configuring driver to VHT
Johannes Berg [Fri, 28 Dec 2012 15:24:21 +0000 (17:24 +0200)]
hostapd: Allow configuring driver to VHT

Signed-hostap: Johannes Berg <johannes.berg@intel.com>

11 years agoThe hostap.git master branch is now used for 2.1 development
Jouni Malinen [Sat, 12 Jan 2013 15:51:10 +0000 (17:51 +0200)]
The hostap.git master branch is now used for 2.1 development

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

11 years agoPrepare for hostapd/wpa_supplicant v2.0 release hostap_2_0
Jouni Malinen [Sat, 12 Jan 2013 15:42:53 +0000 (17:42 +0200)]
Prepare for hostapd/wpa_supplicant v2.0 release

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

11 years agoEAP-FAST: Allow empty PAC file to be used
Jouni Malinen [Sat, 12 Jan 2013 15:30:08 +0000 (17:30 +0200)]
EAP-FAST: Allow empty PAC file to be used

Even if the PAC file does not start with the proper header line, allow
the file to be used if it is empty. [Bug 423]

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

11 years agoFix authenticator PMKSA cache expiration timer setup
Jouni Malinen [Sat, 12 Jan 2013 15:21:50 +0000 (17:21 +0200)]
Fix authenticator PMKSA cache expiration timer setup

The PMKSA cache expiration timer was not actually ever initialized since
the only place for registering the timeout was in the timeout handler.
Fix this by initializing the timer whenever a new PMKSA cache entry is
added to the beginning of the list (i.e., when it was the first entry or
expires before the entry that was previously going to expire first).
[Bug 393]

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

11 years agoFix EAPOL frame sending to non-QoS STAs
Jouni Malinen [Sat, 12 Jan 2013 15:01:54 +0000 (17:01 +0200)]
Fix EAPOL frame sending to non-QoS STAs

Commit 4378fc14ebfb355705e7674bf347ea659bcd77bc started using QoS Data
frames for QoS STAs. It used the correct flags value for WPA/RSN
EAPOL-Key frames, but wrong flags for IEEE 802.1X EAPOL frames. The
WPA_STA_WMM value used in driver_nl80211.c happens to be identical to
WLAN_STA_ASSOC in sta->flags and this makes driver_nl80211.c try to use
QoS header for all STAs. Fix this by properly converting the flags from
WLAN_STA_* to WPA_STA_*. [Bug 426]

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

11 years agoeapol_test: Allow full RADIUS attribute length to be used
Jouni Malinen [Sat, 12 Jan 2013 10:39:27 +0000 (12:39 +0200)]
eapol_test: Allow full RADIUS attribute length to be used

The -N and -C command line parameters can be used to add arbitrary
RADIUS attributes to the messages. However, these were truncated to
about 128 bytes when the actually message was constructed. Fix this by
using larger buffers to allow the maximum attribute length (253 octets
of payload) to be used. [Bug 458]

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

11 years agoeapol_test: Fix extra RADIUS attribute allocation
Jouni Malinen [Sat, 12 Jan 2013 10:32:43 +0000 (12:32 +0200)]
eapol_test: Fix extra RADIUS attribute allocation

The sizeof(ptr) use here was not correct and resulted in too small
memory block getting allocated for the -N command line argument.

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

11 years agoP2P: Fix some memory leaks in p2p_add_device()
Masashi Honma [Sat, 12 Jan 2013 08:30:07 +0000 (10:30 +0200)]
P2P: Fix some memory leaks in p2p_add_device()

Signed-hostap: Masashi Honma <masashi.honma@gmail.com>

11 years agowpa_supplicant: Save frequency configuration parameter
Janusz Dziedzic [Sat, 12 Jan 2013 08:23:45 +0000 (10:23 +0200)]
wpa_supplicant: Save frequency configuration parameter

In case of wpa_supplicant IBSS and AP modes after we will call wpa_cli
save command we should also save configured frequency. In other case
after wpa_supplicant restart we have frequency = 0 and AP start will
fail.

Signed-hostap: Janusz Dziedzic <janusz.dziedzic@tieto.com>

11 years agoEAP-AKA server: Fix fallback to full auth
Jouni Malinen [Tue, 8 Jan 2013 13:45:05 +0000 (15:45 +0200)]
EAP-AKA server: Fix fallback to full auth

Commit 68a41bbb44ac78087076ce65e6c1803d036bc4a2 broke fallback from
reauth id to fullauth id by not allowing a second AKA/Identity round to
be used after having received unrecognized reauth_id in the first round.
Fix this by allowing fullauth id to be requested in such a case.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoP2P: Use the same Dialog Token value for every PD retry
Sunil Dutt [Tue, 8 Jan 2013 11:12:34 +0000 (13:12 +0200)]
P2P: Use the same Dialog Token value for every PD retry

Commit 175171ac6c3f2bb501897237d559de0fedfd992e ensured that the PD
requests are retried in join-a-running group case and the Enrollee is
started on either receiving the PD response or after the retries. Each
PD request is retried with an unique dialog token and a PD response from
the GO with a mismatched dialog token is ignored. Thus, the P2P client
would continue retrying the PD requests till the response with a
matching dialog token is obtained. This would result in the GO getting
multiple PD requests and a corresponding user notification (POP UP) in
implementations where each PD request results in a POP UP, resulting in
a bad user experience. To avoid such behavior, the same dialog token
value is used for every retry in the same PD exchange.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agonl80211: Restore previous nlmode if set_freq for AP mode fails
Jouni Malinen [Mon, 7 Jan 2013 22:34:08 +0000 (00:34 +0200)]
nl80211: Restore previous nlmode if set_freq for AP mode fails

wpa_driver_nl80211_ap() returned error if set_freq failed, but left the
previously set nlmode to GO/AP. While this should not be issue for most
purposes, it leaves the interface in somewhat unexpected state and could
potentially affect operations prior to next connection attempt. Address
this by restoring the previous nlmode if AP mode cannot be started for
some reason.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoInterworking: Do not schedule new scan if process is terminating
Jouni Malinen [Mon, 7 Jan 2013 16:44:46 +0000 (18:44 +0200)]
Interworking: Do not schedule new scan if process is terminating

The GAS query compilation callback may happen after the wpa_supplicant
process has been requested to terminate. Avoid scheduling a new eloop
timeout for a scan in such a case.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoInterworking: Do not share ANQP info if none was received
Jouni Malinen [Mon, 7 Jan 2013 16:41:51 +0000 (18:41 +0200)]
Interworking: Do not share ANQP info if none was received

Verify that the other BSS has actually received some valid ANQP
information before sharing the results from it. This fixes potential
issues with cases where some of the APs with the same HESSID has invalid
ANQP configuration.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoInterworking: Continue ANQP fetch after TX failure
Jouni Malinen [Mon, 7 Jan 2013 16:38:09 +0000 (18:38 +0200)]
Interworking: Continue ANQP fetch after TX failure

If the driver rejected any of the offchannel Action frame TX requests,
the previous implementation terminated ANQP fetch process. While the
driver should not really reject the request normally, it is possible
that a request gets rejected for some reason. Allow the fetch process to
continue with the next AP in such case to avoid breaking networking
selection. This could result, e.g., in auto_interworking=1 process
failing to connect if any the driver rejects requests to any of the APs
in the scan result even if some other APs provided suitable information.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

11 years agoUpdate ChangeLog files to match the current implementation
Jouni Malinen [Fri, 28 Dec 2012 15:01:32 +0000 (17:01 +0200)]
Update ChangeLog files to match the current implementation

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

11 years agoRemove unused wpa_scan_get_vendor_ie_multi_beacon()
Jouni Malinen [Thu, 27 Dec 2012 10:31:06 +0000 (12:31 +0200)]
Remove unused wpa_scan_get_vendor_ie_multi_beacon()

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

11 years agoAdd Doxygen documentation for functionality related to scanning
Jouni Malinen [Thu, 27 Dec 2012 10:29:05 +0000 (12:29 +0200)]
Add Doxygen documentation for functionality related to scanning

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

11 years agoSplit p2p_prepare_channel() into multiple functions
Jouni Malinen [Thu, 27 Dec 2012 06:37:13 +0000 (08:37 +0200)]
Split p2p_prepare_channel() into multiple functions

This makes it easier to read the code for the two possible cases
(forced/preferred channel and automatic channel selection).

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

11 years agoP2P: Document operating channel selection functions
Jouni Malinen [Thu, 27 Dec 2012 06:27:11 +0000 (08:27 +0200)]
P2P: Document operating channel selection functions

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

11 years agoP2P: Always re-select operating channel if not hard coded
Arik Nemtsov [Thu, 27 Dec 2012 06:16:42 +0000 (08:16 +0200)]
P2P: Always re-select operating channel if not hard coded

Since the operating channel is randomly set to 1/6/11 on init, which is
commonly included in the channel intersection, we were effectively
ignoring the set of P2P preferred channels when trying to improve
channel selection after having received peer information. Fix this by
trying to get the best channel we can, unless the user hard coded the
operating channel in the configuration file or p2p_connect command. Fall
back to the initial randomly selected channel if a better one cannot be
chosen.

Signed-hostap: Arik Nemtsov <arik@wizery.com>

11 years agoP2P: Do not allow re-selection of GO channel if forced_freq in use
Jouni Malinen [Thu, 27 Dec 2012 06:06:55 +0000 (08:06 +0200)]
P2P: Do not allow re-selection of GO channel if forced_freq in use

Even if the peer does not accept the forced channel, we should not allow
the forced_freq parameter to be be overridden, i.e., such a case needs
to result in GO Negotiation failure.

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

11 years agoP2P: Set FORCE_FREQ flag as part of p2p_prepare_channel()
Jouni Malinen [Thu, 27 Dec 2012 05:58:04 +0000 (07:58 +0200)]
P2P: Set FORCE_FREQ flag as part of p2p_prepare_channel()

Both p2p_connect and p2p_authorize use the same functionality to select
the channel preferences for GO Negotiation. The part of setting this
device flag was copied to each function, but it can also be handled by
the shared function after some reordering of code.

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

11 years agoP2P: Share a single function for GO channel selection
Jouni Malinen [Thu, 27 Dec 2012 05:39:57 +0000 (07:39 +0200)]
P2P: Share a single function for GO channel selection

The exact same mechanism was used for determining the operating channel
at the device that becomes the GO regardless of whether this was
triggered by reception of GO Negotiation Request of Response frame. Use
a shared function to avoid duplicated implementation and potential
differences in the future.

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

11 years agoDocument bgscan configuration options
Jouni Malinen [Tue, 25 Dec 2012 18:43:07 +0000 (20:43 +0200)]
Document bgscan configuration options

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

11 years agoP2P: Prefer operating channels where HT40 is possible
Arik Nemtsov [Tue, 25 Dec 2012 17:59:04 +0000 (19:59 +0200)]
P2P: Prefer operating channels where HT40 is possible

When no other user preference is specified, opt to use an operating
channel that allows HT40 operation. This way, if driver capabilities
and regulatory constraints allow, we might enjoy increased bandwidth.

Signed-hostap: Arik Nemtsov <arik@wizery.com>

11 years agoRemove reassociated_connection variable
Jouni Malinen [Tue, 25 Dec 2012 17:51:04 +0000 (19:51 +0200)]
Remove reassociated_connection variable

This was used to select between "(auth)" and "(reauth)" in
CTRL-EVENT-CONNECTED events. However, the variable was not cleared
anywhere else apart from the AP deinit case. As such, it did not really
provide correct information and is not really of much use even with
proper clearing added. As such, it is cleaner to just get rid of this
altogether.

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

11 years agoP2P: Be more careful with wpa_config_update_psk() call
Jouni Malinen [Tue, 25 Dec 2012 17:35:15 +0000 (19:35 +0200)]
P2P: Be more careful with wpa_config_update_psk() call

Commit bb4d4deb4bbb7b094faa16fa41f1f49b062cbf22 introduced a code path
that could potentially end up calling wpa_config_update_psk() with NULL
passphrase. While that may not happen in practice, it is better to make
sure it doesn't happen since that function will dereference the
passphrase pointer unconditionally.

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

11 years agoP2P: Allow PSK to be used instead of passphrase for persistent GO
Masashi Honma [Tue, 25 Dec 2012 12:15:07 +0000 (14:15 +0200)]
P2P: Allow PSK to be used instead of passphrase for persistent GO

This continues optimizations for use of CPU heavy pbkdf2_sha1() in GO
setup after the earlier commit 30c371e8a54c3b1bece6366ff0666da15d63e45e
by allowing PSK to be used instead of passphrase when creating
persistent group information manually for the GO.

It should be noted that this would not meet the requirements in the P2P
specification (GO shall maintain the passphrase), so this should be used
only when there is no need to allow manual configuration of legacy STAs
using the passphrase.

Signed-hostap: Masashi Honma <masashi.honma@gmail.com>

11 years agoAndroid: Stop/restart supplicant scan on PNO start/stop
Pandiyarajan Pitchaimuthu [Tue, 25 Dec 2012 11:54:21 +0000 (13:54 +0200)]
Android: Stop/restart supplicant scan on PNO start/stop

Cancel the existing supplicant scan and start a new supplicant
scan on PNO start and stop respectively. This makes sure that
supplicant scan is in progress when the device resumes.

Signed-off-by: Pandiyarajan Pitchaimuthu <c_ppitch@qca.qualcomm.com>
11 years agoatheros: Release sock_raw and reset appfilter on hapd_init failure
Baruch Siach [Tue, 25 Dec 2012 11:50:41 +0000 (13:50 +0200)]
atheros: Release sock_raw and reset appfilter on hapd_init failure

Signed-hostap: Baruch Siach <baruch@tkos.co.il>

11 years agoP2P: Consider age for the P2P scan results
Yoni Divinsky [Tue, 25 Dec 2012 09:22:42 +0000 (11:22 +0200)]
P2P: Consider age for the P2P scan results

cfg80211 caches the scan results according the channel number. Due to
the 15 sec aging this might cause the user mode to see more than one
scan result with the same BSSID, e.g. - one scan result for the
P2P Device and one for the P2P GO (once it's enabled).

Fix this by updating the device entry only if the new peer entry is
newer than the one previously stored.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-hostap: Arik Nemtsov <arik@wizery.com>