aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* doc: Add D-Bus documentation for Probe Request reportingJouni Malinen2015-01-021-0/+34
| | | | | | | | Commit 2d43d37ff2c3115da812bec8ea4c72048e1194d8 ('DBus: Add ability to report probe requests') added this capability, but forgot to document it. Signed-off-by: Jouni Malinen <j@w1.fi>
* doc: Fix D-Bus documentation for .Network PropertiesJouni Malinen2015-01-021-1/+1
| | | | | | | This propertry is not read-only, i.e., it can also be used to change configuration parameters for an existing network. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix WPS.Start method in AP/P2P GO modeJouni Malinen2015-01-021-34/+34
| | | | | | | | | Previously, role="enrollee" was required to be used to allow the AP mode WPS operation to be started. This is incorrect since the AP/GO will operate in Registrar role. Fix this by ignoring the role parameter when AP (including P2P GO) mode is enabled. Signed-off-by: Jouni Malinen <j@w1.fi>
* WPS: Reject station-mode WPS operations when AP mode is enabledJouni Malinen2015-01-021-0/+22
| | | | | | | | | | Start of station-mode WPS PBC/PIN/Registrar/NFC operation would result in the AP mode getting disabled. This can be particularly confusing for the P2P GO case where the group would need to be stopped cleanly. As such, it is better to reject these invalid operations rather than trying to handle all corner cases needed to allow this to work robustly. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Move NetworkRequest signal to correct registration arrayJouni Malinen2015-01-021-8/+8
| | | | | | | This is an interface signal, not a global signal, so move it to the current array for registering the signal. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Remove registration of P2PStateChanged signalJouni Malinen2015-01-021-6/+0
| | | | | | | This signal is not generated anywhere, so there is no point in claiming it to be available. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Make P2P Group Passphrase property getter available for P2P ClientJouni Malinen2015-01-021-8/+7
| | | | | | | | | There is no need to limit this property based on the role of the device in the group, so return the passphrase if it is available. It will be available in GO role and it may be available in P2P Client role based on whether the peer GO provided it during the WPS provisioning step. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix P2P Group PSK property getterJouni Malinen2015-01-021-8/+8
| | | | | | | | | | | This was returning a byte array of the pointer to the PSK, not the actual PSK, due to incorrect use of wpas_dbus_simple_array_property_getter(). In addition, there is no need to limit this property based on the role of the device in the group, so return the PSK if it is available (which it will be for both GO and P2P Client roles). Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Simplify out-of-memory reportingJouni Malinen2015-01-025-95/+41
| | | | | | | | | There is no need to have separate wpa_printf() and different error message strings for the unlikely out-of-error messages. Use a helper function, wpas_dbus_error_no_memory(), to get consistent behavior with a one-line call. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Remove the obsolete notes from wpas_dbus_error_unknown_error()Jouni Malinen2015-01-021-15/+1
| | | | | | | | | | | | Commit 6aeeb6fa21bc072ba92ce9423ba5c0417e8c0bf5 ('dbus: clean up new D-Bus interface getters and setters') redesigned the property getter/setter calls in a way that made the wpas_dbus_error_unknown_error() note about message being NULL in some cases obsolete. All the remaining callers are from method handler functions that must have a valid message. Remove the obsolete notes and unnecessary messsage == NULL check. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Coding style cleanupJouni Malinen2015-01-0217-630/+636
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Simplify message building error pathsJouni Malinen2015-01-028-1027/+520
| | | | | | | | | There is no need to have multiple separate return statements for error cases in a sequence of operations. In addition, there is not much point in "converting" boolean return values with "if (!res) return FALSE; return TRUE;" style constructions. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix GroupAdd, Invite, RemovePersistentGroup path validationJouni Malinen2015-01-021-3/+4
| | | | | | | | net_id_str can be NULL and that must be checked for to avoid NULL pointer dereference if an invalid persistent_group_object path is used with these methods. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix error message for Listen() failureJouni Malinen2015-01-021-3/+5
| | | | | | | DBUS_ERROR_NO_MEMORY does not look like the best option for the failure reason in case wpas_p2p_listen() fails. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Clean up wpas_dbus_new_decompose_object_path()Jouni Malinen2015-01-024-72/+62
| | | | | | | | | | | | | | | | | | None of the new D-Bus interface cases use the bssid_part in decompose_object_path (while the old interface ones do). As such, this is dead code and can be removed. In addition, the P2P addition here was pretty ugly extension. Replace these with a cleaner way of passing the separating string (e.g., "Networks") from the caller and returning the requested item. In addition, there is no need to allocate the returned item separately, so use a single allocation and a pointer to that allocated memory. This will make it easier for callers to have to free only a single allocation. This is also fixing a memory leak in P2P invitation persistent group case where the caller had missed the need to free the returned values. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Clean up parse_peer_object_path() usesJouni Malinen2015-01-021-14/+9
| | | | | | | | This helper function does not modify peer_path, so mark it const. In addition, there is no point in callers to check separately whether peer_path is NULL since that is taken care of by this helper function. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Remove useless NULL check from static functionJouni Malinen2015-01-021-2/+0
| | | | | | The entry argument cannot be NULL in this static function. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Add debug prints for parsing dict entriesJouni Malinen2015-01-021-8/+84
| | | | | | | This makes it easier to figure out what happens if there are issues with processing messages. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Remove useless wpa_s->conf checksJouni Malinen2015-01-022-37/+0
| | | | | | | | This cannot be NULL when an interface is in use. There is not much point in couple of functions checking this while large number of other places do not. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Write Get/Set property name in debug logJouni Malinen2015-01-021-1/+4
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Add more debug prints to cover operationsJouni Malinen2015-01-022-2/+11
| | | | | | | This adds the message signature to the new D-Bus interface message handler and similar prints to the old interface messages handlers. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix property change timer updateJouni Malinen2015-01-021-1/+1
| | | | | | | eloop_is_timeout_registered() was called with incorrect context argument which meant that the pending timeout would have never been found. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus (old): Fix removeNetwork method to not use freed memoryJouni Malinen2015-01-021-3/+4
| | | | | | | | wpa_supplicant_deauthenticate() call needs to happen before wpa_config_remove_network(). Freed memory could be dereferenced if removeNetwork method was issued on the currently connected network. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Avoid valgrind warning due to compiler optimizationJouni Malinen2015-01-021-0/+1
| | | | | | | | | | | | | | | | | | | It looks like both gcc and clang optimize the (entry.type != foo || entry.array_type != bar) in a way that ends up evaluating the second condition even when the first one results in 0. While this is not really what the C language requirements on short-circuit evaluation require, the compiler likely assumes this can have no side effects and with both type and array_type being comparable in a single 64-bit operation, this can clearly be a bit more efficient. While the code behaves same in both cases, valgrind does warn about use of uninitialized memory when the second condition is evaluated (entry.array_type is not initialized if entry.type != DBUS_TYPE_ARRAY). To keep valgrind logs cleaner, initialize entry.array_type to DBUS_TYPE_INVALID so that these compiler optimizations do not result in reading uninitialized memory. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Avoid compiler warning on sometimes uninitialized variableJouni Malinen2015-01-021-1/+2
| | | | | | | | | | | | The logic in wpas_dbus_signal_p2p_provision_discovery() seemed to imply that there could be a case where _signal would be used uninitized. While that is not the case since either (request || !status) or (!request && status) would always be true, some compilers do not seem to be clever enough to figure that out to avoid the warning. Make this easier for such compilers by removing the (!request && status) condition since it is identical to !(request || !status). Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Make WPAS_DBUS_TYPE_BINARRAY value less confusingJouni Malinen2015-01-011-1/+5
| | | | | | | | | | | | | Commit 911e97e4002019e577bb1086f1fd02daff978544 ('DBus: Refactor array adding, add binary arrays') introduced WPAS_DBUS_TYPE_BINARRAY as an internal fake type for array_type. However, it selected this value to be (DBUS_NUMBER_OF_TYPES + 100) = 116 = 't'. This happens to conflict with DBUS_TYPE_UINT64 ((int) 't'). While none of the existing array_type use cases supported UINT64, it is much clearer if WPAS_DBUS_TYPE_BINARRAY has a value that does not match any existing DBUS_TYPE_* value. Replace this with '@' (64). Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix dict binarray getter to accept empty array of arrayJouni Malinen2014-12-311-3/+8
| | | | | | | | | This is needed to allow Set(P2PDeviceConfig) to clear the VendorExtension array (i.e., to remove all configured vendor extensions). Previously, such an attempt was met with a D-Bus assert and rejection of the operation. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix memory leak on P2PDeviceConfig::VendorExtensionJouni Malinen2014-12-311-0/+3
| | | | | | | | The wps_vendor_ext array can be set using D-Bus Set(P2PDeviceConfig) with the VendorExtension key in the dictionary. However, there was no code for freeing the allocated memory when the interface is removed. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix GONegotiationSuccess signal passphrase formatJouni Malinen2014-12-311-7/+4
| | | | | | | Passphrase is a variable length string of (8..63 characters), not a byte array of fixed 64 octets. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Make wpas_dbus_error_scan_error() staticJouni Malinen2014-12-311-9/+5
| | | | | | This function is not used anywhere outside this file. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix ServiceDiscoveryResponse to accept int32 dialog_tokenJouni Malinen2014-12-311-1/+2
| | | | | | | | | | The ServiceDiscoveryRequest signal uses int32 for encoding dialog_token for some reason (even though this is a u8 field). ServiceDiscoveryResponse is supposed to accept the values from the signal as-is, so extend that to accept int32 in addition to the previously used uint32. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix memory leaks on AddService/DeleteService error pathsJouni Malinen2014-12-301-6/+10
| | | | | | | The query and service parameters need to be freed on all paths to avoid memory leaks in error cases. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix .Group Set(WPSVendorExtensions) formatJouni Malinen2014-12-301-1/+77
| | | | | | | | | | | | The earlier implementation seemed to require a strange extra encapsulation with a dictionary for setting the WPSVendorExtensions property while this was defined to have aay signature and the get operation did indeed return and array of array of bytes without that dictionary. Fix this to accept aay format for the setter as well. Keep support for the old dictionary encapsulation format for backwards compatibility. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Fix memory leak on P2P GO WPSVendorExtensionsJouni Malinen2014-12-302-0/+7
| | | | | | | | It was possible to add WPS vendor extensions through the D-Bus WPSVendorExtensions setter, but these extensions were not freed when the P2P GO was stopped or when replacing previously configured extensions. Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: Verify that wpa_supplicant clears keys from memoryJouni Malinen2014-12-306-3/+662
| | | | | | | Check that PMK and PTK and not left in memory (heap or stack) unnecessarily after they are not needed anymore. Signed-off-by: Jouni Malinen <j@w1.fi>
* SAE: Clear keys from memory on disassociationJouni Malinen2014-12-294-15/+25
| | | | | | | | There is no need to keep temporary keys in memory beyond the end of the association, so explicitly clear any SAE buffers that can contain keys as soon as such keys are not needed. Signed-off-by: Jouni Malinen <j@w1.fi>
* Clear GTK from memory as soon as it is not needed anymoreJouni Malinen2014-12-291-1/+3
| | | | | | | | It was possible for the decrypted EAPOL-Key Key Data field to remain in heap after the temporary buffer was freed. Explicitly clear that buffer before freeing it to minimize the time GTK remains in memory. Signed-off-by: Jouni Malinen <j@w1.fi>
* Clear psk_list while freeing config_ssid instancesJouni Malinen2014-12-291-3/+2
| | | | | | | | Previously, the main PSK entry was cleared explicitly, but psk_list could include PSKs for some P2P use cases, so clear it as well when freeing config_ssid instances. Signed-off-by: Jouni Malinen <j@w1.fi>
* Explicitly clear the temporary stack-based PSK bufferJouni Malinen2014-12-291-0/+3
| | | | | | | There is no need to leave this temporary key in stack memory after having been configured to the WPA state machine. Signed-off-by: Jouni Malinen <j@w1.fi>
* Explicitly clear the temporary stack-based key for WPA-NoneJouni Malinen2014-12-291-1/+4
| | | | | | | There is no need to leave this temporary key in stack memory after having been configured to the driver. Signed-off-by: Jouni Malinen <j@w1.fi>
* WPS ER: Explicitly clear PSK from stack after useJouni Malinen2014-12-291-1/+4
| | | | | | | | There is no need to leave the PSK from temporary Credential structure that was built in stack after that Credential has been passed to the WPS module. Signed-off-by: Jouni Malinen <j@w1.fi>
* Clear wpa_psk memory when setting up wpa_supplicant AP modeJouni Malinen2014-12-291-1/+1
| | | | | | | | | This is more of a theoretical case since this part is done only during setup and the structure is not allocated in practice. Anyway, maintaining more consistent use of bin_clear_free() for structures that may contain keys is useful. Signed-off-by: Jouni Malinen <j@w1.fi>
* Clear TK part of PTK after driver key configurationJouni Malinen2014-12-291-0/+4
| | | | | | | | | There is no need for wpa_supplicant to maintain a copy of the TK part of PTK after this has been configured to the driver, so clear that from heap memory and only maintain KEK and KCK during association to allow additional EAPOL-Key handshakes. Signed-off-by: Jouni Malinen <j@w1.fi>
* Clear temporary keys from WPA supplicant state machine when not neededJouni Malinen2014-12-291-2/+9
| | | | | | | | | | | | PMK and PTK are not needed in the supplicant state machine after disassociation since core wpa_supplicant will reconfigure them for the next association. As such, clear these from heap in wpa_sm_notify_disassoc() to reduce time and number of places storing key material in memory. In addition, clear FT keys in case of CONFIG_IEEE80211R=y build (sm->xxkey stored a copy of PSK in case of FT-PSK). Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: Filter out extra files from codecov reportsJouni Malinen2014-12-291-1/+9
| | | | | | | | | | | wpa_cli and hostapd_cli are not currently tested for code coverage, so filter the files specific to those components away from the code coverage reports. *_module_tests.c are not included in normal builds, so drop them as well. In addition, drop the system header file (byteswap.h) that gets somehow unnecessarily included in the reports for couple of lines. Signed-off-by: Jouni Malinen <j@w1.fi>
* doc: Add D-Bus signals Certification(), EAP(), NetworkRequest()Jouni Malinen2014-12-291-0/+59
| | | | | | | This documents number of EAP related D-Bus signals and the related NetworkResponse() method. Signed-off-by: Jouni Malinen <j@w1.fi>
* doc: Add D-Bus FlushBSS() methodJouni Malinen2014-12-291-0/+9
| | | | | | | | Commit 2b65b30da86f550dc8c228cb2c6456e76dbc7978 ('dbus: Add D-Bus methods to flush the BSS cache') added this, but forgot to update documentation. Signed-off-by: Jouni Malinen <j@w1.fi>
* doc: Add D-Bus RemoveAllNetworks() methodJouni Malinen2014-12-291-0/+5
| | | | | | | | Commit 7c49fdd0bd214f5fa3af8407d7011930ac150ef1 ('dbus: Add RemoveAllNetworks to the new D-Bus API') added this, but forgot to document it. Signed-off-by: Jouni Malinen <j@w1.fi>
* doc: Add D-Bus Reattach() methodJouni Malinen2014-12-291-0/+10
| | | | | | | | Commit 0f44ec8eba8a2b01e9c443308a72a2fd3208f7cf ('Add a reattach command for fast reassociate-back-to-same-BSS') added Reattach(), but forgot to document it. Signed-off-by: Jouni Malinen <j@w1.fi>
* doc: Add D-Bus SignalPoll() methodJouni Malinen2014-12-291-0/+21
| | | | | | | | Commit 7a4a93b9593575ffd64ba72739429d98e4b90858 ('dbus: Add SignalPoll() method to report current signal properties') added this method, but forgot to document it. Signed-off-by: Jouni Malinen <j@w1.fi>