libeap.git
14 years agoAdd GnuTLS build option for eap_example
Jouni Malinen [Sun, 16 Aug 2009 06:34:58 +0000 (09:34 +0300)]
Add GnuTLS build option for eap_example

14 years agoSupport PEM format RSA private key with internal TLS implementation
Jouni Malinen [Sun, 16 Aug 2009 06:34:21 +0000 (09:34 +0300)]
Support PEM format RSA private key with internal TLS implementation

14 years agoSet current ssid when entering AP mode
Witold Sowa [Sat, 15 Aug 2009 18:04:50 +0000 (21:04 +0300)]
Set current ssid when entering AP mode

After successful starting AP mode, current_ssid field is set to
ssid used to create AP.

14 years agoNetBSD: Fix wired IEEE 802.1X problem
Masashi Honma [Sat, 15 Aug 2009 17:59:16 +0000 (20:59 +0300)]
NetBSD: Fix wired IEEE 802.1X problem

On NetBSD 5.0, when I use wired 802.1X, "Invalid argument" occurs
on SIOCADDMULTI ioctl and 802.1X fails.

I tried FreeBSD code, but "Address family not supported by protocol family"
occurs on SIOCADDMULTI ioctl and 802.1X fails, too.

This patch solves this issue.

I have tested with these:
OS : NetBSD 5.0
EAP : EAP-MD5
Switch : CentreCOM 8724SL

14 years agoAdded new SHA1 files into VS project files to fix the build
Jouni Malinen [Sat, 15 Aug 2009 17:51:35 +0000 (20:51 +0300)]
Added new SHA1 files into VS project files to fix the build

14 years agoWPS: Workaround mixed-mode WPA+WPA2 auth type in credentials
Jouni Malinen [Sat, 15 Aug 2009 17:40:45 +0000 (20:40 +0300)]
WPS: Workaround mixed-mode WPA+WPA2 auth type in credentials

An SMC router was reported to use 0x22 (WPAPSK + WPA2PSK) in the
authentication type of the provisioned credential and wpa_supplicant
rejected this as invalid. Work around this by replacing WPAPSK + WPA2PSK
with WPA2PSK.

14 years agoFigure out absolute path for the pid file before daemonizing
Jouni Malinen [Sat, 15 Aug 2009 17:09:24 +0000 (20:09 +0300)]
Figure out absolute path for the pid file before daemonizing

This allows relative path to be used in the same way as was already
supported by wpa_supplicant.

14 years agoForce rebuilding of src/drivers between hostapd and wpa_supplicant
Jouni Malinen [Fri, 14 Aug 2009 17:40:37 +0000 (20:40 +0300)]
Force rebuilding of src/drivers between hostapd and wpa_supplicant

This is a (hopefully) temporary workaround to allow the same source code
tree to be used for building hostapd and wpa_supplicant without having
to manually force recompilation of some files. Currently, some of the
driver wrapper files need to be built separately for hostapd and
wpa_supplicant (#ifdef's in the files based on AP functionality).

This is somewhat racy as far as parallel make execution is concerned,
i.e., it may be necessary to run "make -j#" twice (plain "make" works
fine. Since this is supposed to be a temporary workaround, there is not
much point in trying to fix this with any more complex make processing.

14 years agoReplace NEED_MLME with NEED_AP_MLME
Johannes Berg [Fri, 14 Aug 2009 17:01:41 +0000 (20:01 +0300)]
Replace NEED_MLME with NEED_AP_MLME

This makes it clearer that it's about the AP, not client-side MLME, even
when built into the client (wpa_supplicant).

14 years agoCreate a common drivers makefile snippet
Johannes Berg [Fri, 14 Aug 2009 16:53:27 +0000 (19:53 +0300)]
Create a common drivers makefile snippet

Instead of having all driver stuff collected across wpa_supplicant
and hostapd, create a common snippet that they both include and
that handles the build configuration.

14 years agowpa_passphrase does not need FIPS PRF, MD4, or AES extra functionality
Jouni Malinen [Thu, 13 Aug 2009 14:07:36 +0000 (17:07 +0300)]
wpa_passphrase does not need FIPS PRF, MD4, or AES extra functionality

14 years agoAvoid a theoretical integer overflow in base64_encode()
Jouni Malinen [Thu, 13 Aug 2009 13:36:41 +0000 (16:36 +0300)]
Avoid a theoretical integer overflow in base64_encode()

If base64_encode() were to be used with a huge data array, the
previous version could have resulted in overwriting the allocated
buffer due to an integer overflow as pointed out in
http://www.freebsd.org/cgi/query-pr.cgi?pr=137484. However, there
are no know use cases in hostapd or wpa_supplicant that would do that.
Anyway, the recommended change looks reasonable and provides additional
protection should the base64_encode() function be used for something
else in the future.

14 years agoFix hlr_auc_gw build after crypto build cleanup
Jouni Malinen [Thu, 13 Aug 2009 08:50:52 +0000 (11:50 +0300)]
Fix hlr_auc_gw build after crypto build cleanup

14 years agoIgnore the generated libeap.a file
Jouni Malinen [Thu, 13 Aug 2009 08:44:15 +0000 (11:44 +0300)]
Ignore the generated libeap.a file

14 years agoFix eap_example build after the crypto build cleanup
Jouni Malinen [Thu, 13 Aug 2009 08:43:32 +0000 (11:43 +0300)]
Fix eap_example build after the crypto build cleanup

14 years agoCrypto build cleanup: remove CONFIG_NO_AES_*
Johannes Berg [Thu, 13 Aug 2009 08:40:28 +0000 (11:40 +0300)]
Crypto build cleanup: remove CONFIG_NO_AES_*

Instead of using a defines and conditional building of AES parts,
move the conditional functionality into separate files.

14 years agoRemove some more crypto ifdef, fix a few small bugs
Johannes Berg [Thu, 13 Aug 2009 08:28:03 +0000 (11:28 +0300)]
Remove some more crypto ifdef, fix a few small bugs

14 years agoCrypto build cleanup: remove CONFIG_NO_AES_ENCRYPT
Johannes Berg [Thu, 13 Aug 2009 08:21:32 +0000 (11:21 +0300)]
Crypto build cleanup: remove CONFIG_NO_AES_ENCRYPT

Instead of using a define and conditional building of AES parts,
move the AES encryption routines into a separate file.

14 years agoCrypto build cleanup: remove CONFIG_NO_AES_DECRYPT
Johannes Berg [Thu, 13 Aug 2009 08:16:21 +0000 (11:16 +0300)]
Crypto build cleanup: remove CONFIG_NO_AES_DECRYPT

Instead of using a define and conditional building of AES parts,
move the AES decryption routines into a separate file.

14 years agoCrypto build cleanup: remove CONFIG_NO_PBKDF2
Johannes Berg [Tue, 11 Aug 2009 17:31:39 +0000 (20:31 +0300)]
Crypto build cleanup: remove CONFIG_NO_PBKDF2

Instead of using a define and conditional building of sha1.c parts,
move the PBKDF2 implementation into a separate file.

14 years agoCrypto build cleanup: remove CONFIG_NO_TLS_PRF
Johannes Berg [Tue, 11 Aug 2009 17:24:06 +0000 (20:24 +0300)]
Crypto build cleanup: remove CONFIG_NO_TLS_PRF

Instead of using a define and conditional building of sha1.c parts,
move the TLS PRF implementation into a separate file.

14 years agoCrypto build cleanup: remove CONFIG_NO_T_PRF
Johannes Berg [Tue, 11 Aug 2009 17:19:37 +0000 (20:19 +0300)]
Crypto build cleanup: remove CONFIG_NO_T_PRF

Instead of using a define and conditional building of sha1.c parts,
move the T-PRF implementation into a separate file.

14 years agoCrypto build cleanup: remove NEED_FIPS186_2_PRF
Johannes Berg [Tue, 11 Aug 2009 17:06:23 +0000 (20:06 +0300)]
Crypto build cleanup: remove NEED_FIPS186_2_PRF

Instead of using a define and conditional building of crypto wrapper
parts, move the FIPS 186-2 PRF implementation into separate files.

14 years agoCrypto build cleanup: remove INTERNAL_MD5
Johannes Berg [Tue, 28 Jul 2009 18:36:13 +0000 (21:36 +0300)]
Crypto build cleanup: remove INTERNAL_MD5

Instead of using a define and conditional building of md5.c parts,
move the internal-MD5 into a separate file.

14 years agoCrypto build cleanup: remove INTERNAL_MD4
Johannes Berg [Tue, 28 Jul 2009 18:27:02 +0000 (21:27 +0300)]
Crypto build cleanup: remove INTERNAL_MD4

In addition, rename md4.c to md4-internal.c to match in style with
SHA-1 conditionally built internal implementation.

14 years agoCrypto build cleanup: remove INTERNAL_SHA256
Johannes Berg [Tue, 28 Jul 2009 18:20:04 +0000 (21:20 +0300)]
Crypto build cleanup: remove INTERNAL_SHA256

Instead of using a define and conditional building of sha256.c parts,
move the internal-SHA256 into a separate file.

14 years agoCrypto build cleanup: remove INTERNAL_AES
Johannes Berg [Tue, 28 Jul 2009 18:09:57 +0000 (21:09 +0300)]
Crypto build cleanup: remove INTERNAL_AES

In addition, rename aes.c to aes-internal.c to match in style with
SHA-1 conditionally built internal implementation.

14 years agoCrypto build cleanup: remove INTERNAL_DES
Johannes Berg [Tue, 28 Jul 2009 18:00:44 +0000 (21:00 +0300)]
Crypto build cleanup: remove INTERNAL_DES

In addition, rename des.c to des-internal.c to match in style with
SHA-1 conditionally built internal implementation.

14 years agoCrypto build cleanup: remove INTERNAL_SHA1
Johannes Berg [Tue, 28 Jul 2009 17:47:04 +0000 (20:47 +0300)]
Crypto build cleanup: remove INTERNAL_SHA1

Instead of using a define and conditional building of sha1.c parts,
move the internal-SHA-1 into a separate file.

14 years agoCONFIG_WIRELESS_EXTENSION need not be in CFLAGS
Johannes Berg [Tue, 28 Jul 2009 17:25:19 +0000 (20:25 +0300)]
CONFIG_WIRELESS_EXTENSION need not be in CFLAGS

14 years agoCONFIG_WIRELESS_EXTENSION is purely internal to the Makefile
Johannes Berg [Fri, 24 Jul 2009 00:43:56 +0000 (02:43 +0200)]
CONFIG_WIRELESS_EXTENSION is purely internal to the Makefile

14 years agomake the build process quieter to see warnings
Johannes Berg [Fri, 24 Jul 2009 00:11:29 +0000 (02:11 +0200)]
make the build process quieter to see warnings

14 years agoRemove mac80211_hwsim code
Johannes Berg [Thu, 23 Jul 2009 21:16:55 +0000 (23:16 +0200)]
Remove mac80211_hwsim code

The hwsim code here can only compile with a very specific kernel
version, but is shipped with current kernels so you just need to enable
it in your kernel instead.

14 years agoClean up some more binaries in wpa_supplicant 'make clean'
Johannes Berg [Thu, 23 Jul 2009 21:44:36 +0000 (23:44 +0200)]
Clean up some more binaries in wpa_supplicant 'make clean'

14 years agonl80211: Fix WEP key configuration
Johannes Berg [Sun, 26 Jul 2009 18:22:55 +0000 (21:22 +0300)]
nl80211: Fix WEP key configuration

Current wpa_supplicant has a bug with WEP keys, it adds a zero-length
sequence counter field to netlink which the kernel doesn't accept.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
14 years agohostapd: fix auth encryption
Johannes Berg [Sun, 26 Jul 2009 18:15:47 +0000 (21:15 +0300)]
hostapd: fix auth encryption

hostapd currently tries to encrypt all auth frames,
except for "OPEN" and "SHARED with transaction 3".
This means that it will send an encrypted "unknown
auth algorithm" reply for all other algorithsm. Fix
this by changing the logic to only encrypt shared
key auth frames with transaction 3.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
14 years agoAllow wpa_supplicant to use libnl-2.0
Jon Loeliger [Sat, 25 Jul 2009 14:21:52 +0000 (17:21 +0300)]
Allow wpa_supplicant to use libnl-2.0

Change existing CONFIG_LIBNL20 compatibility code in
driver_nl80211.c to be used by both wpa_supplicant
and hostapd, but take care of nl_handle too now.

Propagate CONFIG_LIBNL20 out of .config file and onto
CFLAGS in the Makefile.

Use libnl-gen now too.

Signed-off-by: Jon Loeliger <jdl@bigfootnetworks.com>
---

14 years agoSet state to COMPLETE when AP mode has been initialized successfully
Witold Sowa [Sat, 25 Jul 2009 14:01:23 +0000 (17:01 +0300)]
Set state to COMPLETE when AP mode has been initialized successfully

14 years agoFix eap_example build with renamed EAP_* server defines
Jouni Malinen [Tue, 30 Jun 2009 16:52:10 +0000 (19:52 +0300)]
Fix eap_example build with renamed EAP_* server defines

1e5839e06fbc20945044239984b652da9c3fc772 renamed the defines for EAP
server, but did not update the eap_example Makefile to match. This
broke the server side of the EAP example (no methods were actually
enabled).

14 years agoFix EAP-TNC peer memory leak on an error path
Ryuji [Tue, 30 Jun 2009 16:39:13 +0000 (19:39 +0300)]
Fix EAP-TNC peer memory leak on an error path

14 years agoAdd root .gitignore file to cleanup ignore lists
Jouni Malinen [Mon, 29 Jun 2009 18:47:19 +0000 (21:47 +0300)]
Add root .gitignore file to cleanup ignore lists

This removes need for local configuration to ignore *.o and *~
and allows the src/*/.gitignore files to be removed (subdirectories
will inherit the rules from the root .gitignore).

14 years agoEAP-SIM peer: Remove AT_NOTIFICATION from Notification response
Jouni Malinen [Mon, 29 Jun 2009 18:42:29 +0000 (21:42 +0300)]
EAP-SIM peer: Remove AT_NOTIFICATION from Notification response

This attribute is not supposed to be used in the response frame (i.e.,
it is only in the EAP-Request/SIM-Notification frame) per RFC 4186
chapters 10.1 and 9.9. This is a minor bug since the server is required
to ignore the contents of the EAP-Response/SIM-Notification during
protected result indication per chapter 6.2.

EAP-AKA peer was already following the similar specification in RFC 4187,
but this was somehow missed in the EAP-SIM peer implementation.

14 years agoRename variable to avoid gcc warning about shadowed names
Jouni Malinen [Mon, 29 Jun 2009 18:26:48 +0000 (21:26 +0300)]
Rename variable to avoid gcc warning about shadowed names

14 years agoAdd generic infrastructure for Probe Request callbacks
Jouni Malinen [Fri, 12 Jun 2009 15:13:40 +0000 (18:13 +0300)]
Add generic infrastructure for Probe Request callbacks

Instead of calling specific Probe Request handler functions, use a
generic mechanism that allows multiple callback functions to be
registered for getting notification on receive Probe Request frames.

14 years agoReplace hostapd_wps_probe_req_rx() with more generic ProbeReq notifier
Jouni Malinen [Fri, 12 Jun 2009 14:31:43 +0000 (17:31 +0300)]
Replace hostapd_wps_probe_req_rx() with more generic ProbeReq notifier

The driver wrappers should not need to include wps_hostapd.h, so let's
make this easier by introducing a driver callback for reporting Probe
Request frames.

14 years agoX.509: Add parsing of alternative name to internal TLS implementation
Jouni Malinen [Thu, 11 Jun 2009 20:47:35 +0000 (23:47 +0300)]
X.509: Add parsing of alternative name to internal TLS implementation

The alternative name extensions are now parsed, but the actual values
are not yet used for alt. subject name matching.

14 years agoWPS: Change wpa_supplicant wps_reg to not send out M8
Jouni Malinen [Wed, 10 Jun 2009 12:53:35 +0000 (15:53 +0300)]
WPS: Change wpa_supplicant wps_reg to not send out M8

Since we do not currently support changing the AP settings received
from M7, there is no point in actually sending out the M8 that would
likely trigger the AP to reconfigure itself and potentially reboot.
For now, we just receive the AP settings in M7 and add a local network
configuration block based on those, but NACK the message. This makes
wps_reg work like wps_pin, but by using the AP PIN instead of a client
PIN.

14 years agodriver_bsd.c: Use new MLME method of association.
Roy Marples [Fri, 29 May 2009 19:41:43 +0000 (22:41 +0300)]
driver_bsd.c: Use new MLME method of association.

Old way does not work with all drivers on NetBSD and FreeBSD are
also using this so should be a safe change. [Bug 312]

Signed-off-by: Roy Marples <roy@marples.name>
14 years agodriver_bsd.c: Reduce code duplication between hostapd and wpa_supplicant
Roy Marples [Fri, 29 May 2009 19:38:55 +0000 (22:38 +0300)]
driver_bsd.c: Reduce code duplication between hostapd and wpa_supplicant

Add generic functions to get/set 80211 vars, set 80211 params and
get/sid ssid.
Change NetBSD defines to match the ioctl used for portability.
Check size we're copying into instead of assuming IFNAMSIZ.

Signed-off-by: Roy Marples <roy@marples.name>
14 years agoComment out unused functions if IEEE8021X_EAPOL is not defined
Jouni Malinen [Fri, 29 May 2009 19:35:31 +0000 (22:35 +0300)]
Comment out unused functions if IEEE8021X_EAPOL is not defined

14 years agohostapd: EAP-AKA' needs SHA256
Jouni Malinen [Fri, 29 May 2009 19:35:08 +0000 (22:35 +0300)]
hostapd: EAP-AKA' needs SHA256

14 years agobsd: Get rid of printf size_t warnings with 64-bit builds
Jouni Malinen [Fri, 29 May 2009 19:34:07 +0000 (22:34 +0300)]
bsd: Get rid of printf size_t warnings with 64-bit builds

14 years agohostapd: nl80211 retry creating a interface if it fails the first time
Karl Hiramoto [Fri, 29 May 2009 18:48:19 +0000 (21:48 +0300)]
hostapd: nl80211 retry creating a interface if it fails the first time

If hostapd segfaults, or is killed with -9, or the interface already exists,
when the interface is created, it will fail.

Configuration file: /tmp/hostapd/hostapd.conf
Failed to create interface mon.wlan0_0.
Using interface wlan0_0 with hwaddr 00:13:01:01:08:0a and ssid 'IG_0405_LAN'
Failed to set beacon head/tail or DTIM period
Failed to create interface wlan0_1.

Try to remove the interface and re-create it before aborting.

14 years agoFix STA flag setting for auto-authorization if 802.1X/WPA is not used
Jouni Malinen [Thu, 28 May 2009 14:37:47 +0000 (17:37 +0300)]
Fix STA flag setting for auto-authorization if 802.1X/WPA is not used

The authorized flag needs to be added to the set_flags mask to fix
the flags_or/_and values that are now used with the new nl80211
attribute.

14 years agodbus: add 'scanning' property
Dan Williams [Wed, 27 May 2009 18:06:40 +0000 (21:06 +0300)]
dbus: add 'scanning' property

When the supplicant is connected and performs a scan, it doesn't enter
WPA_SCANNING state for various reasons.  However, external programs
still need to know that the supplicant is scanning since they may not
wish to perform certain operations during a scan (as those operations
will likely fail or yield incorrect results).  Add a 'scanning' property
and signal to the supplicant dbus interface to allow clients to
synchronize better with the supplicant when it scans.

Signed-off-by: Dan Williams <dcbw@redhat.com>
14 years agowext: disconnect at init and deinit
Dan Williams [Wed, 27 May 2009 18:01:26 +0000 (21:01 +0300)]
wext: disconnect at init and deinit

To ensure the supplicant starts and ends with a clean slate (keys are
already cleaned up at init and deinit time), force a null BSSID and
bogus SSID to ensure the driver isn't connected to anything.

Signed-off-by: Dan Williams <dcbw@redhat.com>
14 years agowext: Fix deauthentication to do IW_MLME_DEAUTH prior to disconnect
Dan Williams [Wed, 27 May 2009 17:57:29 +0000 (20:57 +0300)]
wext: Fix deauthentication to do IW_MLME_DEAUTH prior to disconnect

4853d5ac847efbfe54b80eeefabc2932696414c9 had a small bug in the order
of these function calls in _wext_deauthenticate() (_disassociate()
did have the correct order). The deauthentication frame is supposed
to go out (if driver supports that) before we disconnect more
forcefully.

14 years agowext: don't force-disconnect in ad-hoc mode
Dan Williams [Wed, 27 May 2009 17:55:15 +0000 (20:55 +0300)]
wext: don't force-disconnect in ad-hoc mode

Otherwise the driver might interpret the request as a request to
create/join a new adhoc network with the bogus SSID.

Signed-off-by: Dan Williams <dcbw@redhat.com>
14 years agohostapd: Require EAPOL-Key type to match with selected protocol
Jouni Malinen [Wed, 27 May 2009 06:52:24 +0000 (09:52 +0300)]
hostapd: Require EAPOL-Key type to match with selected protocol

Previously, we would have allowed both the WPA and RSN EAPOL-Key
types to be used regardless of whether the association is using
WPA or RSN/WPA2. This shouldn't result in any significant problems
on the Authenticator side, but anyway, we should check the type and
ignore the EAPOL-Key frames that used unexpected type.

14 years agoWPS: Add support for setting timeout for PIN
Jouni Malinen [Tue, 26 May 2009 14:44:44 +0000 (17:44 +0300)]
WPS: Add support for setting timeout for PIN

hostapd_cli wps_pin command can now have an optional timeout
parameter that sets the PIN lifetime in seconds. This can be used
to reduce the likelihood of someone else using the PIN should an
active PIN be left in the Registrar.

14 years agohostapd: Fix internal crypto build without TLS
Jouni Malinen [Tue, 26 May 2009 14:09:04 +0000 (17:09 +0300)]
hostapd: Fix internal crypto build without TLS

14 years agohostapd: Fix non-802.11w build
Jouni Malinen [Tue, 26 May 2009 14:08:43 +0000 (17:08 +0300)]
hostapd: Fix non-802.11w build

14 years agoResolve couple of compiler warnings
Jouni Malinen [Tue, 26 May 2009 14:08:16 +0000 (17:08 +0300)]
Resolve couple of compiler warnings

14 years agodriver_bsd.c: use get_scan_results2
Masashi Honma [Thu, 21 May 2009 08:34:54 +0000 (11:34 +0300)]
driver_bsd.c: use get_scan_results2

The attached patch will replace get_scan_results with get_scan_results2.
This is a preparation for WPS on BSD.
And I erased "wpa_scan_result_compar". Because scan result
sorting will be done with "wpa_scan_result_compar" on
"scan_helpers.c".

I have done below tests on NetBSD with an atheros card.
- WPA2-PSK(CCMP)
- WPA-PSK(TKIP)
- PEAP(MSCHAPv2)
- EAP-TLS
- EAP-TTLS(MSCHAPv2)

14 years agoFix hostapd and wpa_supplicant comipilation on NetBSD 4.0.1
Masashi Honma [Thu, 21 May 2009 08:21:09 +0000 (11:21 +0300)]
Fix hostapd and wpa_supplicant comipilation on NetBSD 4.0.1

14 years agonl80211: Add support for IEEE 802.1X port control in station mode
Jouni Malinen [Thu, 14 May 2009 18:54:47 +0000 (21:54 +0300)]
nl80211: Add support for IEEE 802.1X port control in station mode

This adds a cleaner mechanism for protecting against unauthorized
data frames than the previously used drop_unencrypted mechanism
(which is not even available with nl80211 and had to use a WEXT
ioctl.

The old drop_unencrypted code is left in for now as the final
surviving WEXT use in driver_nl80211.c. However, it can be removed
from the build by defining NO_WEXT. It may also be removed
eventually when most users are expected to be using recent enough
kernel version.

14 years agonl80211: Add support for NL80211_ATTR_STA_FLAGS2
Jouni Malinen [Thu, 14 May 2009 18:53:21 +0000 (21:53 +0300)]
nl80211: Add support for NL80211_ATTR_STA_FLAGS2

For now, the old code using NL80211_ATTR_STA_FLAGS is left in for
backwards compatibility with older kernel versions. It may be removed
eventually when most users are expected to be running with new
enough kernel version.

14 years agoSync with linux/nl80211.h from wireless-testing.git
Jouni Malinen [Thu, 14 May 2009 18:51:59 +0000 (21:51 +0300)]
Sync with linux/nl80211.h from wireless-testing.git

14 years agonl80211: Add MFP flag configuration for station mode
Jouni Malinen [Tue, 12 May 2009 08:55:18 +0000 (11:55 +0300)]
nl80211: Add MFP flag configuration for station mode

This fixes IEEE 802.11w use with driver_nl80211.c in station mode.

15 years agoFix WMM and MFP STA flag setting with flags_or/flags_and
Jouni Malinen [Mon, 11 May 2009 10:49:57 +0000 (13:49 +0300)]
Fix WMM and MFP STA flag setting with flags_or/flags_and

These were included correctly in total_flags, but not in
flags_or/flags_and.

15 years agoDrop unprotected Robust Action frames from MFP STAs
Jouni Malinen [Fri, 8 May 2009 09:51:28 +0000 (12:51 +0300)]
Drop unprotected Robust Action frames from MFP STAs

These frames are delivered through mac80211 monitor interface, so we
need to filter them out in hostapd.

15 years agohwsim_test: Tool for testing data connectivity with mac80211_hwsim
Jouni Malinen [Thu, 7 May 2009 14:59:53 +0000 (17:59 +0300)]
hwsim_test: Tool for testing data connectivity with mac80211_hwsim

This program can be used to verify that both unicast and broadcast
data frames can be transmitted successfully through mac80211_hwsim
interfaces.

15 years agoAdd more debugging details for SA Query processing
Jouni Malinen [Wed, 6 May 2009 16:04:01 +0000 (19:04 +0300)]
Add more debugging details for SA Query processing

15 years agoUpdate SA Query transaction id length based on IEEE 802.11w/D8.0
Jouni Malinen [Wed, 6 May 2009 15:57:17 +0000 (18:57 +0300)]
Update SA Query transaction id length based on IEEE 802.11w/D8.0

IEEE 802.11w/D8.0 changed the length of the SA Query transaction
identifier from 16 to 2 octets.

15 years agoReject hostapd configuration without channel for nl80211 drivers
Jouni Malinen [Wed, 6 May 2009 13:07:43 +0000 (16:07 +0300)]
Reject hostapd configuration without channel for nl80211 drivers

We could use auto-channel selection here eventually, but for now,
reject the configuration since it is not going to work correctly
(Beacon and Probe Response frames use incorrect value  in DS Params).

15 years agoWPS methods exported over DBus
Jaime Soriano Pastor [Wed, 6 May 2009 10:23:41 +0000 (13:23 +0300)]
WPS methods exported over DBus

I've exported the methods wpsPbc, wpsReg and wpsPin (patch attached),
so wpa_supplicant should be able to connect with WPS using the dbus
interface. I couldn't test it well because the problem seems to be in
my wireless card, a Broadcom BCM4328. At least it seems to do the same
using both interfaces. With ndiswrapper driver the "wpsie" entry
(thanks Dan!) didn't appear, and with the Broadcom wl driver it
appears but I cannot associate using WPS.

15 years agowpa_supplicant: add DBus method for changing debug parameters
Helmut Schaa [Wed, 6 May 2009 08:54:00 +0000 (11:54 +0300)]
wpa_supplicant: add DBus method for changing debug parameters

Add a new DBus method "setDebugParams" which takes the parameters
debug_level, debug_timestamp and show_keys as input and updates the
internal debug variables accordingly.

To change the debug level, enable/disable timestamps and enable/disable
show_keys the following dbus-send command can be used:

dbus-send --system --dest=fi.epitest.hostap.WPASupplicant --print-reply
/fi/epitest/hostap/WPASupplicant fi.epitest.hostap.WPASupplicant.setDebugParams
int32:0 boolean:false boolean:false

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
15 years agoAdd code to re-use an existing ctrl_iface socket file
Jouni Malinen [Wed, 6 May 2009 08:31:45 +0000 (11:31 +0300)]
Add code to re-use an existing ctrl_iface socket file

Port the code from wpa_supplicant to re-use an existing ctrl_iface
socket file if the file does not seem to be in use. This allows
hostapd to recover from unclean shutdown of the control interface.

15 years agoWPS: Add a workaround for auth/encr type flags mismatches
Jouni Malinen [Wed, 6 May 2009 07:56:18 +0000 (10:56 +0300)]
WPS: Add a workaround for auth/encr type flags mismatches

Some deployed implementations seem to advertise incorrect information
in this attribute. For example, Linksys WRT350N seems to have a
byteorder bug that breaks this negotiation. In order to interoperate
with existing implementations, assume that the Enrollee supports
everything we do.

15 years agoGeneral revision of RoboSwitch driver
Jouke Witteveen [Sun, 26 Apr 2009 18:25:48 +0000 (21:25 +0300)]
General revision of RoboSwitch driver

Attached is a patch for the RoboSwitch driver in trunk. It is a
general revision of the source code.

Changes:
- Improved IEEE 802.1X conformance ([1])
- Better conformity to Broadcom specifications
- Fixed compatibility with different chipset revisions

It is worth noting that performance may drop a little using the new
driver. This can be overcome by using "multicast_only=1" as a
parameter. In that case only packets to the PAE group address are
regarded, as the previous revision of the driver did. A more detailed
description of the parameter and it's consequences is available at [2]
(summary: use "multicast_only=1" whenever possible).

[1] http://lists.shmoo.com/pipermail/hostap/2009-February/019398.html
[2] http://forum.openwrt.org/viewtopic.php?id=19873

15 years agoAdd handling of SME auth/assoc timeout events
Jouni Malinen [Thu, 23 Apr 2009 21:08:24 +0000 (00:08 +0300)]
Add handling of SME auth/assoc timeout events

This allows wpa_supplicant to start searching for other APs (or re-try)
if the MLME times out.

15 years agoRemove unused set_broadcast_ssid() driver op
Jouni Malinen [Wed, 22 Apr 2009 13:15:24 +0000 (16:15 +0300)]
Remove unused set_broadcast_ssid() driver op

None of the driver wrappers user this. hostapd-controlled broadcast SSID
hiding can only be used with drivers that use hostapd for handling
Beacon and Probe Request/Response frames.

15 years agoRemove the unused set_ieee80211d driver op
Jouni Malinen [Wed, 22 Apr 2009 13:11:22 +0000 (16:11 +0300)]
Remove the unused set_ieee80211d driver op

None of the driver wrappers use this. Only the drivers that use hostapd
for Beacon and Probe Request/Response handling can now use IEEE 802.11d
properly.

15 years agoAdd new wpa_supplicant driver op for setting 802.1X port status
Jouni Malinen [Wed, 22 Apr 2009 13:01:37 +0000 (16:01 +0300)]
Add new wpa_supplicant driver op for setting 802.1X port status

This can be used with drivers that implement PAE to control whether
normal data frames (non-EAPOL) are allowed.

15 years agoMove default_wep_key variable into EAPOL authenticator data
Jouni Malinen [Wed, 22 Apr 2009 12:27:51 +0000 (15:27 +0300)]
Move default_wep_key variable into EAPOL authenticator data

With this change, eapol_sm.c does not need to dereference main hostapd
structures anymore (i.e., hostapd.h is not needed to be included).

15 years agonl80211: Replace WEXT code for RTS/fragmentation threshold
Jouni Malinen [Tue, 21 Apr 2009 15:11:07 +0000 (18:11 +0300)]
nl80211: Replace WEXT code for RTS/fragmentation threshold

nl80211 has new attributes for setting RTS and fragmentation threshold
values. Use these instead of the old WEXT ioctls.

15 years agoRemove unused set_retry() driver op
Jouni Malinen [Tue, 21 Apr 2009 15:01:43 +0000 (18:01 +0300)]
Remove unused set_retry() driver op

15 years agonl80211: Sync with linux/nl80211.h from wireless-testing.git
Jouni Malinen [Tue, 21 Apr 2009 14:54:50 +0000 (17:54 +0300)]
nl80211: Sync with linux/nl80211.h from wireless-testing.git

Note: This changes values for existing NL80211_ATTR_MAX_SCAN_IE_LEN
and NL80211_ATTR_KEY_TYPE (for some reason, they ended up getting
swapped in wireless-testing.git) and as such, could break Michael
MIC  error reporting (well, at least partially).

15 years agowpa_supplicant AP: Add preliminary support for WPS Internal Registrar
Jouni Malinen [Tue, 21 Apr 2009 13:45:16 +0000 (16:45 +0300)]
wpa_supplicant AP: Add preliminary support for WPS Internal Registrar

When in AP mode, wpa_supplicant is now enabling WPS (only Internal
Registrar). wpa_cli wps_pbc and wps_pin commands can be used to initiate
WPS negotiation similarly to how this is done in station mode (though,
the BSSID parameter is ignored).

15 years agowpa_supplicant AP: Add sta_set_flags
Jouni Malinen [Mon, 20 Apr 2009 13:33:13 +0000 (16:33 +0300)]
wpa_supplicant AP: Add sta_set_flags

15 years agowpa_supplicant AP: Add EAPOL frame TX and RX
Jouni Malinen [Mon, 20 Apr 2009 13:27:45 +0000 (16:27 +0300)]
wpa_supplicant AP: Add EAPOL frame TX and RX

This allows WPA-Personal 4-way handshake to be completed successfully.

15 years agowpa_supplicant AP: Update WPA/RSN configuration
Jouni Malinen [Mon, 20 Apr 2009 13:11:08 +0000 (16:11 +0300)]
wpa_supplicant AP: Update WPA/RSN configuration

Couple of additional operations are needed to make hostapd configuration
valid for WPA.

15 years agonl80211: Mark state disassociated on local deauth/disassoc
Jouni Malinen [Mon, 20 Apr 2009 08:37:35 +0000 (11:37 +0300)]
nl80211: Mark state disassociated on local deauth/disassoc

15 years agoMake deauthentication and disassociation consistent
Jouni Malinen [Mon, 20 Apr 2009 08:36:47 +0000 (11:36 +0300)]
Make deauthentication and disassociation consistent

This fixes an issue where the station was not marked disassociated
properly with locally requested deauthentication.

15 years agoDisconnect if 4-way handshake processing fails
Jouni Malinen [Mon, 20 Apr 2009 08:35:21 +0000 (11:35 +0300)]
Disconnect if 4-way handshake processing fails

There is no point in trying to continue if a 4-way handshake frame is
discarded or if PTK/GTK/IGTK configuration fails. Force the client to
disconnect in such a case to avoid confusing user by claiming the
connection was successfully completed.

15 years agowpa_supplicant AP: add sta_add() and sta_remove()
Jouni Malinen [Fri, 17 Apr 2009 17:09:20 +0000 (20:09 +0300)]
wpa_supplicant AP: add sta_add() and sta_remove()

15 years agowpa_supplicant AP: Fix build after hostapd driver_ops changes
Jouni Malinen [Fri, 17 Apr 2009 13:41:53 +0000 (16:41 +0300)]
wpa_supplicant AP: Fix build after hostapd driver_ops changes

15 years agonl80211: Add/remove monitor interface dynamically based on mode
Jouni Malinen [Fri, 17 Apr 2009 13:27:38 +0000 (16:27 +0300)]
nl80211: Add/remove monitor interface dynamically based on mode

15 years agonl80211: Delete Beacon information on deinit in wpa_supplicant AP mode
Jouni Malinen [Fri, 17 Apr 2009 13:06:12 +0000 (16:06 +0300)]
nl80211: Delete Beacon information on deinit in wpa_supplicant AP mode

15 years agoUse C99 designated initializers to cleanup driver_ops setup
Jouni Malinen [Fri, 17 Apr 2009 12:58:34 +0000 (15:58 +0300)]
Use C99 designated initializers to cleanup driver_ops setup

These driver wrappers use UNIX domain sockets and as such, won't be
built with Microsoft compiler. Consequently, use of C99-style designated
initializers can be used to make these files easier to maintain. Only
driver_ndis.c needs to support the old C89-style due to Microsoft
compiler not supporting newer C standard.