mech_eap.git
11 years agoEAP peer: Add Session-Id derivation to more EAP methods
Jouni Malinen [Fri, 8 Feb 2013 22:53:54 +0000 (00:53 +0200)]
EAP peer: Add Session-Id derivation to more EAP methods

This commit adds Session-Id derivation for EAP-SIM, EAP-AKA, EAP-AKA',
EAP-PSK, and EAP-SAK peer methods.

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

11 years agoEAP peer: Add Session-Id derivation
Stevent Li [Wed, 6 Feb 2013 16:52:33 +0000 (18:52 +0200)]
EAP peer: Add Session-Id derivation

This adds a new getSessionId() callback for EAP peer methods to allow
EAP Session-Id to be derived. This commits implements this for EAP-FAST,
EAP-GPSK, EAP-IKEv2, EAP-PEAP, EAP-TLS, and EAP-TTLS.

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

11 years agoEAP-IKEV2 server: Fix invalid memory freeing operation
Jouni Malinen [Fri, 8 Feb 2013 22:44:13 +0000 (00:44 +0200)]
EAP-IKEV2 server: Fix invalid memory freeing operation

wpabuf needs to be freed with wpabuf_free(), not os_free().

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

11 years agoeap_proxy: Add a dummy implementation for compilation testing
Jouni Malinen [Wed, 6 Feb 2013 23:17:43 +0000 (01:17 +0200)]
eap_proxy: Add a dummy implementation for compilation testing

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

11 years agoAndroid: Enable EAP-AKA support in the build
Deepthi Gowri [Wed, 6 Feb 2013 23:07:14 +0000 (01:07 +0200)]
Android: Enable EAP-AKA support in the build

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

11 years agoeap_proxy: Add mechanism for allowing EAP methods to be offloaded
Deepthi Gowri [Wed, 6 Feb 2013 22:55:06 +0000 (00:55 +0200)]
eap_proxy: Add mechanism for allowing EAP methods to be offloaded

In addition to the offload mechanism, the Android configuration and
makefiles are extended to allow this to be configured for the build by
dropping in platform specific configuration files and makefile without
having to modify any existing files.

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

11 years agoAndroid: Allow setgroups to be overridden from build configuration
Deepthi Gowri [Wed, 6 Feb 2013 22:36:16 +0000 (00:36 +0200)]
Android: Allow setgroups to be overridden from build configuration

ANDROID_SETGROUPS_OVERRIDE macro can now be used to override setgroups()
values based on build configuration.

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

11 years agoP2P: Send p2p_stop_find event on failure to start pending p2p_find
Deepthi Gowri [Fri, 8 Feb 2013 09:37:07 +0000 (11:37 +0200)]
P2P: Send p2p_stop_find event on failure to start pending p2p_find

When pending p2p_find fails we need to send p2p_stop_find event to
indicate the previous p2p_find command has been processed.

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

11 years agoP2P: Fix GO Probe Response IEs when Wi-Fi Display is enabled
Jouni Malinen [Thu, 7 Feb 2013 22:10:39 +0000 (00:10 +0200)]
P2P: Fix GO Probe Response IEs when Wi-Fi Display is enabled

Commit 1a9f6509b3a711071c12006ff7c3a9cb2a6691f2 added support for
fragmenting the P2P IE in Probe Response frames from a GO. However, it
did not take into account the possibility of Wi-Fi Display IE being
included in the same buffer and caused a regression for the cases where
Wi-Fi Display is enabled. Fix this by building the possibly fragmented
P2P IE first and then concatenating the separate IEs together.

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

11 years agoAdd 'SCAN TYPE=ONLY' functionality
Dmitry Shmidt [Thu, 7 Feb 2013 16:06:51 +0000 (18:06 +0200)]
Add 'SCAN TYPE=ONLY' functionality

Usual manual scan request may cause reassociation due to several
reasons. New command is intended to perform pure scan without taking any
automatic action based on the results.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
11 years agoCapability matching for 60 GHz band
Vladimir Kondratiev [Thu, 7 Feb 2013 14:20:18 +0000 (16:20 +0200)]
Capability matching for 60 GHz band

On the DMG (60 GHz) band, capability bits defined differently from
non-DMG ones. Adjust capability matching to cover both cases.

Also, for non-DMG bands, check ESS bit is set.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
11 years agonl80211: Add ctrl_iface message for AP mode connection rejection
Raja Mani [Thu, 7 Feb 2013 13:24:53 +0000 (15:24 +0200)]
nl80211: Add ctrl_iface message for AP mode connection rejection

When AP mode operation reject the client, nl80211 layer advertises the
connect failed event with the reason for failures (for example, max
client reached, etc.) using NL80211_CMD_CONN_FAILED.

This patch adds some debug messages whenever such an event is received
from the nl80211 layer and also the same event is posted to the upper
layer via wpa_msg().

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
11 years agoP2P: Allow local configuration to use 5 GHz band 40 MHz channels
Jouni Malinen [Thu, 7 Feb 2013 10:51:17 +0000 (12:51 +0200)]
P2P: Allow local configuration to use 5 GHz band 40 MHz channels

These channels were already enabled for P2P use, but the local
configuration parameter was not allowed to use the operating class in
which the 40 MHz channels are specified.

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

11 years agoFix BSS RANGE command for no exact id match cases
Amar Singhal [Thu, 7 Feb 2013 10:27:52 +0000 (12:27 +0200)]
Fix BSS RANGE command for no exact id match cases

The RANGE=N1-N2 command did not return any entries in some cases where
N1 does not match with any BSS entry. Fix this by allow entries to be
fetched even without knowing the exact id values.

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

11 years agoAdd "BSS LAST ..." command
Amar Singhal [Tue, 5 Feb 2013 22:31:34 +0000 (00:31 +0200)]
Add "BSS LAST ..." command

Add the "BSS LAST ..." command. This command helps in fetching the scan
entries iteratively from FIRST entry to LAST entry by ID.

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

11 years agoFix the "BSS FIRST.." command
Amar Singhal [Tue, 5 Feb 2013 22:28:48 +0000 (00:28 +0200)]
Fix the "BSS FIRST.." command

The "BSS FIRST.." command fails when additional parameters (e.g., MASK)
is used since the string comparsion does not take into account the
number of characters. Fix by comparing only 5 characters as in other
commands.

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

11 years agoHS 2.0: Fix IE buffer length for extra scan IEs
Jouni Malinen [Tue, 5 Feb 2013 15:40:09 +0000 (17:40 +0200)]
HS 2.0: Fix IE buffer length for extra scan IEs

The HS 2.0 Indication element is 7 (not 6) octets. The previous
implementation could result in wpabuf validation code stopping the
program if HS 2.0 was enabled without Interworking or P2P (which would
have created a large enough buffer to avoid hitting this) being enable.

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

11 years agoTDLS: Fix MIC calculation for teardown frame to depend on reason code
Sunil Dutt [Tue, 5 Feb 2013 11:36:36 +0000 (13:36 +0200)]
TDLS: Fix MIC calculation for teardown frame to depend on reason code

The reason code used for calculating the MIC should correspond to the
reason code with which the teardown frame is sent, as the receiver shall
use the one obtained in the frame for validating the MIC.

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

11 years agoTDLS: Remove link, if any, on an implicit set up request
Sunil Dutt [Tue, 5 Feb 2013 11:27:56 +0000 (13:27 +0200)]
TDLS: Remove link, if any, on an implicit set up request

If an implicit TDLS set up request is obtained on an existing link or an
to be established link, the previous link was not removed. This commit
disables the existing link on a new set up request. Also,
wpa_tdls_reneg() function was invoking wpa_tdls_start() on an already
existing peer for the case of internal setup, which is incorrect. Thus
the invocation of wpa_tdls_start() is removed in wpa_tdls_reneg() and
also this function is renamed to wps_tdls_remove() as it does not
renegotiation rather shall remove the link (if any) for the case of
external setup.

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

11 years agoTDLS: Move existing-entry check into wpa_tdls_add_peer()
Jouni Malinen [Tue, 5 Feb 2013 11:16:35 +0000 (13:16 +0200)]
TDLS: Move existing-entry check into wpa_tdls_add_peer()

There is no need to have this check copied to each caller since this
needs to be done for every case when a new peer is being added.

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

11 years agoTDLS: Use existing peer entry if available when processing discovery
Sunil Dutt [Tue, 5 Feb 2013 11:10:34 +0000 (13:10 +0200)]
TDLS: Use existing peer entry if available when processing discovery

Peer entries were getting added on every discover request from the peer,
thus resulting in multiple entries with the same MAC address. Ensures
that a check is done for the presence of the peer entry and reuse the
existing entry instead of adding a new one.

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

11 years agoP2P: Fix P2P-GROUP-STARTED event for p2p_connect-join
Jouni Malinen [Mon, 4 Feb 2013 13:52:53 +0000 (15:52 +0200)]
P2P: Fix P2P-GROUP-STARTED event for p2p_connect-join

Commit 50178335bff450829729c91c8af798a1d3a7b408 introduced a regression
for P2P-GROUP-STARTED event indication during p2p_connect-join when
using a separate P2P group interface. wpa_s->global->p2p_group_formation
was already set in that case to point to the group interface and this
commit changed this to point to incorrect interface. Fix this by setting
p2p_group_formation here only in case a separate group interface is not
used.

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

11 years agoP2P: Fix Action frame processing if Interworking is enabled
Jouni Malinen [Mon, 4 Feb 2013 13:38:35 +0000 (15:38 +0200)]
P2P: Fix Action frame processing if Interworking is enabled

GAS server used the same public_action_cb mechanism as P2P to process
Action frames. This ended up overriding P2P processing of Action frames
while running an AP/GO interface with a build that enables Interworking
(e.g., for Hotspot 2.0) and a driver that uses hostapd for AP mode
SME/MLME. Fix this by adding a separate callback registration for the
GAS server. This should really be cleaned up by supporting arbitrary
number of callback handlers, but for now, this addresses the regression
with a minimal change.

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

11 years agowpa_supplicant: Fix access to the freed memory when removing all networks
Jaewan Kim [Sun, 3 Feb 2013 19:22:59 +0000 (21:22 +0200)]
wpa_supplicant: Fix access to the freed memory when removing all networks

Commit 59ff6653aad1c228cb2e9ccfe02b9dd4e6fc7901 fixed this issue for
'removing a network', and we also need to take care of 'removing all
networks'.

Signed-hostap: Jaewan Kim <jaewan at google.com>

11 years agoAdd driver for OpenBSD net80211 layer
Mark Kettenis [Sun, 3 Feb 2013 19:16:29 +0000 (21:16 +0200)]
Add driver for OpenBSD net80211 layer

Very basic support for OpenBSD.  No support for scanning yet, so this needs
ap_scan=0 and expects that the user has configured the interface manually
using ifconfig(8).

Signed-hostap: Mark Kettenis <kettenis@openbsd.org>

11 years agoMake wpas_select_network_from_last_scan() static
Jouni Malinen [Sun, 3 Feb 2013 19:13:07 +0000 (21:13 +0200)]
Make wpas_select_network_from_last_scan() static

Addition of wpa_supplicant_fast_associate() made it unnecessary to call
wpas_select_network_from_last_scan() directly from other files.

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

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>