libeap.git
14 years agoWPS ER: Add ctrl_iface notifications for AP/Enrollee add/remove
Jouni Malinen [Sun, 15 Nov 2009 10:07:27 +0000 (12:07 +0200)]
WPS ER: Add ctrl_iface notifications for AP/Enrollee add/remove

14 years agoWPS ER: Store AP UUID in binary format for future use
Jouni Malinen [Sun, 15 Nov 2009 09:07:20 +0000 (11:07 +0200)]
WPS ER: Store AP UUID in binary format for future use

14 years agoWPS: Use a dummy WSC_ACK as WLANEvent as the initial event if needed
Jouni Malinen [Sat, 14 Nov 2009 23:11:28 +0000 (01:11 +0200)]
WPS: Use a dummy WSC_ACK as WLANEvent as the initial event if needed

UPnP device architecture specification requires all evented variables to
be included in the initial event message after subscription. Since this
can happen before we have seen any events, generated a dummy event
(WSC_ACK with all-zeros nonces) if needed.

14 years agoWPS: Send SSDP byebye notifications when stopping UPnP advertisements
Jouni Malinen [Sat, 14 Nov 2009 22:46:58 +0000 (00:46 +0200)]
WPS: Send SSDP byebye notifications when stopping UPnP advertisements

This will notify control points of the services going away and allows
them to notice this without having to wait timeout on the
initial advertisements.

14 years agodbus: Use method/property/signal handler arrays for registration
Jouni Malinen [Sat, 14 Nov 2009 16:18:07 +0000 (18:18 +0200)]
dbus: Use method/property/signal handler arrays for registration

Clean up registration of large number of dbus method/property/signal
handlers by using arrays containing all the information needed to call
the registration functions.

14 years agodbus: Remove duplicated error printing from registration
Jouni Malinen [Sat, 14 Nov 2009 15:06:16 +0000 (17:06 +0200)]
dbus: Remove duplicated error printing from registration

wpa_dbus_{method,property,signal}_register() are now taking care of
error printing, so no need to duplicate the same code everywhere.

14 years agodbus: Split wpas_dbus_ctrl_iface_init() into helper functions
Jouni Malinen [Sat, 14 Nov 2009 14:57:07 +0000 (16:57 +0200)]
dbus: Split wpas_dbus_ctrl_iface_init() into helper functions

Clean up the method/property/signal registration code by using short
helper functions with the argument table near the registration call.

14 years agodbus: Minor coding style cleanup
Jouni Malinen [Sat, 14 Nov 2009 14:02:01 +0000 (16:02 +0200)]
dbus: Minor coding style cleanup

14 years agodbus: Fix some of the function comment typos
Jouni Malinen [Sat, 14 Nov 2009 13:57:02 +0000 (15:57 +0200)]
dbus: Fix some of the function comment typos

14 years agoWPS: Remove derivation of management keys
Jouni Malinen [Sat, 14 Nov 2009 12:18:15 +0000 (14:18 +0200)]
WPS: Remove derivation of management keys

MgmtAuthKey and MgmtEncKey were not used for anything and are unlikely
to ever be used, so better remove the code to reduce binary size.

14 years agoWPS: Remove unused WFA WLANConfig Service actions
Jouni Malinen [Sat, 14 Nov 2009 12:08:58 +0000 (14:08 +0200)]
WPS: Remove unused WFA WLANConfig Service actions

This removes following WFA WLANConfig Service actions and the related
state variables: GetAPSettings, SetAPSettings, DelAPSettings,
GetSTASettings, SetSTASettings, DelSTASettings, RebootAP,
ResetAP, RebootSTA, ResetSTA.

While WFA WLANConfig Service version 1.0 claims that some of these are
mandatory to implement for an AP, there are no known implementations
supporting these actions neither in an AP/proxy or an External Registrar
that would use them. These are unlikely to be supported in the future
either and as such, it is just simpler to get rid of them to clean up
the implementation and reduce code size.

14 years agoWPS ER: Fix Op-Code for WSC_{ACK,NACK,Done}
Jouni Malinen [Fri, 13 Nov 2009 20:40:27 +0000 (22:40 +0200)]
WPS ER: Fix Op-Code for WSC_{ACK,NACK,Done}

When using UPnP transport, the Op-Code is not included, but the WPS
frame processing will need this. Generate a matching Op-Code based
on the message type.

14 years agoWPS: Fix AP to proxy WSC_NACK to ER
Jouni Malinen [Fri, 13 Nov 2009 20:40:07 +0000 (22:40 +0200)]
WPS: Fix AP to proxy WSC_NACK to ER

14 years agoWPS: Fix OpCode when proxying WSC_ACK or WSC_NACK from ER
Jouni Malinen [Fri, 13 Nov 2009 20:29:31 +0000 (22:29 +0200)]
WPS: Fix OpCode when proxying WSC_ACK or WSC_NACK from ER

Previously, WSC_MSG was hardcoded for every message from ER, but
this needs to be changed based on message type to send a valid
message to the Enrollee via EAP transport.

14 years agoWPS ER: Add PIN configuration and SetSelectedRegistrar call
Jouni Malinen [Fri, 13 Nov 2009 20:07:11 +0000 (22:07 +0200)]
WPS ER: Add PIN configuration and SetSelectedRegistrar call

New PINs can now be added to WPS ER. This results in the ER code
using SetSelectedRegistrar to modify AP state so that Enrollees
will be able to notice the actice registrar more easily.

14 years agoWPS: Fix http_link_update() to nul terminate the result
Jouni Malinen [Fri, 13 Nov 2009 20:05:11 +0000 (22:05 +0200)]
WPS: Fix http_link_update() to nul terminate the result

14 years agoWPS ER: Add PutWLANResponse generation and transmission
Jouni Malinen [Wed, 11 Nov 2009 23:24:50 +0000 (01:24 +0200)]
WPS ER: Add PutWLANResponse generation and transmission

This allows the M2D message to be transmitted as a response to the
Enrollee via the proxying AP.

14 years agoWPS ER: Add STA/Enrollee entries and start processing EAP messages
Jouni Malinen [Wed, 11 Nov 2009 21:50:17 +0000 (23:50 +0200)]
WPS ER: Add STA/Enrollee entries and start processing EAP messages

This keeps STA/Enrollee entries up to date and sets up registration
protocol session. M1 is processed and M2D generated, but the there
is no code yet to transmit the response back to the AP with
PutWLANResponse.

14 years agoRemove a note about other repositories of wpa_supplicant
Jouni Malinen [Wed, 11 Nov 2009 15:56:21 +0000 (17:56 +0200)]
Remove a note about other repositories of wpa_supplicant

14 years agoReset EAPOL pointer when handling DBus smartcard parameters
David Smith [Wed, 11 Nov 2009 15:46:15 +0000 (17:46 +0200)]
Reset EAPOL pointer when handling DBus smartcard parameters

Smartcard parameter update via DBus ended up re-initializing the EAPOL
state machine without updating the pointer inside WPA state machine.
This can trigger a segfault when EAP layer attempts to use the old
reference. Fix this by re-initializing the pointer inside WPA state
machine.

14 years agoDisassociate STA if it associated with invalid/missing WPA/RSN IE
Andriy Tkachuk [Wed, 11 Nov 2009 15:33:55 +0000 (17:33 +0200)]
Disassociate STA if it associated with invalid/missing WPA/RSN IE

When using drivers that process management frames internally (e.g.,
madwifi, atheros, bsd), the driver may accept association with IEs
that do not match the security policy. Instead of silently leaving
the station associated, explicitly disassociate it to clear the
driver entry immediately.

14 years agoAdd dbus mechanism for fetching all network configuration parameters
Witold Sowa [Wed, 11 Nov 2009 15:17:00 +0000 (17:17 +0200)]
Add dbus mechanism for fetching all network configuration parameters

14 years agoAdd notifications for scan result BSS changes (added/removed)
Witold Sowa [Wed, 11 Nov 2009 15:07:53 +0000 (17:07 +0200)]
Add notifications for scan result BSS changes (added/removed)

If scan results introduce new BSSs or discards some previously known,
new wpas_notify_bss_added or wpas_notify_bss_removed notifications are
called.

14 years agohostapd: fix AP mode initialization for nl80211
Felix Fietkau [Wed, 11 Nov 2009 14:47:01 +0000 (16:47 +0200)]
hostapd: fix AP mode initialization for nl80211

Always bring down the wlan interface, even when not changing the
BSSID, the interface also needs to be down for changing its type
from managed to AP mode.

14 years agoWPS ER: Parse WLANEvent notifications and send HTTP response
Jouni Malinen [Tue, 10 Nov 2009 22:23:22 +0000 (00:23 +0200)]
WPS ER: Parse WLANEvent notifications and send HTTP response

The receive Probe Request and EAP-WSC notifications are now parsed
(including the TLVs in them) and contents is shown in the debug log.
Actual processing of the received information is still missing (TODO
comments indicate the needed functionality).

14 years agodbus: Use snprintf() and bounds checking instead of strcat()
Jouni Malinen [Tue, 10 Nov 2009 16:29:38 +0000 (18:29 +0200)]
dbus: Use snprintf() and bounds checking instead of strcat()

Better make sure we do not end up writing over the end of the local
registered_sig buffer regardless of how many arguments are used in
dbus method description.

14 years agodbus: Do not dereference wpa_s if explicitly checking it is not NULL
Jouni Malinen [Tue, 10 Nov 2009 16:20:12 +0000 (18:20 +0200)]
dbus: Do not dereference wpa_s if explicitly checking it is not NULL

There is no point checking whether wpa_s is not NULL after having
dereferenced it earlier in the function.. Furthermore, there is no
need to use a local variable for wpas_dbus_get_path() result.

14 years agodbus: Remove unnecessary wpa_s->bssid comparison
Jouni Malinen [Tue, 10 Nov 2009 16:11:18 +0000 (18:11 +0200)]
dbus: Remove unnecessary wpa_s->bssid comparison

This is an array and cannot have NULL value.

14 years agodbus: Fix a NULL pointer dereference on error path
Jouni Malinen [Tue, 10 Nov 2009 16:08:55 +0000 (18:08 +0200)]
dbus: Fix a NULL pointer dereference on error path

The cleanup routine in the end would have dereferenced props pointer
which could be NULL. There is no need to go through that cleanup code
in this case, so just exit from the function with return instead.

14 years agoCall wpas_notify_network_selected only if a specific network was selected
Jouni Malinen [Tue, 10 Nov 2009 16:06:02 +0000 (18:06 +0200)]
Call wpas_notify_network_selected only if a specific network was selected

ssid could be NULL here at least based on the function documentation,
so better check whether that is the case prior to calling the
notification function.

14 years agoFix per-SSID scan (scan_ssid=1)
Jouni Malinen [Tue, 10 Nov 2009 16:00:57 +0000 (18:00 +0200)]
Fix per-SSID scan (scan_ssid=1)

Commit d3a9822542166e7adec16e24622486ba90359ef5 broke per-SSID scan
by using the ssid variable for internal loop and by doing so,
overriding the value that was needed below to figure out whether the
scan is for a specific SSID. Fix this by using a temporary variable
instead when looping over network finding which frequencies to scan for.

14 years agodbus: Coding style cleanup
Jouni Malinen [Tue, 10 Nov 2009 15:51:59 +0000 (17:51 +0200)]
dbus: Coding style cleanup

14 years agodriver_prism54: Use os_zalloc instead of malloc to clear memory
Jouni Malinen [Tue, 10 Nov 2009 15:08:33 +0000 (17:08 +0200)]
driver_prism54: Use os_zalloc instead of malloc to clear memory

This will make sure the full buffer is initialized even if some
fields were not explicitly set.

14 years agoFix use-after-free issue with pid_file in hostapd termination
Jouni Malinen [Tue, 10 Nov 2009 15:05:28 +0000 (17:05 +0200)]
Fix use-after-free issue with pid_file in hostapd termination

14 years agoWPS: Fix credential processing for open network case
Jouni Malinen [Tue, 10 Nov 2009 15:01:26 +0000 (17:01 +0200)]
WPS: Fix credential processing for open network case

There is no point in comparing cred->key == NULL since cred->key is
an array (never NULL). key_len == 0 should be used instead to indicate
that no key was specified.

14 years agoFix hlr_auc_gw build (wpabuf.o is needed now for tls_openssh)
Jouni Malinen [Tue, 10 Nov 2009 14:53:47 +0000 (16:53 +0200)]
Fix hlr_auc_gw build (wpabuf.o is needed now for tls_openssh)

14 years agoFix comparison to use correct symbol name (__rand vs. rand)
Jouni Malinen [Tue, 10 Nov 2009 14:51:59 +0000 (16:51 +0200)]
Fix comparison to use correct symbol name (__rand vs. rand)

rand would be the address of rand() function and never NULL. The previous
version could have crashed on invalid AKA-AUTS command. Though, these
commands are only from hostapd which sends valid requests and as such,
the actual issue did not show up.

14 years agodbus: Remove unneeded typecast
Jouni Malinen [Tue, 10 Nov 2009 14:48:21 +0000 (16:48 +0200)]
dbus: Remove unneeded typecast

This was triggering some gcc versions to warn about strict aliasing.
Since the typecast is not really needed here, the cleanest way to get
rid of the warnings is to just use the correct type for the local
variable.

14 years agoAdd wpa_msg_ctrl() for ctrl_interface-only messages
Jouni Malinen [Tue, 10 Nov 2009 13:59:41 +0000 (15:59 +0200)]
Add wpa_msg_ctrl() for ctrl_interface-only messages

This is like wpa_msg(), but the output is directed only to
ctrl_interface listeners. In other words, the output will not be
shown on stdout or in syslog.

Change scan result reporting to use wpa_msg_ctrl() for
CTRL-EVENT-SCAN-RESULTS message at info level and wpa_printf() at
debug level to avoid showing scan result events in syslog in the
common configuration used with NetworkManager.

14 years agoInclude hostapd source code in wpa_supplicant release package
Jouni Malinen [Tue, 10 Nov 2009 09:55:55 +0000 (11:55 +0200)]
Include hostapd source code in wpa_supplicant release package

This is needed to be able to build with CONFIG_AP=y.

14 years agoFix non-WPS build
Jouni Malinen [Tue, 10 Nov 2009 09:35:25 +0000 (11:35 +0200)]
Fix non-WPS build

14 years agoWPS: Fixed printf size_t warning on 32-bit builds
Jouni Malinen [Tue, 10 Nov 2009 09:30:11 +0000 (11:30 +0200)]
WPS: Fixed printf size_t warning on 32-bit builds

14 years agoWPS: Fix WPS build with ER support disabled
Jouni Malinen [Tue, 10 Nov 2009 09:09:52 +0000 (11:09 +0200)]
WPS: Fix WPS build with ER support disabled

14 years agoReplace "git-archive" with "git archive" to fix release build
Jouni Malinen [Tue, 10 Nov 2009 09:08:15 +0000 (11:08 +0200)]
Replace "git-archive" with "git archive" to fix release build

14 years agowpa_supplicant: new DBus API implementation
Witold Sowa [Mon, 9 Nov 2009 21:51:59 +0000 (23:51 +0200)]
wpa_supplicant: new DBus API implementation

This patch implements the new DBus API. Both, the new and the
previous API may work concurrently and may be turned on or off
separately in .config file.
Some features of the new API are:
 - more wpa_supplicant's events are signaled with DBus signals,
 - introspection data (requires libxml2 and may be disabled),
 - CurrentBSS and CurrentNetwork properties,
 - PropertyChanged signal for most of properties,
 - Relatively easy to extend.
.config options for the new API are: CONFIG_CTRL_IFACE_DBUS_NEW=y and
CONFIG_CTRL_IFACE_DBUS_INTRO=y for introspection.

This commit misses couple of parts from the full implementation
(these are still under review):
- fetching all configuration parameters for learning WPS information
- scan result BSS add/remove notification (register_bss() and
  unregister_bss() notification callbacks)

14 years agoWPS ER: Subscribe to UPnP events
Jouni Malinen [Mon, 9 Nov 2009 18:01:50 +0000 (20:01 +0200)]
WPS ER: Subscribe to UPnP events

This adds code to start a HTTP server and to subscribe to UPnP events
from each discovered WPS AP. The event messages are received, but there
is not yet any code to actually parse the contents of the event.

14 years agoWPS: Read HTTP request within HTTP server code
Jouni Malinen [Sun, 8 Nov 2009 20:33:34 +0000 (22:33 +0200)]
WPS: Read HTTP request within HTTP server code

This removes HTTP related code from wps_upnp_web.c and makes it easier
to use HTTP server functionality for new uses (e.g., WPS ER).

14 years agoWPS: Add HTTP server module
Jouni Malinen [Sun, 8 Nov 2009 15:26:55 +0000 (17:26 +0200)]
WPS: Add HTTP server module

Clean up code so that UPnP implementation does not need to include all
the HTTP functionality. In addition, make it easier to share HTTP server
functionality with other components in the future.

14 years agoWPS ER: Fetch and parse device description
Jouni Malinen [Sun, 8 Nov 2009 14:46:03 +0000 (16:46 +0200)]
WPS ER: Fetch and parse device description

14 years agoWPS: Move generic UPnP XML helper functionality into a separate file
Jouni Malinen [Sun, 8 Nov 2009 12:06:01 +0000 (14:06 +0200)]
WPS: Move generic UPnP XML helper functionality into a separate file

14 years agoWPS: Add HTTP client module to clean up code
Jouni Malinen [Sun, 8 Nov 2009 10:35:37 +0000 (12:35 +0200)]
WPS: Add HTTP client module to clean up code

Instead of implementing HTTP client functionality inside
wps_upnp_event.c, use a generic HTTP client module to do this. The HTTP
client code can now be shared more easily for other purposes, too.

14 years agoWPS: Mark functions static
Jouni Malinen [Sat, 7 Nov 2009 15:04:19 +0000 (17:04 +0200)]
WPS: Mark functions static

These functions are used only within wps_upnp_event.c.

14 years agoWPS: Add initial part of External Registrar functionality
Jouni Malinen [Sat, 7 Nov 2009 10:41:01 +0000 (12:41 +0200)]
WPS: Add initial part of External Registrar functionality

This is the first step in adding support for using wpa_supplicant as a
WPS External Registrar to manage APs over UPnP. Only the device
discovery part is implemented in this commit.

14 years agoFix MCS set field to be based on driver info
Jouni Malinen [Thu, 5 Nov 2009 10:38:47 +0000 (12:38 +0200)]
Fix MCS set field to be based on driver info

Instead of using hardcoded Rx MCS bitmask (indexes 0..15 enabled),
use the real information from the driver capabilities.

14 years agoUse type-punning to avoid breaking strict aliasing rules
Jouni Malinen [Thu, 5 Nov 2009 10:11:49 +0000 (12:11 +0200)]
Use type-punning to avoid breaking strict aliasing rules

While the actual use here would be unlikely to be broken by any C
optimization, it is better to use explicit union construction to let
gcc know about the aliasing and avoid warnings from gcc 4.4.

14 years agoAllow driver and ctrl_interface parameters to be overridden
Jouni Malinen [Wed, 4 Nov 2009 18:16:15 +0000 (20:16 +0200)]
Allow driver and ctrl_interface parameters to be overridden

New wpa_supplicant command line options -o<driver> and -O<ctrl> can
now be used to override the parameters received in add interface
command from dbus or global ctrl_interface. This can be used, e.g.,
to enable control interface when using NetworkManager (add
-O/var/run/wpa_supplicant into the Exec parameter in
/usr/share/dbus-1/system-services/fi.epitest.hostap.WPASupplicant.service).
Similarly, this can be used to use another driver wrapper with
NetworkManager (e.g., -onl80211 to replace WEXT with nl80211).

14 years agoWork around some gcc 4.4 strict-aliasing warnings
Jouni Malinen [Wed, 4 Nov 2009 17:49:14 +0000 (19:49 +0200)]
Work around some gcc 4.4 strict-aliasing warnings

gcc 4.4 ends up generating strict-aliasing warnings about some very common
networking socket uses that do not really result in a real problem and
cannot be easily avoided with union-based type-punning due to struct
definitions including another struct in system header files. To avoid having
to fully disable strict-aliasing warnings, provide a mechanism to hide the
typecast from aliasing for now. A cleaner solution will hopefully be found
in the future to handle these cases.

14 years agoAdd Xcode project file for building wpa_supplicant
Jouni Malinen [Mon, 2 Nov 2009 17:37:46 +0000 (19:37 +0200)]
Add Xcode project file for building wpa_supplicant

14 years agoFix int_array_concat() to bail out on realloc failure
Jouni Malinen [Mon, 2 Nov 2009 17:14:17 +0000 (19:14 +0200)]
Fix int_array_concat() to bail out on realloc failure

The previous version could have ended up dereferencing a NULL pointer
if the reallocation call were to fail.

14 years agoWPS: SelectedRegistrar expiration for internal PIN registrar
Andriy Tkachuk [Sun, 1 Nov 2009 20:19:02 +0000 (22:19 +0200)]
WPS: SelectedRegistrar expiration for internal PIN registrar

Though we have such a timeout when handling SetSelectedRegistrar UPnP
message from an external registrar, it looks like we don't have one when
the internal registrar is activated for PIN connection. Thus we set the
SelectedRegistrar flag when AP is activated for PIN connection but we
never reset it - not by some timeout, nor when registration succeeds.
This lead to situations where AP everlastingly declare that it is
activated for WPS PIN connection when in reality it is not.

Use the same timeout (and also success with PIN) to clear the selected
registrar flag when using internal registrar, too.

14 years agoWPS: Abort ongoing PBC protocol run if session overlap is detected
Jouni Malinen [Sun, 1 Nov 2009 19:59:30 +0000 (21:59 +0200)]
WPS: Abort ongoing PBC protocol run if session overlap is detected

If PBC session overlap is detected during an ongoing PBC protocol run,
reject the run (if M8, i.e., credentials, have not yet been sent). This
provides a bit longer monitoring time at the Registrar for PBC mode to
catch some cases where two Enrollees in PBC mode try to enroll
credentials at about the same time.

14 years agoWPS: Add PBC overlap and timeout events from WPS module
Oleg Kravtsov [Sun, 1 Nov 2009 19:26:13 +0000 (21:26 +0200)]
WPS: Add PBC overlap and timeout events from WPS module

This provides information about PBC mode result from the WPS Registrar
module. This could be used, e.g., to provide a user notification on the
AP UI on PBC failures.

14 years agoWPS: Use Config Error 12 to indicate PBC overlap in M2D
Jouni Malinen [Sun, 1 Nov 2009 18:57:36 +0000 (20:57 +0200)]
WPS: Use Config Error 12 to indicate PBC overlap in M2D

If PBC session overlap is detected between button press on the registrar
and M1 is reception, report session overlap with the Config Error
attribute in M2D to the Enrollee.

14 years agoSME: Improve processing of association rejection
Jouni Malinen [Sat, 31 Oct 2009 21:21:43 +0000 (23:21 +0200)]
SME: Improve processing of association rejection

Force deauthentication from the AP to clear mac80211 state (it would get
stuck with future scans if the AP is left in authenticated, but not
associated, state).

Add blacklist entry for the AP to allow other APs with worse signal
strength to be tried (e.g., when APs are trying to do load balancing
with status code 17). Reduce wait for the next scan to speed up
connection in cases where there could be other APs that could accept
association, but which show worse signal strength.

14 years agoAllow CONFIG_DEBUG_SYSLOG=y to be used
Sam Leffler [Thu, 22 Oct 2009 18:17:05 +0000 (11:17 -0700)]
Allow CONFIG_DEBUG_SYSLOG=y to be used

Instead of having to add the syslog define manually into CFLAGS,
CONFIG_DEBUG_SYSLOG=y can now be used in .config.

14 years agoFix dbus build without EAP
Jouni Malinen [Thu, 22 Oct 2009 18:11:53 +0000 (11:11 -0700)]
Fix dbus build without EAP

14 years agoStub out the dbus function w/o CONFIG_WPS to fix build
Sam Leffler [Thu, 22 Oct 2009 18:08:10 +0000 (11:08 -0700)]
Stub out the dbus function w/o CONFIG_WPS to fix build

14 years agoMove shared MD5/SHA-1 internal definitions into header files
Jouni Malinen [Sat, 17 Oct 2009 09:55:12 +0000 (12:55 +0300)]
Move shared MD5/SHA-1 internal definitions into header files

14 years agoMove shared DES definitions into a header file
Jouni Malinen [Sat, 17 Oct 2009 09:53:27 +0000 (12:53 +0300)]
Move shared DES definitions into a header file

14 years agoMove PKCS# {1,5,8} functionality into separate files
Jouni Malinen [Sat, 17 Oct 2009 09:48:55 +0000 (12:48 +0300)]
Move PKCS# {1,5,8} functionality into separate files

This functionality fits better with src/tls (i.e., internal TLS
implementation), so move it there to make crypto_internal.c more
of a wrapper like other crypto_*.c files.

14 years agoTLS: Replace set_key helpers to return key instead of status code
Jouni Malinen [Sat, 17 Oct 2009 09:15:46 +0000 (12:15 +0300)]
TLS: Replace set_key helpers to return key instead of status code

The status code was not being used anyway, so it is simpler to
just return the key as is done in crypto functions.

14 years agoAdd support for PKCS #5 encrypted PKCS #8 keys with internal crypto
Jouni Malinen [Sat, 17 Oct 2009 09:06:36 +0000 (12:06 +0300)]
Add support for PKCS #5 encrypted PKCS #8 keys with internal crypto

Private keys can now be used in either unencrypted or encrypted
PKCS #8 encoding. Only the pbeWithMD5AndDES-CBC algorithm (PKCS #5)
is currently supported.

14 years agoAdd DES-CBC support into internal crypto implementation
Jouni Malinen [Sat, 17 Oct 2009 09:05:06 +0000 (12:05 +0300)]
Add DES-CBC support into internal crypto implementation

14 years agoInternal TLS: Add support for unencrypred PKCS#8 private keys in PEM
Jouni Malinen [Fri, 16 Oct 2009 19:00:45 +0000 (22:00 +0300)]
Internal TLS: Add support for unencrypred PKCS#8 private keys in PEM

Recognize the PEM header "BEGIN PRIVATE KEY" as base64-decode the data
to be able to use PEM encoded, unencrypted PKCS#8 private keys with the
internal TLS implementation. Previously, only DER encoding of the
PKCS#8 private key was supported.

14 years agoRemove wpa_priv on 'make clean'
Jouni Malinen [Fri, 16 Oct 2009 18:49:45 +0000 (21:49 +0300)]
Remove wpa_priv on 'make clean'

14 years agoAdd AP mode WPA status into ctrl_iface
Jouni Malinen [Fri, 16 Oct 2009 15:35:45 +0000 (18:35 +0300)]
Add AP mode WPA status into ctrl_iface

14 years agowpa_gui-qt4: Dynamically update associated STAs in peer dialog
Jouni Malinen [Fri, 16 Oct 2009 14:53:02 +0000 (17:53 +0300)]
wpa_gui-qt4: Dynamically update associated STAs in peer dialog

14 years agoAdd ctrl_iface events for AP mode STA connect/disconnect
Jouni Malinen [Fri, 16 Oct 2009 14:51:49 +0000 (17:51 +0300)]
Add ctrl_iface events for AP mode STA connect/disconnect

These are used to notify ctrl_iface monitors when a STA completes
connection (the port becomes authorized) and when a STA disconnects.

14 years agoopenssl: Allow build with OpenSSL 0.9.7
Jouni Malinen [Fri, 16 Oct 2009 12:57:17 +0000 (15:57 +0300)]
openssl: Allow build with OpenSSL 0.9.7

OpenSSL 0.9.7 does not include get_rfc3526_prime_1536() function, so
provide that functionality internally if needed. In addition, make
sha256_vector() building depend on whether SHA256 support is included
in the OpenSSL library. This with CONFIG_INTERNAL_SHA256=y in .config
allows OpenSSL without SHA256 support to be used.

14 years agoopenssl: Mark openssl_digest_vector() static
Jouni Malinen [Fri, 16 Oct 2009 12:54:52 +0000 (15:54 +0300)]
openssl: Mark openssl_digest_vector() static

14 years agoSkip networks without known SSID when selecting the BSS
Jouni Malinen [Thu, 15 Oct 2009 18:58:58 +0000 (21:58 +0300)]
Skip networks without known SSID when selecting the BSS

Previously, APs that were hiding SSID (zero-length SSID IE in
Beacon frames) could have been selected when wildcard SSID matching
was used. This would result in failed association attempt since
the client does not know the correct SSID. This can slow down WPS
which is often using wildcard SSID matching.

Ignore BSSes without known SSID in the scan results when selecting
which BSS to use.

14 years agowpa_supplicant and dbus code separation
Witold Sowa [Thu, 15 Oct 2009 18:15:10 +0000 (21:15 +0300)]
wpa_supplicant and dbus code separation

This patch completely separates supplicant's code from dbus.
It introduces three new notifications which copes with all
remaining dbus stuff.
wpas_notify_unregister_interface() was renamed to
wpas_notify_iface_removed().

14 years agoDo not schedule a new scan if no networks are enabled
Sam Leffler [Wed, 14 Oct 2009 19:05:58 +0000 (22:05 +0300)]
Do not schedule a new scan if no networks are enabled

This avoids an extra timeout to move to INACTIVE state.

14 years agoFix AES dependencies for CONFIG_AP=y (and IBSS) builds
Jouni Malinen [Tue, 13 Oct 2009 08:16:05 +0000 (11:16 +0300)]
Fix AES dependencies for CONFIG_AP=y (and IBSS) builds

14 years agoFix CONFIG_AP=y build without CONFIG_CTRL_IFACE
Jouni Malinen [Tue, 13 Oct 2009 08:15:39 +0000 (11:15 +0300)]
Fix CONFIG_AP=y build without CONFIG_CTRL_IFACE

14 years agoFix IEEE 802.11r/w compilation error
Masashi Honma [Tue, 13 Oct 2009 07:04:46 +0000 (10:04 +0300)]
Fix IEEE 802.11r/w compilation error

The hostapd/wpa_supplicant compilation failed with CONFIG_IEEE80211R=y
or CONFIG_IEEE80211W=y option if CONFIG_EAP_PSK and CONFIG_EAP_GPSK are
not used.

14 years agoDragonFly BSD: Fix driver_bsd.c build
Masashi Honma [Mon, 12 Oct 2009 06:56:57 +0000 (09:56 +0300)]
DragonFly BSD: Fix driver_bsd.c build

Both hostapd/wpa_supplicant compilation fails on DragonFly BSD.

This patch solves this issue.

I have tested only compilation. Not functionality.
Because I don't have any device which can work on DragonFly BSD.

14 years agonl80211: Work around mac80211 limitation on (re)auth when authenticated
Jouni Malinen [Mon, 12 Oct 2009 06:39:55 +0000 (09:39 +0300)]
nl80211: Work around mac80211 limitation on (re)auth when authenticated

mac80211 does not currently allow (re)authentication when we are already
authenticated. In order to work around this, force deauthentication if
nl80211 authentication command fails with EALREADY. Unfortunately, the
workaround code in driver_nl80211.c alone is not enough since the
following disconnection event would clear wpa_supplicant authentication
state. To handle this, add some code to restore authentication state
when using userspace SME.

This workaround will hopefully become unnecessary in some point should
mac80211 start accepting new authentication requests even when in
authenticated state.

14 years agoInclude aes_unwrap in build when needed (FT and EAP-FAST server)
Jouni Malinen [Mon, 12 Oct 2009 06:10:24 +0000 (09:10 +0300)]
Include aes_unwrap in build when needed (FT and EAP-FAST server)

14 years agoMFP: Clear IGTK
Masashi Honma [Mon, 12 Oct 2009 04:19:01 +0000 (07:19 +0300)]
MFP: Clear IGTK

The fourth and fifth keys are used as IGTK for management frame
protection. This patch clears these keys.

I have tested with linux kernel 2.6.31.2.

14 years agoReplace CONFIG_NO_AES_EXTRAS with auto-detection during build
Jouni Malinen [Sun, 11 Oct 2009 19:23:50 +0000 (22:23 +0300)]
Replace CONFIG_NO_AES_EXTRAS with auto-detection during build

There is no need to do this manually since it is possible to figure
out automatically which AES extra files need to be included in the
build.

14 years agoFix EAP-AKA server build without EAP-SIM
Jouni Malinen [Sun, 11 Oct 2009 19:23:05 +0000 (22:23 +0300)]
Fix EAP-AKA server build without EAP-SIM

14 years agoClean up crypto makefile segments
Jouni Malinen [Sun, 11 Oct 2009 19:04:29 +0000 (22:04 +0300)]
Clean up crypto makefile segments

Reorganize the TLS/crypto library segments into a single set of blocks
for each library instead of multiple locations handling library-specific
operations. Group crypto functionality together and get wpa_supplicant
and hostapd Makefile closer to eachother in order to make it easier to
eventually move this into a shared makefile.

14 years agoMove TLS_FUNCS and NEED_CRYPTO segment next to each other
Jouni Malinen [Sun, 11 Oct 2009 17:34:26 +0000 (20:34 +0300)]
Move TLS_FUNCS and NEED_CRYPTO segment next to each other

14 years agoFurther crypto makefile unification
Jouni Malinen [Sun, 11 Oct 2009 17:31:15 +0000 (20:31 +0300)]
Further crypto makefile unification

14 years agoFix crypto config for minimal builds
Jouni Malinen [Sun, 11 Oct 2009 17:19:12 +0000 (20:19 +0300)]
Fix crypto config for minimal builds

14 years agoCleaned up and unified some of the crypto Makefile code
Jouni Malinen [Sun, 11 Oct 2009 16:42:04 +0000 (19:42 +0300)]
Cleaned up and unified some of the crypto Makefile code

14 years agoAllow the internal DH implementation to be overridden
Jouni Malinen [Sun, 11 Oct 2009 16:17:22 +0000 (19:17 +0300)]
Allow the internal DH implementation to be overridden

Crypto library wrappers can now override the internal DH (group 5)
implementation. As a starting point, this is done with OpenSSL. The
new mechanism is currently available only for WPS (i.e., IKEv2 still
depends on the internal DH implementation).

14 years agoInclude only the used DH groups in the build
Jouni Malinen [Sun, 11 Oct 2009 12:24:40 +0000 (15:24 +0300)]
Include only the used DH groups in the build

This reduces the binary size by 3 kB or so when WPS is included in
the build, but IKEv2 is not.

14 years agonl80211: Add parsing of NL80211_BSS_SEEN_MS_AGO into scan results
Jouni Malinen [Thu, 1 Oct 2009 14:53:22 +0000 (17:53 +0300)]
nl80211: Add parsing of NL80211_BSS_SEEN_MS_AGO into scan results