Commit message (Collapse)AuthorAgeFilesLines
* doc: Disable Doxygen autolink supportJouni Malinen2015-01-0313-408/+411
| | | | | | | | | | | | | | | The way autolink support is implementing in Doxygen is a bit inconvenient with wpa_supplicant being recognized as something that would always be linked to struct wpa_supplicant. In addition, number of links were not really noticed automatically. To get this working more robustly and without having to use the %wpa_supplicant workaround (which had its own issues, e.g., with titles), disable autolinking and use explicit \ref commands instead. This is also updating some of the obsolete notes to point to correct file names, etc. changes in the source code tree. Signed-off-by: Jouni Malinen <j@w1.fi>
* nl80211: Clear nlmsg payload with keys before freeingJouni Malinen2015-01-021-3/+24
| | | | | | | | This reduces the time possible keys could remain in heap memory. Couple of the nl80211 messages include keys (TK for normal ciphers and KCK/KEK/PMK for various offloading cases). Signed-off-by: Jouni Malinen <j@w1.fi>
* nl80211: Note linux_set_iface_flags() failure in debug logJouni Malinen2015-01-021-1/+5
| | | | | | | | | There was one final remaining linux_set_iface_flags() call that did not check the result. This specific one does not really matter much, but anyway, be more consistent by checking the result and log any error in debug log. (CID 74146) Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: Make wpas_mesh_max_peering more robustJouni Malinen2015-01-021-3/+11
| | | | | | | | | | | | The previous version was enabling all three stations at the same time and left dev[1] and dev[2] competing on getting connected with dev[0] that allowed only one pairing. This was not exactly robust and the pass criteria depended on an extra event from either dev[1] or dev[2]. Fix that by first connecting dev[0] and dev[1] and only after that, start dev[2]. This allows proper validation of both the peering limit on dev[0] and no extra event on dev[2]. Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: Make scan_hidden more robust under heavy CPU loadJouni Malinen2015-01-021-2/+10
| | | | | | | | | It is possible for the Probe Response frame wait to time out when active scanning is used under heavy CPU load. Make this test case more robust by trying multiple times before declaring the scan for a hidden SSID to have failed. Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: wpa_supplicant D-Bus interfaceJouni Malinen2015-01-023-4/+4340
| | | | | | | This adds new files with test cases to verify both the old and new wpa_supplicant D-Bus interface. Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: Enable wpa_supplicant D-Bus support for hwsim testsJouni Malinen2015-01-024-7/+61
| | | | | | | | | | This allows automated testing of the wpa_supplicant D-Bus interface. The instance controlling wlan0 registers with D-Bus if dbus-daemon was started successfully. This is only used in VM testing, i.e., not when run-tests.sh is used on the host system with D-Bus running for normal system purposes. Signed-off-by: Jouni Malinen <j@w1.fi>
* doc: Document the D-Bus P2P extensionsJouni Malinen2015-01-021-4/+735
| | | | | | | | | | P2P support was added to the wpa_supplicant D-Bus interface long time ago, but there has been no attempt of documenting that interface so far. This commit adds at least a list of new interfaces, methods, properties, and signals. Some of the incorrect and/or strange parts of the interface are also identified with bug/todo comments. Signed-off-by: Jouni Malinen <j@w1.fi>
* doc: Document D-Bus WPS property ConfigMethodsJouni Malinen2015-01-021-0/+4
| | | | | | This was added a long time ago, but documentation update was forgotten. Signed-off-by: Jouni Malinen <j@w1.fi>
* doc: Document missing D-Bus Interface propertiesJouni Malinen2015-01-021-0/+10
| | | | | | | CurrentAuthMode and DisconnectReason have been added a long time ago, but documentation update was forgotten. Signed-off-by: Jouni Malinen <j@w1.fi>
* doc: Document D-Bus BSS properties WPS and AgeJouni Malinen2015-01-021-0/+11
| | | | | | | These have been added a long time ago, but documentation update was forgotten. Signed-off-by: Jouni Malinen <j@w1.fi>
* 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>