]> git.ipfire.org Git - thirdparty/hostap.git/log
thirdparty/hostap.git
11 years agoEAP-pwd: Clear identity string and temporary buffer explicitly
Jouni Malinen [Thu, 24 Jul 2014 16:55:15 +0000 (19:55 +0300)] 
EAP-pwd: Clear identity string and temporary buffer explicitly

Use an explicit memset call to clear any configuration parameter and
dynamic data that contains private information like keys or identity.
This brings in an additional layer of protection by reducing the length
of time this type of private data is kept in memory.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-pwd: Verify BN_rand_range return code
Florent Daigniere [Fri, 27 Jun 2014 10:24:30 +0000 (12:24 +0200)] 
EAP-pwd: Verify BN_rand_range return code

This makes the EAP-pwd server and peer implementations more robust
should OpenSSL fail to derive random number for some reason. While this
is unlikely to happen in practice, the implementation better be prepared
for this should something unexpected ever happen. See
http://jbp.io/2014/01/16/openssl-rand-api/#review-of-randbytes-callers
for more details.

Signed-off-by: Florent Daigniere <nextgens@freenetproject.org>
11 years agoEAP-pwd: Use os_memcmp_const() for hash comparisons
Florent Daigniere [Fri, 27 Jun 2014 10:05:47 +0000 (12:05 +0200)] 
EAP-pwd: Use os_memcmp_const() for hash comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Florent Daigniere <nextgens@freenetproject.org>
11 years agoOpenSSL: Use EC_POINT_clear_free instead of EC_POINT_free
Florent Daigniere [Fri, 27 Jun 2014 09:59:45 +0000 (11:59 +0200)] 
OpenSSL: Use EC_POINT_clear_free instead of EC_POINT_free

This changes OpenSSL calls to explicitly clear the EC_POINT memory
allocations when freeing them. This adds an extra layer of security by
avoiding leaving potentially private keys into local memory after they
are not needed anymore. While some of these variables are not really
private (e.g., they are sent in clear anyway), the extra cost of
clearing them is not significant and it is simpler to just clear these
explicitly rather than review each possible code path to confirm where
this does not help.

Signed-off-by: Florent Daigniere <nextgens@freenetproject.org>
11 years agoOpenSSL: Use BN_clear_free instead of BN_free
Florent Daigniere [Fri, 27 Jun 2014 09:58:10 +0000 (11:58 +0200)] 
OpenSSL: Use BN_clear_free instead of BN_free

This changes OpenSSL calls to explicitly clear the bignum memory
allocations when freeing them. This adds an extra layer of security by
avoiding leaving potentially private keys into local memory after they
are not needed anymore. While some of these variables are not really
private (e.g., they are sent in clear anyway), the extra cost of
clearing them is not significant and it is simpler to just clear these
explicitly rather than review each possible code path to confirm where
this does not help.

Signed-off-by: Florent Daigniere <nextgens@freenetproject.org>
11 years agoHS 2.0R2: Keep backward compatibility with old icu
Dmitry Shmidt [Wed, 16 Jul 2014 17:25:41 +0000 (10:25 -0700)] 
HS 2.0R2: Keep backward compatibility with old icu

This allows hs20-osu-client to be build with additional Android
versions.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
11 years agoEAP-TTLS: Remove FreeRADIUS workaround for EAP-TTLS/MSCHAPv2
Dmitry Shmidt [Wed, 16 Jul 2014 18:01:26 +0000 (11:01 -0700)] 
EAP-TTLS: Remove FreeRADIUS workaround for EAP-TTLS/MSCHAPv2

FreeRADIUS releases before 1.1.4 did not send MS-CHAP2-Success in
EAP-TTLS/MSCHAPv2. A wpa_supplicant workaround for that was added in
2005 and it has been enabled by default to avoid interoperability
issues. This could be disabled with all other EAP workarounds
(eap_workaround=0). However, that will disable some workarounds that are
still needed with number of authentication servers.

Old FreeRADIUS versions should not be in use anymore, so it makes sense
to remove this EAP-TTLS/MSCHAPv2 workaround completely to get more
complete validation of server behavior. This allows MSCHAPv2 to verify
that the server knows the password instead of relying only on the TLS
certificate validation.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
11 years agonl80211: Ensure nl_preq unregistration on driver deinit
Cedric IZOARD [Tue, 8 Jul 2014 07:50:32 +0000 (09:50 +0200)] 
nl80211: Ensure nl_preq unregistration on driver deinit

When driver interface is destroyed (via wpa_driver_nl80211_deinit) the
"preq" nl socket isn't always deleted but the callback struct associated
is. After the interface is destroyed we may still get event on the
socket but as the callback has been freed this will cause wpa_supplicant
to crash.

This patch ensures that the "preq" socket is destroyed when destroying
the interface.

Signed-off-by: Cedric IZOARD <cedricx.izoard@intel.com>
11 years agotests: P2P vendor specific extensions
Jouni Malinen [Fri, 4 Jul 2014 17:33:01 +0000 (20:33 +0300)] 
tests: P2P vendor specific extensions

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoP2P: Make unrecognized vendor elements available in P2P_PEER
Jouni Malinen [Fri, 4 Jul 2014 17:14:19 +0000 (20:14 +0300)] 
P2P: Make unrecognized vendor elements available in P2P_PEER

This allows external programs to use vendor specific information from
P2P peers without wpa_supplicant having to be able to parse and
understand all such vendor specific elements.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoAdd generic mechanism for adding vendor elements into frames
Jouni Malinen [Fri, 4 Jul 2014 15:23:43 +0000 (18:23 +0300)] 
Add generic mechanism for adding vendor elements into frames

This adds following new control interface commands to allow arbitrary
vendor elements to be added into number of frames:

VENDOR_ELEM_ADD <frame id> <hexdump of elem(s)>
VENDOR_ELEM_GET <frame id>
VENDOR_ELEM_REMOVE <frame id> <hexdump of elem(s)>
VENDOR_ELEM_REMOVE <frame id> *

The following frames are supported in this commit (additional frames can
be added in the future):

0 = Probe Request frame in P2P device discovery
1 = Probe Response frame from P2P Device role
2 = Probe Response frame from P2P GO
3 = Beacon frame from P2P GO
4 = PD Req
5 = PD Resp
6 = GO Neg Req
7 = GO Neg Resp
8 = GO Neg Conf
9 = Invitation Request
10 = Invitation Response
11 = P2P Association Request
12 = P2P Association Response

One or more vendor element can be added/removed with the commands. The
hexdump of the element(s) needs to contain the full element (id, len,
payload) and the buffer needs to pass IE parsing requirements to be
accepted.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoPNO: Send Probe Request frames only for hidden SSIDs
Dmitry Shmidt [Wed, 2 Jul 2014 19:31:38 +0000 (12:31 -0700)] 
PNO: Send Probe Request frames only for hidden SSIDs

Previously, offloaded scanning (PNO) on Android was including SSIDs from
all enabled networks regardless of the scan_ssid parameter which
resulted in different behavior for the offloaded case when comparing to
wpa_supplicant initiated scans.

Use the sched_scan match filter to allow broadcast SSID to be used for
scan_ssid=1 networks also with PNO to avoid running active scans for
SSIDs that have not been explicitly marked as requiring an SSID-specific
scan. This reduces exposure of configured network names on the device
when running offloaded scans while the host device is in sleep.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
11 years agoP2P: Add explicit check for ssid->p2p_client_list != NULL
Jouni Malinen [Wed, 2 Jul 2014 21:53:13 +0000 (00:53 +0300)] 
P2P: Add explicit check for ssid->p2p_client_list != NULL

This would not really be needed since these functions check the pointer
above. However, this seems to be too difficult for some static analyzer,
so add the extra check to avoid false reports.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoDFS: Remove dead assignment
Jouni Malinen [Wed, 2 Jul 2014 21:51:47 +0000 (00:51 +0300)] 
DFS: Remove dead assignment

set_dfs_state() return value is not currently checked anywhere, so
remove the dead assignment to avoid static analyzer complaints.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: update_identifier in network block
Jouni Malinen [Wed, 2 Jul 2014 12:51:20 +0000 (15:51 +0300)] 
tests: update_identifier in network block

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoHS 2.0R2: Add update_identifier field to network
Dmitry Shmidt [Mon, 30 Jun 2014 16:59:17 +0000 (09:59 -0700)] 
HS 2.0R2: Add update_identifier field to network

This can be used to configure a Hotspot 2.0 Release 2 network externally
for a case where wpa_supplicant-based Interworking network selection is
not used and the update_identifier cannot be copied directly from a
cred.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
11 years agoFix some sparse warnings about u16 vs. le16
Jouni Malinen [Wed, 2 Jul 2014 10:12:36 +0000 (13:12 +0300)] 
Fix some sparse warnings about u16 vs. le16

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: Fix wpas_ctrl_country to match the fixed event data
Jouni Malinen [Wed, 2 Jul 2014 10:33:24 +0000 (13:33 +0300)] 
tests: Fix wpas_ctrl_country to match the fixed event data

This test case for enforcing the incorrect init=DRIVER instead of
init=CORE for the event due to bug in the event message.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoFix CTRL-EVENT-REGDOM-CHANGE event init= value
Jouni Malinen [Wed, 2 Jul 2014 10:09:00 +0000 (13:09 +0300)] 
Fix CTRL-EVENT-REGDOM-CHANGE event init= value

Incorrect field was used to determine the init=<value> in the regulatory
domain changed control interface event.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoMark function static
Jouni Malinen [Wed, 2 Jul 2014 10:07:44 +0000 (13:07 +0300)] 
Mark function static

This function is not used outside this file.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agodbus: Fix indentation level to match code logic
Jouni Malinen [Wed, 2 Jul 2014 10:03:45 +0000 (13:03 +0300)] 
dbus: Fix indentation level to match code logic

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoMark functions static
Jouni Malinen [Wed, 2 Jul 2014 10:03:22 +0000 (13:03 +0300)] 
Mark functions static

These functions are not used outside this file.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agotests: SCAN scan_id
Jouni Malinen [Tue, 1 Jul 2014 20:57:57 +0000 (23:57 +0300)] 
tests: SCAN scan_id

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoAllow SCAN command to specify scan_ssid=1 SSIDs
Li Jianyun [Tue, 1 Jul 2014 15:22:56 +0000 (23:22 +0800)] 
Allow SCAN command to specify scan_ssid=1 SSIDs

The new "scan_id=<comma separated list of network ids>" parameter can
now be used to specify a list of network ids that have scan_ssid=1 to
indicate active scanning of the SSID. This adds the listed SSIDs to the
scan command to allow manual scan requests to perform active scans for
hidden SSIDs. For example, "SCAN scan_id=1,7,11" would run a scan with
the SSID fetched from the configured network blocks 1, 7, and 11
(assuming those are set with scan_ssid=1). The SSIDs will be included
even from network blocks that are currently disabled.

The maximum number of SSIDs added to the request is limited by the
driver support. If more than supported values are specified, the command
will fail (returns "FAIL").

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
11 years agoWPS: Clear keys/PINs explicitly
Jouni Malinen [Tue, 1 Jul 2014 22:46:45 +0000 (01:46 +0300)] 
WPS: Clear keys/PINs explicitly

Use an explicit memset call to clear any configuration parameter and
dynamic data that contains private information like keys or identity.
This brings in an additional layer of protection by reducing the length
of time this type of private data is kept in memory.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoClear hostapd configuration keys explicitly
Jouni Malinen [Tue, 1 Jul 2014 22:45:45 +0000 (01:45 +0300)] 
Clear hostapd configuration keys explicitly

Use an explicit memset call to clear any hostapd configuration parameter
that contains private information like keys or identity. This brings in
an additional layer of protection by reducing the length of time this
type of private data is kept in memory.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoHS 2.0 R2: Clear hs20-osu-client configuration keys explicitly
Jouni Malinen [Tue, 1 Jul 2014 22:43:33 +0000 (01:43 +0300)] 
HS 2.0 R2: Clear hs20-osu-client configuration keys explicitly

Use an explicit memset call to clear any hs20-osu-client configuration
parameter that contains private information like keys or identity. This
brings in an additional layer of protection by reducing the length of
time this type of private data is kept in memory.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP server: Clear keying material on deinit
Jouni Malinen [Sun, 29 Jun 2014 22:48:41 +0000 (01:48 +0300)] 
EAP server: Clear keying material on deinit

Reduce the amount of time keying material (MSK, EMSK, temporary private
data) remains in memory in EAP methods. This provides additional
protection should there be any issues that could expose process memory
to external observers.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP peer: Clear keying material on deinit
Jouni Malinen [Sun, 29 Jun 2014 18:16:30 +0000 (21:16 +0300)] 
EAP peer: Clear keying material on deinit

Reduce the amount of time keying material (MSK, EMSK, temporary private
data) remains in memory in EAP methods. This provides additional
protection should there be any issues that could expose process memory
to external observers.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoClear wpa_supplicant configuration keys explicitly
Jouni Malinen [Sun, 29 Jun 2014 22:32:07 +0000 (01:32 +0300)] 
Clear wpa_supplicant configuration keys explicitly

Use an explicit memset call to clear any wpa_supplicant configuration
parameter that contains private information like keys or identity. This
brings in an additional layer of protection by reducing the length of
time this type of private data is kept in memory.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-AKA: Remove unnecessary dead increment
Jouni Malinen [Sun, 29 Jun 2014 22:47:44 +0000 (01:47 +0300)] 
EAP-AKA: Remove unnecessary dead increment

The pos pointer is not used after this now nor in future plans, so no
need to increment the value. This remove a static analyzer warning about
dead increment.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-GPSK: Avoid dead increment by checking pos pointer
Jouni Malinen [Sun, 29 Jun 2014 22:46:42 +0000 (01:46 +0300)] 
EAP-GPSK: Avoid dead increment by checking pos pointer

Instead of using the pre-calculated length of the buffer, determine the
length of used data based on the pos pointer. This avoids a static
analyzer warning about dead increment.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoFT: Debug print extra response data
Jouni Malinen [Sun, 29 Jun 2014 22:45:26 +0000 (01:45 +0300)] 
FT: Debug print extra response data

This shows any extra data from FT response and also avoids a static
analyzer warning on dead increment.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoPCSC: Debug print extra response data
Jouni Malinen [Sun, 29 Jun 2014 22:44:33 +0000 (01:44 +0300)] 
PCSC: Debug print extra response data

This shows any extra data from USIM response and also avoids a static
analyzer warning on dead increment.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoInterworking: Remove unnecessary dead increment
Jouni Malinen [Sun, 29 Jun 2014 22:08:49 +0000 (01:08 +0300)] 
Interworking: Remove unnecessary dead increment

build_root_nai() will not be extended to write something after the
domain, so there is no need to update the pos pointer after the final
os_snprintf() call in the function. Remove this to make a static
analyzer happier.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoCheck for no key_mgmt/proto/auth_alg entries in config writer
Jouni Malinen [Sun, 29 Jun 2014 21:56:27 +0000 (00:56 +0300)] 
Check for no key_mgmt/proto/auth_alg entries in config writer

This is not really necessary check, but it keeps a static analyzer
happier by avoiding dead increment. Doing it this way rather than
removing the increment is less likely to cause problems when new entries
are added here in the future (the "dead" increment would be very much
needed in those cases).

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoRemove unnecessary tracking of first entry
Jouni Malinen [Sun, 29 Jun 2014 21:50:40 +0000 (00:50 +0300)] 
Remove unnecessary tracking of first entry

The pointer to the current position is enough to figure out whether the
proto string is the first one in the buffer. Removing the separate
tracking variable cleans up a static analyzer warning on dead
assignment.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoWFD: Explicit limit for subelement length (CID 68127)
Jouni Malinen [Sun, 29 Jun 2014 21:43:28 +0000 (00:43 +0300)] 
WFD: Explicit limit for subelement length (CID 68127)

This adds an explicit limit for the maximum Wi-Fi Display subelement
length for ASCII hexdump. This would not really be needed since the
buffer is already limited by maximum frame length. Anyway, since this
can make static analyzers happier and the subelement used with this
function is short, we may as well include an explicit check.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoHS 2.0: Verify assoc_req_ie buffer size for indication elements
Jouni Malinen [Sun, 29 Jun 2014 21:32:12 +0000 (00:32 +0300)] 
HS 2.0: Verify assoc_req_ie buffer size for indication elements

While the buffer is expected to be large enough for all the IEs, it is
better to check for this explicitly when adding the HS 2.0 Indication
element. (CID 68601)

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoSAE: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:28:25 +0000 (20:28 +0300)] 
SAE: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoWEP shared key: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:27:45 +0000 (20:27 +0300)] 
WEP shared key: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-GTC: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:26:25 +0000 (20:26 +0300)] 
EAP-GTC: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-MSCHAPv2: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:25:36 +0000 (20:25 +0300)] 
EAP-MSCHAPv2: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-TTLS: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:25:05 +0000 (20:25 +0300)] 
EAP-TTLS: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-MD5: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:24:41 +0000 (20:24 +0300)] 
EAP-MD5: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-PSK: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:24:10 +0000 (20:24 +0300)] 
EAP-PSK: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-PEAP: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:22:44 +0000 (20:22 +0300)] 
EAP-PEAP: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-LEAP: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:22:17 +0000 (20:22 +0300)] 
EAP-LEAP: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-GPSK: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:21:59 +0000 (20:21 +0300)] 
EAP-GPSK: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-PAX: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:21:31 +0000 (20:21 +0300)] 
EAP-PAX: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-FAST: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:21:03 +0000 (20:21 +0300)] 
EAP-FAST: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-EKE: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:20:28 +0000 (20:20 +0300)] 
EAP-EKE: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-SAKE: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:19:59 +0000 (20:19 +0300)] 
EAP-SAKE: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-SIM/AKA: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:19:19 +0000 (20:19 +0300)] 
EAP-SIM/AKA: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-IKEv2: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:18:40 +0000 (20:18 +0300)] 
EAP-IKEv2: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoTLS: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:18:00 +0000 (20:18 +0300)] 
TLS: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoMilenage: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:17:14 +0000 (20:17 +0300)] 
Milenage: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoAES-GCM: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:16:58 +0000 (20:16 +0300)] 
AES-GCM: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoAES-CCM: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:16:39 +0000 (20:16 +0300)] 
AES-CCM: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAPOL supplicant: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:16:10 +0000 (20:16 +0300)] 
EAPOL supplicant: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoRSN authenticator: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:15:37 +0000 (20:15 +0300)] 
RSN authenticator: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoRSN supplicant: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:15:07 +0000 (20:15 +0300)] 
RSN supplicant: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoMACsec: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:14:17 +0000 (20:14 +0300)] 
MACsec: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoRADIUS: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 17:13:01 +0000 (20:13 +0300)] 
RADIUS: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoWPS: Use os_memcmp_const() for hash/password comparisons
Jouni Malinen [Sun, 29 Jun 2014 16:38:17 +0000 (19:38 +0300)] 
WPS: Use os_memcmp_const() for hash/password comparisons

This makes the implementation less likely to provide useful timing
information to potential attackers from comparisons of information
received from a remote device and private material known only by the
authorized devices.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoAdd constant time memory comparison function os_memcmp_const
Jouni Malinen [Sun, 29 Jun 2014 16:33:19 +0000 (19:33 +0300)] 
Add constant time memory comparison function os_memcmp_const

This function is meant for comparing passwords or hash values where
difference in execution time could provide external observer information
about the location of the difference in the memory buffers. The return
value does not behave like os_memcmp(), i.e., os_memcmp_const() cannot
be used to sort items into a defined order. Unlike os_memcmp(),
execution time of os_memcmp_const() does not depend on the contents of
the compared memory buffers, but only on the total compared length.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-pwd: Add explicit total length limit
Jouni Malinen [Sun, 29 Jun 2014 15:52:09 +0000 (18:52 +0300)] 
EAP-pwd: Add explicit total length limit

Instead of using implicit limit based on 16-bit unsigned integer having
a maximum value of 65535, limit the maximum length of a fragmented
EAP-pwd message explicitly to 15000 bytes. None of the supported groups
use longer messages, so it is fine to reject any longer message without
even trying to reassemble it. This will hopefully also help in reducing
false warnings from static analyzers (CID 68124).

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-SIM/AKA: Pass EAP type as argument to eap_sim_msg_finish()
Jouni Malinen [Sun, 29 Jun 2014 15:46:29 +0000 (18:46 +0300)] 
EAP-SIM/AKA: Pass EAP type as argument to eap_sim_msg_finish()

This makes it easier for static analyzers to figure out which code paths
are possible within eap_sim_msg_finish() for EAP-SIM. This will
hopefully avoid some false warnings (CID 68110, CID 68113, CID 68114).

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoPeerKey: Clean up EAPOL-Key Key Data processing
Jouni Malinen [Sun, 29 Jun 2014 15:32:12 +0000 (18:32 +0300)] 
PeerKey: Clean up EAPOL-Key Key Data processing

This extends the earlier commit e6270129f6ac06c319480c409ee7013a1ad33127
('Clean up EAPOL-Key Key Data processing') design to be used with
PeerKey EAPOL-key processing as well. This avoids false warnings from
static analyzer (CID 62860, CID 62861, CID 62862).

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agodbus: Clean up array-array-type property getter
Jouni Malinen [Sun, 29 Jun 2014 15:20:13 +0000 (18:20 +0300)] 
dbus: Clean up array-array-type property getter

The previously used design was a bit too complex for static analyzers
(e.g., CID 68131, CID 68133) to understand which resulted in false
warnings about uninitialized memory. Avoid this by explicitly
initializing the pointer array to NULL and also skipping any invalid
NULL entry in the helper function.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agodbus: Add PropertiesChanged signal to Peer object
Tomasz Bursztyka [Mon, 2 Jun 2014 14:42:08 +0000 (17:42 +0300)] 
dbus: Add PropertiesChanged signal to Peer object

This signal will be thrown when a Peer joins or leaves a group.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
11 years agoP2P: Add a utility function to run a method on every known peer
Tomasz Bursztyka [Mon, 2 Jun 2014 14:42:07 +0000 (17:42 +0300)] 
P2P: Add a utility function to run a method on every known peer

This will be useful in wpa_supplicant part to signal if a peer got its
group changed.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
11 years agodbus: Remove GroupMember object type and use Peer instead
Tomasz Bursztyka [Mon, 2 Jun 2014 14:42:06 +0000 (17:42 +0300)] 
dbus: Remove GroupMember object type and use Peer instead

GroupMember is unusable in itself and all the necessary informations are
stored in Peer objects, thus replace the use of GroupMember by Peer.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
11 years agodbus: Add a Groups property to a Peer object on which it belongs
Tomasz Bursztyka [Mon, 2 Jun 2014 14:42:05 +0000 (17:42 +0300)] 
dbus: Add a Groups property to a Peer object on which it belongs

If only the Peer is part of one or more group, this property will tell
those via listing their object paths.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
11 years agoP2P: Add utility functions to get GO/client interface
Tomasz Bursztyka [Mon, 2 Jun 2014 14:42:04 +0000 (17:42 +0300)] 
P2P: Add utility functions to get GO/client interface

This will be useful for a peer to know if it is part of a group either
as a client of our local GO or as the peer GO.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
11 years agoP2P Add a utility to run a callback on all available groups
Tomasz Bursztyka [Mon, 2 Jun 2014 14:42:03 +0000 (17:42 +0300)] 
P2P Add a utility to run a callback on all available groups

This will be useful in wpa_supplicant to match group's SSIDs against a
specific one.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
11 years agoP2P: Add a utility function to get the group configuration
Tomasz Bursztyka [Mon, 2 Jun 2014 14:42:02 +0000 (17:42 +0300)] 
P2P: Add a utility function to get the group configuration

This will be useful for finding the interface related to this group
after formation based on the group SSID.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
11 years agoTDLS: Clean up add/set peer operations
Jouni Malinen [Sun, 29 Jun 2014 09:29:50 +0000 (12:29 +0300)] 
TDLS: Clean up add/set peer operations

Use a helper function to avoid multiple copies of the same long list of
argument parameters to wpa_sm_tdls_peer_addset() from the peer entry.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoTDLS: Tear down connection on malformed Setup Confirm
Arik Nemtsov [Wed, 25 Jun 2014 14:41:55 +0000 (17:41 +0300)] 
TDLS: Tear down connection on malformed Setup Confirm

Otherwise the peer will erroneously assume we have a working direct
link.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
11 years agoTDLS: Abort local setup when failing to add STA
Arik Nemtsov [Wed, 25 Jun 2014 14:41:54 +0000 (17:41 +0300)] 
TDLS: Abort local setup when failing to add STA

The driver might not always be able to add the new station. Abort the
setup when this happens.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
11 years agoTDLS: Update peer STA as soon as full peer info is available
Arik Nemtsov [Wed, 25 Jun 2014 14:41:53 +0000 (17:41 +0300)] 
TDLS: Update peer STA as soon as full peer info is available

Update the peer STA with full info sending TDLS Setup Response/Confirm
frames instead of after the full setup exchange. This makes it easier
for some drivers to properly negotiate QoS and HT information on the
direct link.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
11 years agoTDLS: Remove peer from global peer-list on free
Arik Nemtsov [Wed, 25 Jun 2014 14:41:52 +0000 (17:41 +0300)] 
TDLS: Remove peer from global peer-list on free

There is no need to keep the peer entry in memory after the link has
been removed.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Tested-by: Ilan Peer <ilan.peer@intel.com>
11 years agohostapd: Use channel switch fallback on error
Michal Kazior [Fri, 27 Jun 2014 12:19:30 +0000 (14:19 +0200)] 
hostapd: Use channel switch fallback on error

It's worth giving a try to fallback to re-starting BSSes at least once
hoping it works out instead of just leaving BSSes disabled.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
11 years agohostapd: Perform multi-BSS CSA for DFS properly
Michal Kazior [Fri, 27 Jun 2014 12:19:29 +0000 (14:19 +0200)] 
hostapd: Perform multi-BSS CSA for DFS properly

Currently hostapd data structures aren't ready for multi-channel BSSes,
so make DFS work now at least with single-channel multi-BSS channel
switching.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
11 years agohostapd: Make chan_switch command per-interface not per-BSS
Michal Kazior [Fri, 27 Jun 2014 12:19:28 +0000 (14:19 +0200)] 
hostapd: Make chan_switch command per-interface not per-BSS

Currently hostapd data structures aren't ready for multi-channel BSSes,
so make the command work now at least with single-channel multi-BSS
channel switching.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
11 years agohostapd: Move CSA parameters to hostapd_data
Michal Kazior [Fri, 27 Jun 2014 12:19:27 +0000 (14:19 +0200)] 
hostapd: Move CSA parameters to hostapd_data

This prepares CSA structure and logic in hostapd for multi-BSS channel
switching.

Signed-hostap: Michal Kazior <michal.kazior@tieto.com>

11 years agoeapol_test: Fix -R option to not replace -s option value
Dmitry Shmidt [Mon, 23 Jun 2014 19:13:20 +0000 (12:13 -0700)] 
eapol_test: Fix -R option to not replace -s option value

Commit e9852462d58750e2ec4be498e82db0e0a2dfaf7f ('eapol_test: Add PC/SC
reader and PIN command line arguments') did not add break to the switch
statement for the new -R command line option.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
11 years agoChange channel before IBSS associations
Christopher Wiley [Thu, 26 Jun 2014 20:13:07 +0000 (13:13 -0700)] 
Change channel before IBSS associations

Fix a bug where changing the mode of the interface to IBSS
fails because the interface is sitting on a channel where IBSS is
disallowed because of a previous association.

Signed-off-by: Christopher Wiley <wiley@chromium.org>
11 years agonl80211: Refactor mode switch logic
Christopher Wiley [Thu, 26 Jun 2014 20:13:06 +0000 (13:13 -0700)] 
nl80211: Refactor mode switch logic

In preparation for another wrinkle around switching into IBSS mode,
refactor existing mode switch logic for simplicity at the expense
of some brevity.

Signed-off-by: Christopher Wiley <wiley@chromium.org>
11 years agonl80211: Improve debug output by printing SA and DA in frames
Pontus Fuchs [Tue, 3 Jun 2014 08:24:54 +0000 (10:24 +0200)] 
nl80211: Improve debug output by printing SA and DA in frames

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
11 years agoPrint frame type name in debug output
Pontus Fuchs [Tue, 3 Jun 2014 08:24:53 +0000 (10:24 +0200)] 
Print frame type name in debug output

"stype=4" becomes "stype=4 (WLAN_FC_STYPE_PROBE_REQ)" etc.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
11 years agonl80211: Use low-priority scan for OBSS scan
Johannes Berg [Wed, 4 Jun 2014 09:21:40 +0000 (11:21 +0200)] 
nl80211: Use low-priority scan for OBSS scan

Some drivers may support low-priority scans, if they do then
use that for OBSS scanning.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agotests: P2P passphrase length configuration
Jouni Malinen [Sat, 21 Jun 2014 21:17:18 +0000 (00:17 +0300)] 
tests: P2P passphrase length configuration

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoP2P: Allow passphrase length to be configured
Jouni Malinen [Sat, 21 Jun 2014 21:15:53 +0000 (00:15 +0300)] 
P2P: Allow passphrase length to be configured

Previously, eight character random passphrase was generated
automatically for P2P GO. The new p2p_passphrase_len parameter can be
used to increase this length to generate a stronger passphrase for cases
where practicality of manual configuration of legacy devices is not a
concern.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoeapol_test: Add PC/SC reader and PIN command line arguments
Jouni Malinen [Sat, 21 Jun 2014 19:46:28 +0000 (22:46 +0300)] 
eapol_test: Add PC/SC reader and PIN command line arguments

The new command line arguments -R<reader> and -P<PIN> can now be used to
specify which PC/SC reader (prefix match) and PIN are to be used.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoUse pcsc_reader configuration in one for scard_init() call
Jouni Malinen [Sat, 21 Jun 2014 19:45:31 +0000 (22:45 +0300)] 
Use pcsc_reader configuration in one for scard_init() call

This allows PC/SC reader to be identified with the pcsc_reader
configuration parameter.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: EAP-SIM/AKA/AKA' protocol tests
Jouni Malinen [Fri, 20 Jun 2014 17:58:54 +0000 (20:58 +0300)] 
tests: EAP-SIM/AKA/AKA' protocol tests

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: EAP-SIM external_sim error cases
Jouni Malinen [Sat, 21 Jun 2014 16:26:04 +0000 (19:26 +0300)] 
tests: EAP-SIM external_sim error cases

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agoEAP-SIM': Fix AT_KDF parser to avoid infinite loop
Jouni Malinen [Sat, 21 Jun 2014 09:18:56 +0000 (12:18 +0300)] 
EAP-SIM': Fix AT_KDF parser to avoid infinite loop

Hitting maximum number of AT_KDF attributes could result in an infinite
loop due to the attribute parser not incrementing the current position
properly when skipping the extra KDF.

Signed-off-by: Jouni Malinen <j@w1.fi>
11 years agotests: EAP-AKA external_sim error cases
Jouni Malinen [Sat, 21 Jun 2014 08:21:12 +0000 (11:21 +0300)] 
tests: EAP-AKA external_sim error cases

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