libeap.git
15 years agonl80211: Preliminary code for usermode MLME support
Jouni Malinen [Fri, 15 Aug 2008 19:14:49 +0000 (22:14 +0300)]
nl80211: Preliminary code for usermode MLME support

This adds some parts needed to use usermode MLME with the current mac80211
(plus a patch to add a new cfg80211 command; not yet submitted to
wireless-testing). This version creates a monitor interface for management
frames and is able to send Probe Request frames during scan. However, it
looks like management frame reception is not yet working properly. In
addition, mlme_{add,remove}_sta() handlers are still missing.

15 years agoFixed supported rates IE generation for Probe Response frames.
Jouni Malinen [Fri, 15 Aug 2008 19:10:41 +0000 (22:10 +0300)]
Fixed supported rates IE generation for Probe Response frames.

15 years agonl80211: Fixed re-initialization of removed and re-inserted interface
Jouni Malinen [Fri, 15 Aug 2008 14:55:16 +0000 (17:55 +0300)]
nl80211: Fixed re-initialization of removed and re-inserted interface

Network device ifindex will change when the interface is re-inserted.
driver_nl80211.c will need to accept netlink events from "unknown" (based
on ifindex) interfaces when a previously used card was removed earlier. If
the previously removed interface is added back, the driver_wext data need
to be updated to match with the new ifindex value. In addition, the initial
setup tasks for the card (set interface up, update ifindex, set mode, etc.)
from wpa_driver_nl80211_init() need to be run again.

This is the changes from commit 3fbda8f943fff3e8afd649663bdcbba9cbfd6ee3
(driver_wext.c) ported for driver_nl80211.c.

15 years agonl80211: Fixed set_mode() to actually use adhoc/station nl80211 variables
Jouni Malinen [Fri, 15 Aug 2008 14:52:37 +0000 (17:52 +0300)]
nl80211: Fixed set_mode() to actually use adhoc/station nl80211 variables

15 years agoIEEE Std 802.11r-2008 has been released, so update references
Jouni Malinen [Fri, 15 Aug 2008 08:25:24 +0000 (11:25 +0300)]
IEEE Std 802.11r-2008 has been released, so update references

15 years agoPreparations for 0.6.4 release hostap_0_6_4
Jouni Malinen [Sun, 10 Aug 2008 17:33:12 +0000 (20:33 +0300)]
Preparations for 0.6.4 release

15 years agoFixed MinGW build without CONFIG_NDIS_EVENTS_INTEGRATED defined
Jouni Malinen [Sun, 10 Aug 2008 15:11:41 +0000 (18:11 +0300)]
Fixed MinGW build without CONFIG_NDIS_EVENTS_INTEGRATED defined

15 years agoRenamed MSG to PROC_MSG to avoid conflicts with MinGW winuser.h
Jouni Malinen [Sun, 10 Aug 2008 15:00:11 +0000 (18:00 +0300)]
Renamed MSG to PROC_MSG to avoid conflicts with MinGW winuser.h

15 years agoFixed a NULL pointer dereference when driver initialization fails
Jouni Malinen [Fri, 8 Aug 2008 16:30:58 +0000 (19:30 +0300)]
Fixed a NULL pointer dereference when driver initialization fails

15 years agoAdded support for setting BSS parameters with NL80211_CMD_SET_BSS
Jouni Malinen [Thu, 7 Aug 2008 17:09:55 +0000 (20:09 +0300)]
Added support for setting BSS parameters with NL80211_CMD_SET_BSS

This new cfg80211 command is used for setting CTS protect, short preamble,
and short slot time parameters for the BSS. The matching kernel change has
been submitted, but is not yet included in wireless-testing. The code here
used #ifdef to avoid compilation failures before the new command is
available.

15 years agoAdded support for opportunistic key caching (OKC)
Jouni Malinen [Sun, 3 Aug 2008 17:17:58 +0000 (20:17 +0300)]
Added support for opportunistic key caching (OKC)

This allows hostapd to share the PMKSA caches internally when multiple
BSSes or radios are being controlled by the same hostapd process.

15 years agoFixed opportunistic key caching (OKC)
Jouni Malinen [Sun, 3 Aug 2008 17:16:59 +0000 (20:16 +0300)]
Fixed opportunistic key caching (OKC)

wpa_sm_set_config() can be called even if the network block does not
change. However, the previous version ended up calling
pmksa_cache_notify_reconfig() every time and this cleared the network
context from PMKSA cache entries. This prevented OKC from ever being used.

Do not call pmksa_cache_notify_reconfig() if the network context remains
unchanged to allow OKC to be used.

15 years agoWEXT: Fixed re-initialization of removed and re-inserted interface
Jouni Malinen [Thu, 24 Jul 2008 22:30:53 +0000 (01:30 +0300)]
WEXT: Fixed re-initialization of removed and re-inserted interface

Network device ifindex will change when the interface is re-inserted.
driver_wext.c will need to accept netlink events from "unknown" (based on
ifindex) interfaces when a previously used card was removed earlier. If the
previously removed interface is added back, the driver_wext data need to be
updated to match with the new ifindex value. In addition, the initial setup
tasks for the card (set interface up, update ifindex, set mode, etc.) from
wpa_driver_wext_init() need to be run again.

15 years agoCleaned up some of invalid documentation related to channel configuration.
Jouni Malinen [Wed, 23 Jul 2008 00:51:10 +0000 (03:51 +0300)]
Cleaned up some of invalid documentation related to channel configuration.

15 years agoFixed NULL pointer dereference on error path [Bug 273]
Jouni Malinen [Fri, 18 Jul 2008 02:57:03 +0000 (05:57 +0300)]
Fixed NULL pointer dereference on error path [Bug 273]

15 years agoFixed EAP-TNC not to include extra EAP header and TNC flags
Jouni Malinen [Wed, 16 Jul 2008 23:17:37 +0000 (02:17 +0300)]
Fixed EAP-TNC not to include extra EAP header and TNC flags

The change to support fragmentation added extra function to generate the
EAP header, but forgot to remove the original code and ended up getting two
EAP headers and TNC flags field in the generated message. These header
fields need to be added only in the function that builds the final message
(and if necessary, fragments the data).

15 years agowext: fix maxrate calculation
Dan Williams [Tue, 15 Jul 2008 17:07:50 +0000 (20:07 +0300)]
wext: fix maxrate calculation

When scan results got moved from wpa_scan_result -> wpa_scan_res, the
'maxrate' member was dropped from wpa_scan_res.  The D-Bus interface
used 'maxrate', which was replaced with wpa_scan_get_max_rate().
Unfortunately, wpa_scan_get_max_rate() returns 802.11 rate values
directly from the IE, where 'maxrate' was the rate in bits/second.  The
supplicant internally fakes an IE for wpa_scan_res from the value of
wpa_scan_result->maxrate, but interprets ->maxrate as an 802.11 rate
index.

As a side-effect, this fixes a soft-break of the D-Bus control API since
the wpa_scan_res change was introduced.

15 years agoFixed wpa_scan_get_max_rate() to clear the basicrate flag when determining
Jouni Malinen [Tue, 15 Jul 2008 17:05:50 +0000 (20:05 +0300)]
Fixed wpa_scan_get_max_rate() to clear the basicrate flag when determining
the highest rate.

15 years agoMake proactive key caching working again
Michael Bernhard [Sun, 6 Jul 2008 07:50:53 +0000 (10:50 +0300)]
Make proactive key caching working again

Function 'wpa_sm_set_config' used the argument 'config' as the network
context which is a pointer to a local variable of the function
'wpa_supplicant_rsn_supp_set_config'.

This is one reason why no proactive key was generated. This network
context never matched with the network context saved in the pmksa cache
entries.

The structure 'rsn_supp_config' has already a member 'network_ctx' which
is now filled in by this patch with 'ssid'.

Signed-off-by: Michael Bernhard <michael.bernhard@bfh.ch>
15 years agoman wpa_supplicant: Clearly state which options are given per interface
Pavel Polischouk [Wed, 18 Jun 2008 08:52:20 +0000 (11:52 +0300)]
man wpa_supplicant: Clearly state which options are given per interface

Documentation appeared a little vague about which options are global and
which are tied to a particular interface. This leads to confusion when
using certain combinations of options, e.g. the command "wpa_supplicant
-c /etc/wpa_supplican.conf -u" will not do what is intuitively expected
from it - it will not read the config file given with -c option because
no -i option was given. This command is still valid because -u option is
used. The wpa_supplicant running like this will also not listen on any
control socket, because the socket file name is usually given in the
config file. This command line also happens to be the default in Fedora 9.
This patch does not try to change any behaviour, but rather document
these nuances clearly.

15 years agoAdd IGTK/MFP configuration (disabled by default)
Jouni Malinen [Wed, 18 Jun 2008 08:23:59 +0000 (11:23 +0300)]
Add IGTK/MFP configuration (disabled by default)

Added code to use suggested nl80211/cfg80211 API for setting MFP related
parameters. This is disabled by default since the API changes has not yet
been approved. The new commands can be enabled by defining
NL80211_MFP_PENDING (this will be removed once the API changes is
approved).

15 years agoAdded temporary #ifdef WEXT_MFP_PENDING around the MFP changes
Jouni Malinen [Wed, 18 Jun 2008 08:18:26 +0000 (11:18 +0300)]
Added temporary #ifdef WEXT_MFP_PENDING around the MFP changes

Just in case, do not use the not-yet-approved WEXT changes even if someone
where to build wpa_supplicant with IEEE 802.11w support unless this new
macro has been defined explicitly.

15 years agoWEXT: IEEE 802.11w/MFP configuration
Jouni Malinen [Wed, 18 Jun 2008 08:13:33 +0000 (11:13 +0300)]
WEXT: IEEE 802.11w/MFP configuration

Added configuration of MFP related parameters with WEXT. The changes to
linux/wireless.h have not yet been applied to the Linux kernel tree, so the
code using them is still open to changes and is ifdef'ed out if
CONFIG_IEEE80211W is not set.

15 years agoAdd support for the driver which do 4-way handshake
Masakazu Mokuno [Wed, 18 Jun 2008 08:09:00 +0000 (11:09 +0300)]
Add support for the driver which do 4-way handshake

Add the support for the Linux wireless drivers which want to do
4-way handshake and need to know the PSK before the handshake.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
15 years agoAdd the flags for the drivers which do 4-way handshake
Masakazu Mokuno [Wed, 18 Jun 2008 08:03:18 +0000 (11:03 +0300)]
Add the flags for the drivers which do 4-way handshake

Add the new flags which are supposed to be included in Linux 2.6.27
for the drivers which want to do 4-way handshake and to know PMK.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
15 years agoAdded WLAN_STA_MFP flag for driver wrappers so that they can configure the
Jouni Malinen [Tue, 17 Jun 2008 08:21:11 +0000 (11:21 +0300)]
Added WLAN_STA_MFP flag for driver wrappers so that they can configure the
driver to enable MFP (IEEE 802.11w) processing for the STA.

15 years agoAdded support for configuring IGTK
Jouni Malinen [Mon, 16 Jun 2008 08:20:01 +0000 (11:20 +0300)]
Added support for configuring IGTK

This needs changes in kernel code, too, but the cipher suite for IGTK is
defined in IEEE 802.11w, so this code in hostapd side can be added now.

15 years agoRemoved forgotten todo entry
Jouni Malinen [Tue, 10 Jun 2008 17:57:32 +0000 (20:57 +0300)]
Removed forgotten todo entry

15 years agoAdded support for AP mode Beacon transmission
Jouni Malinen [Tue, 10 Jun 2008 17:46:12 +0000 (20:46 +0300)]
Added support for AP mode Beacon transmission

15 years agoSet ACK flag properly for txstatus
Jouni Malinen [Tue, 10 Jun 2008 16:44:26 +0000 (19:44 +0300)]
Set ACK flag properly for txstatus

15 years agoUse _irqsafe versions of ieee80211 rx and tx_status functions
Jouni Malinen [Tue, 10 Jun 2008 16:28:39 +0000 (19:28 +0300)]
Use _irqsafe versions of ieee80211 rx and tx_status functions

15 years agoAdded start/stop handlers and do not send frames to stopped radios
Jouni Malinen [Tue, 10 Jun 2008 16:27:00 +0000 (19:27 +0300)]
Added start/stop handlers and do not send frames to stopped radios

15 years agoAdded a comment about hwsim#
Jouni Malinen [Tue, 10 Jun 2008 15:10:40 +0000 (18:10 +0300)]
Added a comment about hwsim#

15 years agoAdded global monitor interface (hwsim#)
Jouni Malinen [Tue, 10 Jun 2008 14:11:58 +0000 (17:11 +0300)]
Added global monitor interface (hwsim#)

This new netdev is created by hwsim, not mac80211, and as such, it is
available all the time (i.e., can be UP before starting mac80211 netdevs)
and it will receive all frames regardless of the channel etc.

15 years agoFixed tx() handler to use GFP_ATOMIC.
Jouni Malinen [Tue, 10 Jun 2008 12:49:06 +0000 (15:49 +0300)]
Fixed tx() handler to use GFP_ATOMIC.

15 years agoAdded mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211
Jouni Malinen [Tue, 10 Jun 2008 10:31:25 +0000 (13:31 +0300)]
Added mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211

mac80211_hwsim is a Linux kernel module that can be used to simulate
arbitrary number of IEEE 802.11 radios for mac80211 on a single
device. It can be used to test most of the mac80211 functionality and
user space tools (e.g., hostapd and wpa_supplicant) in a way that
matches very closely with the normal case of using real WLAN
hardware. From the mac80211 view point, mac80211_hwsim is yet another
hardware driver, i.e., no changes to mac80211 are needed to use this
testing tool.

15 years agoFixed race condition between disassociation event and group key handshake
Jouni Malinen [Mon, 9 Jun 2008 13:26:47 +0000 (16:26 +0300)]
Fixed race condition between disassociation event and group key handshake

This avoids getting stuck in state where wpa_supplicant has canceled scans,
but the driver is actually in disassociated state. The previously used code
that controlled scan timeout from WPA module is not really needed anymore
(and has not been needed for past four years since authentication timeout
was separated from scan request timeout), so this can simply be removed to
resolved the race condition. As an extra bonus, this simplifies the
interface to WPA module.
[Bug 261]

15 years agoEAP-PEAP: Moved the common peap_prfplus() function into a shared file
Jouni Malinen [Mon, 9 Jun 2008 07:32:12 +0000 (10:32 +0300)]
EAP-PEAP: Moved the common peap_prfplus() function into a shared file

15 years agoAdded a preliminary nl80211/cfg80211 driver interface for wpa_supplicant
Jouni Malinen [Fri, 6 Jun 2008 13:55:42 +0000 (16:55 +0300)]
Added a preliminary nl80211/cfg80211 driver interface for wpa_supplicant

driver_nl80211.c is based on driver_wext.c and it is still using Linux
wireless extensions for many functions. Over time, the new driver interface
code should be modified to use nl80211/cfg80211 for everything.

15 years agoFixed a buffer overflow in nla_parse call
Jouni Malinen [Fri, 6 Jun 2008 13:51:17 +0000 (16:51 +0300)]
Fixed a buffer overflow in nla_parse call

The first argument (tb) to nla_parse must have room for maxtype+1, not
maxtype, elements.

15 years agoFix compile warnings on 64-bit systems
Pavel Roskin [Fri, 6 Jun 2008 11:17:03 +0000 (14:17 +0300)]
Fix compile warnings on 64-bit systems

Don't cast pointers to int in definitions of PRISM2_HOSTAPD_RID_HDR_LEN
and PRISM2_HOSTAPD_GENERIC_ELEMENT_HDR_LEN.  Use size_t instead.  That's
actually what the code needs.

15 years agoUpdated the LibTomMath reference to use 0.41 version
Jouni Malinen [Fri, 6 Jun 2008 07:32:09 +0000 (10:32 +0300)]
Updated the LibTomMath reference to use 0.41 version

15 years agoRemoved the 20% estimate on faster bignum routines
Jouni Malinen [Fri, 6 Jun 2008 07:30:43 +0000 (10:30 +0300)]
Removed the 20% estimate on faster bignum routines

This was not accurate since this was mostly based on total runtime of an
eapol_test run. The real improvement in the bignum routines is much larger
(mayby twice as fast as before).

15 years agoCombined internal LibTomMath configuration into one option
Jouni Malinen [Fri, 6 Jun 2008 07:21:28 +0000 (10:21 +0300)]
Combined internal LibTomMath configuration into one option

CONFIG_INTERNAL_LIBTOMMATH_FAST=y in .config can now be used to enable all
optimized routines at a cost of about 4 kB. This is small enough increase
in size to justify simplified configuration.

15 years agoAdded an option to build internal LibTomMath with faster div routine
Jouni Malinen [Fri, 6 Jun 2008 07:11:17 +0000 (10:11 +0300)]
Added an option to build internal LibTomMath with faster div routine

At the cost of about 1 kB of additional binary size, the internal
LibTomMath can be configured to include faster div routine to speed up DH
and RSA. This can be enabled with CONFIG_INTERNAL_LIBTOMMATH_FAST_DIV=y in
.config.

15 years agoRead Michael MIC keys through TK2 union instead of offset from TK1
Jouni Malinen [Thu, 5 Jun 2008 18:00:56 +0000 (21:00 +0300)]
Read Michael MIC keys through TK2 union instead of offset from TK1

This gets rid of potential warnings about buffer bounds errors. The earlier
code works fine, but it is not the cleanest way of using the struct wpa_ptk
definition for TK1/TK2.

15 years agoFixed potential NULL pointer dereference if memory allocation fails
Jouni Malinen [Thu, 5 Jun 2008 17:44:30 +0000 (20:44 +0300)]
Fixed potential NULL pointer dereference if memory allocation fails

15 years agoFixed RADIUS client local address forcing for IPv6 (eapol_test)
Jouni Malinen [Thu, 5 Jun 2008 17:33:33 +0000 (20:33 +0300)]
Fixed RADIUS client local address forcing for IPv6 (eapol_test)

Need to use the IPv6 address data in bind() call if IPv6 is selected.

15 years agoAdd faster, optional sqr routine for internal LibTomMath
Jouni Malinen [Thu, 5 Jun 2008 15:33:46 +0000 (18:33 +0300)]
Add faster, optional sqr routine for internal LibTomMath

At the cost of about 0.5 kB of additional binary size, the internal
LibTomMath can be configured to include faster sqr routine to speed up DH
and RSA. This can be enabled with CONFIG_INTERNAL_LIBTOMMATH_FAST_SQR=y in
.config.

15 years agoSilence compiler warnings about out of array bounds indexes
Jouni Malinen [Thu, 5 Jun 2008 14:50:53 +0000 (17:50 +0300)]
Silence compiler warnings about out of array bounds indexes

struct wpa_ie_hdr had separate fields for 24-bit OUI and 8-bit oui_type
for WPA/RSN selectors. {WPA,RSN}_SELECTOR_{GET,PUT} access these four
octets through oui and the "out-of-bounds" access for the fourth octet is
actually reading/writing oui_type. This works fine, but some tools complain
about the array bounds "failure". Since oui_type is never accessed
separately, the simplest fix is to just combine these into a single 4-octet
field.

15 years agoGive adhoc associations a bit more time
Dan Williams [Wed, 4 Jun 2008 18:00:09 +0000 (21:00 +0300)]
Give adhoc associations a bit more time

Depending on how the driver implements IBSS searching and creation, it
may need to perform one or more scans before successfully completing the
association operation.  Therefore, increase the timeout for IBSS
association operations so that the supplicant doesn't interrupt the
driver as much.

15 years agowext: handle mode switches correctly for mac80211
Dan Williams [Wed, 4 Jun 2008 17:55:57 +0000 (20:55 +0300)]
wext: handle mode switches correctly for mac80211

Since mac80211 requires that the device be !IFF_UP to change the mode
(and I think the old prism54 fullmac driver does too), do that.  This
shouldn't harm fullmac devices since they can handle mode switches on
the fly and usually don't care about up/down that much.

15 years agoUpdated the comments since Montgomery reduction is now included
Jouni Malinen [Wed, 4 Jun 2008 08:59:45 +0000 (11:59 +0300)]
Updated the comments since Montgomery reduction is now included

15 years agoInternal LibTomMath: add optional support for Montgomery reduction
Jouni Malinen [Wed, 4 Jun 2008 08:57:55 +0000 (11:57 +0300)]
Internal LibTomMath: add optional support for Montgomery reduction

Add a cost of about 2.5 kB of additional cost, the internal LibTomMath can
be configured to include fast exptmod routine to speed up DH and RSA.
This can be enabled with CONFIG_INTERNAL_LIBTOMMATH_FAST_EXPTMOD=y in
.config.

15 years agoReduce integrated LibTomMath size by dropping negative exponent support
Jouni Malinen [Wed, 4 Jun 2008 08:26:52 +0000 (11:26 +0300)]
Reduce integrated LibTomMath size by dropping negative exponent support

Current uses do not require support for negative exponent in exptmod, so we
can save about 1.5 kB in leaving out invmod.

15 years agoIntroduced new helper function is_zero_ether_addr()
Jouni Malinen [Tue, 3 Jun 2008 15:08:48 +0000 (18:08 +0300)]
Introduced new helper function is_zero_ether_addr()

Use this inline function to replace os_memcmp(addr,
"\x00\x00\x00\x00\x00\x00", ETH_ALEN) == 0.

15 years agoFix USE_KERNEL_HEADERS build with compat-wireless
Jouni Malinen [Tue, 3 Jun 2008 08:57:52 +0000 (11:57 +0300)]
Fix USE_KERNEL_HEADERS build with compat-wireless

compat-wireless does not include linux/compiler.h to define __user, so
define it in hostapd code before including linux/wireless.h.

15 years agoDo not continually reschedule specific scans to help finding hidden SSIDs
Dan Williams [Tue, 3 Jun 2008 08:37:48 +0000 (11:37 +0300)]
Do not continually reschedule specific scans to help finding hidden SSIDs

In situations where the driver does background scanning and sends a
steady stream of scan results, wpa_supplicant would continually
reschedule the scan.  This resulted in specific SSID scans never
happening for a hidden AP, and the supplicant never connecting to the AP
because it never got found.  Instead, if there's an already scheduled
scan, and a request comes in to reschedule it, and there are enabled
scan_ssid=1 network blocks, let the scan happen anyway so the hidden
SSID has a chance to be found.

15 years agoInclude wireless_copy.h instead of linux/wireless.h to avoid conflicts
Jouni Malinen [Tue, 3 Jun 2008 08:31:42 +0000 (11:31 +0300)]
Include wireless_copy.h instead of linux/wireless.h to avoid conflicts

linux/wireless.h ends up including number of Linux kernel header files and
many of the definitions are conflicting with (or at least duplicating)
definitions in net/if.h.

15 years agowext: don't overwrite BSS frequency
Dan Williams [Mon, 2 Jun 2008 17:47:09 +0000 (20:47 +0300)]
wext: don't overwrite BSS frequency

mac80211 sends _both_ channel and frequency in it's scan results, with
frequency first and channel second (it's since been fixed to send
channel first and frequency second to work around this issue).  This
results in wpa_supplicant getting the right value when the frequency
comes, but overwriting the value with '0' when the channel comes because
wpa_supplicant can't handle 5GHz channel numbers.  So if a valid
previous SIOCGIWFREQ event came in, don't try to overwrite it.

15 years agoInternal TLS: Added support for parsing PKCS #8 formatted private keys
Jouni Malinen [Mon, 2 Jun 2008 16:39:46 +0000 (19:39 +0300)]
Internal TLS: Added support for parsing PKCS #8 formatted private keys

The internal TLS implementation can now use both PKCS #1 RSA private key
and PKCS #8 encapsulated RSA private key. PKCS #8 encrypted private key is
not yet supported.

15 years agoFixed dbus build without OpenSSL.
Jouni Malinen [Mon, 2 Jun 2008 15:45:45 +0000 (18:45 +0300)]
Fixed dbus build without OpenSSL.

15 years agoFixed build without CONFIG_IEEE8021X_EAPOL, but with CONFIG_CTRL_IFACE
Jouni Malinen [Fri, 30 May 2008 15:43:06 +0000 (18:43 +0300)]
Fixed build without CONFIG_IEEE8021X_EAPOL, but with CONFIG_CTRL_IFACE

15 years agoChanged TLS server to use OpenSSL SSL_accept() instead of SSL_read()
Jouni Malinen [Thu, 29 May 2008 17:36:18 +0000 (20:36 +0300)]
Changed TLS server to use OpenSSL SSL_accept() instead of SSL_read()

The server handshake processing was still using SSL_read() to get OpenSSL
to perform the handshake. While this works for most cases, it caused some
issues for re-authentication. This is now changed to use SSL_accept() which
is more approriate here since we know that the handshake is still going on
and there will not be any tunneled data available. This resolves some of
the re-authentication issues and makes it possible for the server to notice
if TLS processing fails (SSL_read() did not return an error in many of
these cases while SSL_accept() does).

Set session id context to a unique value in order to avoid fatal errors
when client tries session resumption (SSL_set_session_id_context() must be
called for that to work), but disable session resumption with the unique
value for the time being since not all server side code is ready for it yet
(e.g., EAP-TTLS needs special Phase 2 processing when using abbreviated
handshake).

Changed EAP-TLS server not to call TLS library when processing the final
ACK (empty data) from the client in order to avoid starting a new TLS
handshake with SSL_accept().

15 years agoUpdated the EAP-FAST patch for the latest OpenSSL 0.9.9 snapshot
Jouni Malinen [Thu, 29 May 2008 08:00:33 +0000 (11:00 +0300)]
Updated the EAP-FAST patch for the latest OpenSSL 0.9.9 snapshot

15 years agoAdded the EAP-FAST patch for OpenSSL 0.9.8h
Jouni Malinen [Thu, 29 May 2008 07:47:03 +0000 (10:47 +0300)]
Added the EAP-FAST patch for OpenSSL 0.9.8h

15 years agoAdd eap_tls_state() to get closer to EAP-TTLS/PEAP/FAST code
Jouni Malinen [Wed, 28 May 2008 14:19:57 +0000 (17:19 +0300)]
Add eap_tls_state() to get closer to EAP-TTLS/PEAP/FAST code

15 years agoShare EAP-TLS/PEAP/TTLS/FAST core process() functionality
Jouni Malinen [Wed, 28 May 2008 14:15:17 +0000 (17:15 +0300)]
Share EAP-TLS/PEAP/TTLS/FAST core process() functionality

Move the basic processing of received frames into eap_tls_common.c and use
callback functions to handle EAP type specific processing of the version
field and payload.

15 years agoDo not refer to Flags::Version field as 'PEAP version'
Jouni Malinen [Wed, 28 May 2008 06:59:55 +0000 (09:59 +0300)]
Do not refer to Flags::Version field as 'PEAP version'

This field is also used for EAP-TTLS and EAP-FAST, so it is clearer to use
a more generic term for it.

15 years agoRedesigned EAP-TLS/PEAP/TTLS/FAST fragmentation/reassembly
Jouni Malinen [Wed, 28 May 2008 06:57:17 +0000 (09:57 +0300)]
Redesigned EAP-TLS/PEAP/TTLS/FAST fragmentation/reassembly

Fragmentation is now done as a separate step to clean up the design and to
allow the same code to be used in both Phase 1 and Phase 2. This adds
support for fragmenting EAP-PEAP/TTLS/FAST Phase 2 (tunneled) data.

15 years agoFixed EAP-IKEv2 server fragment processing
Jouni Malinen [Mon, 26 May 2008 13:51:40 +0000 (16:51 +0300)]
Fixed EAP-IKEv2 server fragment processing

Need to clear the state back to MSG after having processed all incoming
fragments. Without this, the server got stuck in sending the fragment ACK
even after having received the full message.

15 years agoAdded a workaround for handling TLS compression
Jouni Malinen [Mon, 26 May 2008 09:33:04 +0000 (12:33 +0300)]
Added a workaround for handling TLS compression

Even though we try to disable TLS compression, it is possible that this
cannot be done with all TLS libraries. For example, OpenSSL 0.9.8 does not
seem to have a configuration item for disabling all compression (0.9.9 has
such an option). If compression is used, Phase 2 decryption may end up
producing more data than the input buffer due to compressed data. This
shows up especially with EAP-TNC that uses very compressible data format.

As a workaround, increase the decryption buffer length to (orig_len+500)*3.
This is a hack, but at least it handles most cases. TLS compression should
really be disabled for EAP use of TLS, but since this can show up with
common setups, it is better to handle this case.

15 years agoDo not define tls_engine_get_cert() if OpenSSL engine is disabled
Jouni Malinen [Mon, 26 May 2008 09:04:35 +0000 (12:04 +0300)]
Do not define tls_engine_get_cert() if OpenSSL engine is disabled

15 years agoAdded fragmentation support for EAP-TNC
Jouni Malinen [Mon, 26 May 2008 09:00:18 +0000 (12:00 +0300)]
Added fragmentation support for EAP-TNC

15 years agoExample configuration for EAP-TLS authentication using PKCS#11 TPM token
Jouni Malinen [Fri, 23 May 2008 16:41:05 +0000 (19:41 +0300)]
Example configuration for EAP-TLS authentication using PKCS#11 TPM token

15 years agoAdd support to wpa_supplicant configuring eap_peer for client cert and CA
David Smith [Fri, 23 May 2008 07:55:30 +0000 (10:55 +0300)]
Add support to wpa_supplicant configuring eap_peer for client cert and CA
cert on smartcard, plus handling phase2 auth with smartcard same as phase1.

15 years agoAdd support to eap_peer for client cert and CA cert on smartcard and in
David Smith [Fri, 23 May 2008 07:52:49 +0000 (10:52 +0300)]
Add support to eap_peer for client cert and CA cert on smartcard and in
phase2 auth.

15 years agoAdd support to crypto/tls for client cert and CA cert from smartcard
David Smith [Fri, 23 May 2008 07:49:59 +0000 (10:49 +0300)]
Add support to crypto/tls for client cert and CA cert from smartcard

15 years agoAdded instructions on how to create the DH parameters files.
Jouni Malinen [Wed, 21 May 2008 07:53:56 +0000 (10:53 +0300)]
Added instructions on how to create the DH parameters files.

15 years agoOnly use SSL_OP_NO_COMPRESSION if it is defined
Jouni Malinen [Wed, 21 May 2008 07:10:10 +0000 (10:10 +0300)]
Only use SSL_OP_NO_COMPRESSION if it is defined

It looks like this SSL_set_options() value was added in 0.9.9 and it does
not exist in stable releases of OpenSSL. Fix build by using #ifdef on this
variable before use.

15 years agoDisable TLS compression since the EAP-TTLS/PEAP/FAST payload processing
Jouni Malinen [Thu, 15 May 2008 13:48:44 +0000 (16:48 +0300)]
Disable TLS compression since the EAP-TTLS/PEAP/FAST payload processing
does not support it currently and EAP-TLS RFC does not allow compression to
be negotiated for TLS.

15 years agoUpdated the comment on 'bridge' variable to mention nl80211 which needs
Jouni Malinen [Wed, 7 May 2008 10:51:00 +0000 (13:51 +0300)]
Updated the comment on 'bridge' variable to mention nl80211 which needs
this parameter, too.

15 years agoFixed xsi:schemaLocation to use whitespace to separate members of the pair.
Jouni Malinen [Tue, 6 May 2008 18:29:14 +0000 (21:29 +0300)]
Fixed xsi:schemaLocation to use whitespace to separate members of the pair.

16 years agoAdd setSmartcardModules DBus message to set pkcs11 and opensc options
David Smith [Mon, 28 Apr 2008 14:15:56 +0000 (17:15 +0300)]
Add setSmartcardModules DBus message to set pkcs11 and opensc options

This will be used by most importantly network manager to set smartcard
options at run time.

16 years agoFix compilation without IEEE8021X_EAPOL defined
Henrik Brix Andersen [Mon, 28 Apr 2008 14:06:43 +0000 (17:06 +0300)]
Fix compilation without IEEE8021X_EAPOL defined

16 years agoDisable functionality in hostapd_deauth_all_stas for hostap driver only
Michael Bernhard [Wed, 16 Apr 2008 11:40:32 +0000 (14:40 +0300)]
Disable functionality in hostapd_deauth_all_stas for hostap driver only

Signed-off-by: Michael Bernhard <michael.bernhard@bfh.ch>
16 years agoFixed fallback to full handshake when server rejects PAC-Opaque
Jouni Malinen [Tue, 15 Apr 2008 14:24:06 +0000 (17:24 +0300)]
Fixed fallback to full handshake when server rejects PAC-Opaque

The TLS client changes in ssl3_get_server_hello() were based on the
pre-RFC 5077 version of OpenSSL and they hardcoded s->hit to 1 in case
PAC-Opaque was used. This prevented fallback to full TLS handshake in case
the server rejected PAC-Opaque in ClientHello. The fixed version simplifies
ssl3_get_server_hello() and uses the new RFC 5077 functionality in OpenSSL
(ssl3_check_finished) to allow the state machine handle start of
abbreviated handshake based on the used ticket.

16 years agoFixed fallback to full handshake when server rejects PAC-Opaque
Jouni Malinen [Tue, 15 Apr 2008 14:08:15 +0000 (17:08 +0300)]
Fixed fallback to full handshake when server rejects PAC-Opaque

The TLS client changes in ssl3_get_server_hello() were based on the
pre-RFC 5077 version of OpenSSL and they hardcoded s->hit to 1 in case
PAC-Opaque was used. This prevented fallback to full TLS handshake in case
the server rejected PAC-Opaque in ClientHello. The fixed version simplifies
ssl3_get_server_hello() and uses the new RFC 5077 functionality in OpenSSL
(ssl3_check_finished) to allow the state machine handle start of
abbreviated handshake based on the used ticket.

16 years agoFixed tls_prf() to handle keys with odd length
Jouni Malinen [Mon, 14 Apr 2008 17:11:49 +0000 (20:11 +0300)]
Fixed tls_prf() to handle keys with odd length

The middle byte of the secret (key for PRF) is shared with key halfs in
case the key length is odd. This does not happen in any of the current
tls_prf() uses, but it's better to fix this function to avoid future issues
should someone end up defining a use that uses an odd length for the key.

16 years agoSmall whitespace cleanup
Jouni Malinen [Sun, 13 Apr 2008 09:48:59 +0000 (12:48 +0300)]
Small whitespace cleanup

16 years agodriver_nl80211: Do not send nl80211 message if beacon is not set yet
Michael Bernhard [Sun, 13 Apr 2008 09:41:30 +0000 (12:41 +0300)]
driver_nl80211: Do not send nl80211 message if beacon is not set yet

Signed-off-by: Michael Bernhard <michael.bernhard at bfh.ch>
16 years agodriver_nl80211: Return correct value
Michael Bernhard [Sun, 13 Apr 2008 09:40:24 +0000 (12:40 +0300)]
driver_nl80211: Return correct value

Signed-off-by: Michael Bernhard <michael.bernhard at bfh.ch>
16 years agodriver_nl80211: Initialize local variable
Michael Bernhard [Sun, 13 Apr 2008 09:39:13 +0000 (12:39 +0300)]
driver_nl80211: Initialize local variable

This solves the problem with out-of-sync ACK messages.

Signed-off-by: Michael Bernhard <michael.bernhard at bfh.ch>
16 years agodriver_nl80211: Clone netlink callbacks instead of creating new ones
Michael Bernhard [Sun, 13 Apr 2008 09:37:49 +0000 (12:37 +0300)]
driver_nl80211: Clone netlink callbacks instead of creating new ones

This way the default callbacks are inherited.

Signed-off-by: Michael Bernhard <michael.bernhard at bfh.ch>
16 years agodriver_nl80211: Use customizable netlink callbacks
Bernhard Michael [Sun, 13 Apr 2008 09:36:23 +0000 (12:36 +0300)]
driver_nl80211: Use customizable netlink callbacks

This allows the use of NL_CB_VERBOSE or NL_CB_DEBUG.

Signed-off-by: Michael Bernhard <michael.bernhard at bfh.ch>
16 years agodriver_nl80211: Use the correct nl80211 command to flush all stations
Michael Bernhard [Sun, 13 Apr 2008 09:33:59 +0000 (12:33 +0300)]
driver_nl80211: Use the correct nl80211 command to flush all stations

Signed-off-by: Michael Bernhard <michael.bernhard at bfh.ch>
16 years agonl80211 driver: fix beacon interval setting
Johannes Berg [Wed, 9 Apr 2008 07:11:04 +0000 (10:11 +0300)]
nl80211 driver: fix beacon interval setting

This removes the hard-coded beacon interval setting.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
16 years agoTNC: Added preliminary code for IF-TNCCS-SOH client side support
Jouni Malinen [Tue, 8 Apr 2008 13:15:56 +0000 (16:15 +0300)]
TNC: Added preliminary code for IF-TNCCS-SOH client side support

Process SoH Request in SoH EAP Extension method and reply with SoH TLV. The
contents of SSoH is not yet complete (i.e., some of the required attributes
are still missing). Use of SoH is disabled by default; it can be enabled
with tnc=soh in phase1 parameter for PEAP.

16 years agoPEAPv0: Added crypto_binding configuration option (part of phase1)
Jouni Malinen [Tue, 8 Apr 2008 11:57:39 +0000 (14:57 +0300)]
PEAPv0: Added crypto_binding configuration option (part of phase1)

crypto_binding=# in phase1 network parameter can now be used to change the
PEAPv0 cryptobinding behavior (0 = do not use, 1 = optional (default),
2 = required).

16 years agoFix nl80211 driver to receive EAPOL response
Artem Antonov [Tue, 8 Apr 2008 06:49:06 +0000 (09:49 +0300)]
Fix nl80211 driver to receive EAPOL response

This patch fixes nl80211 driver to receive EAPOL response if wlan0 was
added to bridge.