mech_eap.git
11 years agowpa_supplicant: Implement fast-associate on SelectNetwork
Paul Stewart [Sun, 3 Feb 2013 19:08:31 +0000 (21:08 +0200)]
wpa_supplicant: Implement fast-associate on SelectNetwork

If scan results are available when we perform a SelectNetwork, use
them to make an associate decision.  This can save an entire scan
interval-worth of time in situations where something external to
wpa_supplicant (like a connection manager) has just previously
requested a scan before calling SelectNetwork.

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

11 years agoUpdate scan interval gracefully
Pontus Fuchs [Sun, 3 Feb 2013 16:14:05 +0000 (18:14 +0200)]
Update scan interval gracefully

When the scan interval is changed the new interval is effective
after the old interval timer fires off one last time. This can cause
an unacceptable long delay when updating the interval.

Change this behaviour to use MIN(left of old interval, new interval)
for the scan interval following the interval change.

Signed-hostap: Pontus Fuchs <pontus.fuchs@gmail.com>

11 years agoeloop: Add a timer cancel that returns the remaining time
Pontus Fuchs [Sun, 3 Feb 2013 15:17:08 +0000 (17:17 +0200)]
eloop: Add a timer cancel that returns the remaining time

This new cancel timer will give back the remaining time if it was
pending.

Signed-hostap: Pontus Fuchs <pontus.fuchs@gmail.com>

11 years agoeloop_win: Update to be closer to the current eloop.c
Jouni Malinen [Sun, 3 Feb 2013 15:13:37 +0000 (17:13 +0200)]
eloop_win: Update to be closer to the current eloop.c

Some fixes had were made only in eloop.c.

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

11 years agoeloop_win: Use struct dl_list for timeouts
Jouni Malinen [Sun, 3 Feb 2013 15:09:00 +0000 (17:09 +0200)]
eloop_win: Use struct dl_list for timeouts

This merges commit eaa3f04b97f7bf3ffb91fe0acb2bb6bcb8f566fe changes from
eloop.c into eloop_win.c.

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

11 years agoeloop_none: Update sample to be closer to the current eloop.c
Jouni Malinen [Sun, 3 Feb 2013 14:50:45 +0000 (16:50 +0200)]
eloop_none: Update sample to be closer to the current eloop.c

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

11 years agoeloop_none: Use struct dl_list for timeouts
Jouni Malinen [Sun, 3 Feb 2013 14:45:05 +0000 (16:45 +0200)]
eloop_none: Use struct dl_list for timeouts

This merges commit eaa3f04b97f7bf3ffb91fe0acb2bb6bcb8f566fe changes from
eloop.c into eloop_none.c.

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

11 years agoeloop_none: Fix compilation
Jouni Malinen [Sun, 3 Feb 2013 14:25:09 +0000 (16:25 +0200)]
eloop_none: Fix compilation

eloop.h API had been changed without updating eloop_none.c to match.

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

11 years agoFix compilation with PMKSA caching support disabled
Jouni Malinen [Sun, 3 Feb 2013 14:23:13 +0000 (16:23 +0200)]
Fix compilation with PMKSA caching support disabled

Commit 6aaac006af7fd39d618c6546939bed9f0f0cea37 modified the
pmksa_cache_init() prototype, but forgot to update the empty wrapper
function which is used when PMKSA caching is not included in the build.

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

11 years agonl80211: Do not use void pointer for driver_ops used internally
Jouni Malinen [Sun, 3 Feb 2013 13:46:47 +0000 (15:46 +0200)]
nl80211: Do not use void pointer for driver_ops used internally

This allows some more pointer type validation at compile time.

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

11 years agohostapd: Fix crash when scan fails
Ben Greear [Sun, 3 Feb 2013 11:51:54 +0000 (13:51 +0200)]
hostapd: Fix crash when scan fails

When scan failed, the wpa_driver_nl80211_scan method tried
to recursively call itself, but it passed in the wrong argument
for the void*, and so then it crashed accessing bad memory.

With this fix, hostapd still will not retry the scan later, but
at least it will exit cleanly and won't polute the file system
with core files.

Signed-off-by: Ben Greear <greearb@candelatech.com>
11 years agoTDLS: Disable the link also on driver request for teardown
Sunil Dutt [Tue, 22 Jan 2013 12:09:54 +0000 (14:09 +0200)]
TDLS: Disable the link also on driver request for teardown

The link was not disabled for the case of implicit trigger from the
driver unlike in the case of explicit trigger fromc ctrl_iface. Make the
tear down sequences match in these cases by adding the TDLS_DISABLE_LINK
tdls_oper to the driver when processing the TDLS_REQUEST_TEARDOWN event.

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

11 years agowlantest: Add radiotap header when re-writing DLT_IEEE802_11 file
Jouni Malinen [Thu, 17 Jan 2013 14:22:41 +0000 (16:22 +0200)]
wlantest: Add radiotap header when re-writing DLT_IEEE802_11 file

When using DLT_IEEE802_11 datalink type in a pcap file, wlantest will now
add a radiotap header to the re-written pcap file to make sure all frames
in the output file will include the radiotap header.

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

11 years agowlantest: Add -F option for assuming FCS is included
Jouni Malinen [Thu, 17 Jan 2013 10:55:30 +0000 (12:55 +0200)]
wlantest: Add -F option for assuming FCS is included

When using DLT_IEEE802_11 datalink type in a pcap file, wlantest can now
be instructed to assume there is an FCS included in the frame by adding
the new -F command line argument. This will make wlantest validate the
FCS and strip it from the frame before processing.

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

11 years agoeapol_test: Remove unnecessary header file inclusion
Jouni Malinen [Tue, 15 Jan 2013 10:03:29 +0000 (12:03 +0200)]
eapol_test: Remove unnecessary header file inclusion

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

11 years agoP2P: Send P2P-FIND-STOPPED event in the new continue-search states
Pavan Kumar [Tue, 15 Jan 2013 09:52:20 +0000 (11:52 +0200)]
P2P: Send P2P-FIND-STOPPED event in the new continue-search states

The P2P-FIND-STOPPED event was sent only in the P2P_SEARCH state, but
this needs to be send also in the new continue-search-when-ready states
P2P_CONTINUE_SEARCH_WHEN_READY and P2P_SEARCH_WHEN_READY for consistent
behavior.

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

11 years agoFix wpa_priv build
Jouni Malinen [Sun, 13 Jan 2013 16:27:00 +0000 (18:27 +0200)]
Fix wpa_priv build

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

11 years agoFix EAP-pwd server file name for wpa_supplicant AP builds
Jouni Malinen [Sun, 13 Jan 2013 16:25:19 +0000 (18:25 +0200)]
Fix EAP-pwd server file name for wpa_supplicant AP builds

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

11 years agoUpdated test_wpa to use new header file for WPA authenticator
Jouni Malinen [Sun, 13 Jan 2013 16:24:52 +0000 (18:24 +0200)]
Updated test_wpa to use new header file for WPA authenticator

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

11 years agoAdd new binaries to .gitignore
Jouni Malinen [Sun, 13 Jan 2013 16:24:17 +0000 (18:24 +0200)]
Add new binaries to .gitignore

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

11 years agoMove cipher to enum wpa_cipher conversion into wpa_common.c
Jouni Malinen [Sun, 13 Jan 2013 16:02:20 +0000 (18:02 +0200)]
Move cipher to enum wpa_cipher conversion into wpa_common.c

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

11 years agoUse a helper function for selection group cipher for AP mode
Jouni Malinen [Sun, 13 Jan 2013 15:41:40 +0000 (17:41 +0200)]
Use a helper function for selection group cipher for AP mode

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

11 years agoUse helper function for writing cipher suite names
Jouni Malinen [Sun, 13 Jan 2013 15:31:36 +0000 (17:31 +0200)]
Use helper function for writing cipher suite names

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

11 years agoDefine allowed pairwise/group cipher suites in a header file
Jouni Malinen [Sun, 13 Jan 2013 15:10:38 +0000 (17:10 +0200)]
Define allowed pairwise/group cipher suites in a header file

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

11 years agoUse a common function for parsing cipher suites
Jouni Malinen [Sun, 13 Jan 2013 15:06:22 +0000 (17:06 +0200)]
Use a common function for parsing cipher suites

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

11 years agoMove cipher suite selection into common helper functions
Jouni Malinen [Sun, 13 Jan 2013 14:58:54 +0000 (16:58 +0200)]
Move cipher suite selection into common helper functions

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

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>