path: root/wpa_supplicant
Commit message (Collapse)AuthorAgeFilesLines
* Do not exceed scan ssid max size advertised by driverRoshan Pius2016-07-031-0/+6
| | | | | | | | | | | Previously, wpa_set_scan_ssids() fully exhausted wpa_driver_scan_params.ssid list when hidden network IDs are provided via the control interface. This results in us exceeding the max size for the list advertised by the driver when we add the "wildcard" scan SSID entry. So, ensure that we leave space for one more scan SSID entry in the list when we exit out of wpa_set_scan_ssids(). Signed-off-by: Roshan Pius <rpius@google.com>
* MBO: Improve supported operating class generationJouni Malinen2016-06-301-13/+56
| | | | | | | | | | | | | | | | Previously, 2.4 GHz operating class 81 was not added for US due to not all of the channels (1-13 in this operating class) being supported. Still, this operating class is the main operating class in the global table for 2.4 GHz and it is the only option for indicating support for the 2.4 GHz band channels in US. Change the supported operating class building rules to include all operating classes for which at least one channel is enabled. In addition, fix the 80, 80+80, and 160 MHz channel checks (checking the center frequency channel was failing since it is not a valid 20 MHz channel). Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Add debug prints on my/peer lid mismatchesJouni Malinen2016-06-281-3/+16
| | | | | | | This makes it easier to figure out why a received mesh peering frame could end up getting dropped. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Add MPM FSM transitions from ESTAB to HOLDING for {OPN,CNF}_RJCTJouni Malinen2016-06-281-0/+2
| | | | | | These events were missing from the MPM FSM state transition table. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Update MPM FSM events to match the standardJouni Malinen2016-06-281-20/+27
| | | | | | | | | {OPN,CNF,CLS}_IGNR events were removed during P802.11s draft development process. Replace these with not generating a MPM FSM event. In addition, add the standard REQ_RJCT event and option to pass in a specific reason code to mesh_mpm_fsm(). Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Rename MPM FSM states to match the standardJouni Malinen2016-06-281-16/+16
| | | | | | | | | | | During the P802.11s draft development, there were separate LISTEN and IDLE states. However, the current IEEE 802.11 standards uses only the IDLE state while the implementation called this LISTEN. Rename the state in the implementation to match the one used in the standard to avoid confusion. In addition, rename OPEN_{SENT,RCVD} to OPN_{SNT,RCVD} to match the exact spelling of these states in the standard. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Indicate OPN_RJCT event if AES-SIV decrypt failsJouni Malinen2016-06-282-8/+18
| | | | | | | | | REVmc/D6.0 (Processing Mesh Peering Open frames for AMPE) mandates the OPN_RJCT event to be invoked if AES-SIV decryption for received Mesh Peering Open frame fails. This allows a Mesh Peering Close frame to be sent in such a case. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Write close reason from Mesh Peering Close to debug logJouni Malinen2016-06-281-0/+4
| | | | | | | This makes it a bit easier to understand the debug log entries related to tearing down a mesh connection. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Remove GTKdata and IGTKdata from Mesh Peering Confirm/CloseJouni Malinen2016-06-281-2/+29
| | | | | | | | | | | | | | | These optional fields are supposed to be included in the Authenticated Mesh Peering Exchange element only in Mesh Peering Open frames. Previously, these were incorrectly included in Mesh Peering Confirm/Close frames and also required to be present in all these frames. While this commit changes the receive processing to ignore the unexpected extra fields, it should be noted that the previous implementation required the fields to be present and as such, the fixed implementation is not compatible with it for secure mesh. Signed-off-by: Jouni Malinen <j@w1.fi>
* Add CTRL-EVENT-CHANNEL-SWITCH event to indicate channel changesJouni Malinen2016-06-271-0/+9
| | | | | | | This provides information of the channel switch to wpa_supplicant control interface monitors. Signed-off-by: Jouni Malinen <j@w1.fi>
* GAS: Fix double-free on an error pathJouni Malinen2016-06-271-0/+1
| | | | | | | | | | If radio_add_work() fails, gas_query_req() ended up freeing the query payload and returning an error. This resulted in also the caller trying to free the query payload. Fix this by not freeing the buffer within gas_query_req() in error case to be consistent with the other error cases. Signed-off-by: Jouni Malinen <j@w1.fi>
* GAS: Remove unused gas_query_cancel()Jouni Malinen2016-06-272-21/+0
| | | | | | | | This function was added with the initial GAS implementation, but there was no user for it at the time and no clear use now either, so remove the unused function and the related GAS query reason code. Signed-off-by: Jouni Malinen <j@w1.fi>
* GAS: Check protected/unprotected drop after action code checkJouni Malinen2016-06-271-8/+8
| | | | | | | | | | Apply the GAS specific rule of using Protected Dual of Public Action frame only after having checked that the action code indicates this to be a GAS response. Previously, non-GAS Public Action frames could have been incorrectly dropped because of this check if received during an association with PMF enabled. Signed-off-by: Jouni Malinen <j@w1.fi>
* GAS: Report GAS-QUERY-DONE event on initial req TX failureJouni Malinen2016-06-271-1/+1
| | | | | | | | | The GAS-QUERY-DONE event with result=INTERNAL_ERROR was reported on most other error cases, but the failure triggered by not being able to transmit a GAS Initial Request stopped the query silently. Make this more consistent with other error cases by reporting the same event. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Make the CurrentAuthMode property getter more robustJouni Malinen2016-06-241-1/+3
| | | | | | | | Now that mesh sets wpa_s->wpa_state = WPA_COMPLETED, it looks like this getter can get called with wpa_s->current_ssid = NULL. That could result in NULL pointer dereference, so need to protect that specific case. Signed-off-by: Jouni Malinen <j@w1.fi>
* D-Bus: Add DeviceFoundProperties signal for discovered peersNishant Chaprana2016-06-241-5/+20
| | | | | | | | | | | | | | | | | | | | | This signal sends the peer properties to applications for discovered peers. The signature of this event is "oa{sv}". This event is needed because the current DeviceFound signal provides only the peer object path. If there are many peers in range there will be many DeviceFound signals and for each DeviceFound signal, applications would need to use GetAll to fetch peer properties. Doing this many times would create extra load over application as well as over wpa_supplicant, so it is better to send peer properties in the event so that applications can extract found peer information without extra steps. The existing DeviceFound signal is left as-is to avoid changing its signature. The issue is not applicable to the control interface because the P2P-DEVICE-FOUND event includes peer info in it, but over D-Bus interface DeviceFound provides only the peer object. Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
* mesh: Mark wpa_state COMPLETED when mesh join has been performedMaital Hahn2016-06-242-1/+3
| | | | | | | | | | In mesh interface, the wpa_supplicant state was either DISCONNECT/SCANNING in non-secured connection or AUTHENTICATING in secured connection. The latter prevented the scan. Update the wpa_supplicant state in mesh to be COMPLETED upon initialization. This is similar to the P2P GO case. Signed-off-by: Maital Hahn <maitalm@ti.com>
* wpa_supplicant: Configurable EAP fragment size in AP modeLior David2016-06-241-0/+2
| | | | | | | | | | | | | In wpa_supplicant AP mode, allow configuration of the EAP fragment size using the fragment_size member of network block (wpa_ssid), similar to the fragment_size in hostapd configuration. bss->fragment_size default value of 0 is treated specially in some EAP code paths (such as MTU initialization in eap_pwd_init). In order to preserve the existing behavior, bss->fragment_size will only be set if the network block specified a value different from the default which is DEFAULT_FRAGMENT_SIZE(1398) bytes. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
* PAE: Use sci->port more consistentlyJouni Malinen2016-06-241-2/+4
| | | | | | | | | This is now annotated as be16, so use it as such in all cases instead of first storing host byte order value and then swapping that to big endian in other instances of the same structure. This gets rid of number of sparse warnings. Signed-off-by: Jouni Malinen <j@w1.fi>
* Move extern declarations for autoscan modules into a header fileJouni Malinen2016-06-242-7/+10
| | | | | | | This gets rid of number of sparse warnings and also allows the compatibility of the declarations to be verified. Signed-off-by: Jouni Malinen <j@w1.fi>
* Move extern declarations for bgscan modules into a header fileJouni Malinen2016-06-242-6/+9
| | | | | | | This gets rid of number of sparse warnings and also allows the compatibility of the declarations to be verified. Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: Declare module test functions in a header fileJouni Malinen2016-06-232-23/+12
| | | | | | This gets rid of number of warnings from sparse. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Mark wpas_data_test_rx() staticJouni Malinen2016-06-231-1/+2
| | | | | | This is not called from outside ctrl_iface.c. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Fix byte order for CONFIG_VHT_OVERRIDES parametersJouni Malinen2016-06-231-6/+8
| | | | | | The VHT parameters were not swapped properly on big endian systems. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* FST: Mark wpa_supplicant callback functions get_peer_{first,next} staticJouni Malinen2016-06-231-4/+6
| | | | | | | These are used only through function pointers, so no need to keep the functions non-static. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* TDLS: Declare tdls_testing as extern in a header fileJouni Malinen2016-06-231-2/+0
| | | | | | This gets rid of a sparse warning with CONFIG_TDLS_TESTING builds. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* trace: Define externs in a header fileJouni Malinen2016-06-231-10/+0
| | | | | | This gets rid of some unnecessary strace warnings from test builds. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* MBO: Mark verify_channel() staticJouni Malinen2016-06-231-2/+2
| | | | | | This function is not used outside mbo.c. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* WNM: Use NULL instead of 0 as the pointer return valueJouni Malinen2016-06-231-1/+1
| | | | Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* ctrl_iface: BSS command to skip info items if parsing failsJonathan Afek2016-06-191-4/+6
| | | | | | | | | | In some cases parsing of the mesh scan info for a BSS or the P2P scan info can fail. One reason can be that the Beacon/Probe Response frame contained malformed length vendor IEs which are not parsed when adding to the BSS table. Instead of skipping the whole BSS of the BSS command, just skip the part that failed to parse. Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
* mesh: Use MESH_CAP_* macros for mesh capabilityMasashi Honma2016-06-191-1/+2
| | | | Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* mesh: Ignore crowded peerMasashi Honma2016-06-191-0/+8
| | | | | | | | The "Accepting Additional Mesh Peerings bit == 0" means the peer cannot accept any more peers, so suppress attempt to open a connection to such a peer. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* mesh: Select pairwise and group cipher based on network profileJouni Malinen2016-06-191-2/+19
| | | | | | | This allows the previously hardcoded CCMP cipher to be replaced in the network profile for mesh. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Avoid use of hardcoded cipherJouni Malinen2016-06-194-34/+47
| | | | | | | | | This moves pairwise, group, and management group ciphers to various mesh data structures to avoid having to hardcode cipher in number of places through the code. While CCMP and BIP are still the hardcoded ciphers, these are now set only in one location. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Clean up AMPE element encoding and parsingJouni Malinen2016-06-194-38/+135
| | | | | | | | | | | | | The AMPE element includes number of optional and variable length fields and those cannot really be represented by a fixed struct ieee80211_ampe_ie. Remove the optional fields from the struct and build/parse these fields separately. This is also adding support for IGTKdata that was completely missing from the previous implementation. In addition, Key RSC for MGTK is now filled in and used when configuring the RX MGTK for a peer. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Do not use RX MGTK as RX IGTKJouni Malinen2016-06-191-3/+9
| | | | | | | | | The previous implementation was incorrect in forcing the MGTK to be used as the IGTK as well. Define new variable for storing IGTK and use that, if set, to configure IGTK to the driver. This commit does not yet fix AMPE element parsing to fill in this information. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Use variable length MGTK for RXJouni Malinen2016-06-192-4/+7
| | | | | | | | This extends the data structures to allow variable length MGTK to be stored for RX. This is needed as an initial step towards supporting different cipher suites. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Generate a separate TX IGTK if PMF is enabledJouni Malinen2016-06-192-3/+17
| | | | | | | | | | | Previous implementation was incorrectly using MGTK also as the IGTK and doing this regardless of whether PMF was enabled. IGTK needs to be a independent key and this commit does that at the local TX side. The current AMPE element construction and parsing is quite broken, so this does not get add the IGTKdata field there. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Support variable length TX MGTKJouni Malinen2016-06-192-3/+8
| | | | | | This is an initial step in supporting multiple cipher suites. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Add variable length MTK supportJouni Malinen2016-06-192-3/+5
| | | | | | | This is needed as a part in enabling support for different pairwise ciphers in mesh. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Coding style cleanup for MTK derivationJouni Malinen2016-06-191-16/+22
| | | | | | | Clean up the mesh_rsn_derive_mtk() function by using proper macros and pointer to the location within the context block. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Fix MTK derivation to use AKM suite selectorJouni Malinen2016-06-181-2/+2
| | | | | | | | | mesh_rsn_derive_mtk() was hardcoded to use GCMP (even though CCMP was hardcoded elsewhere) cipher suite selector instead of the selected AKM suite selector. This resulted in incorrect MTK getting derived. Fix this by used the SAE AKM suite selector in the input to the KDF. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Coding style cleanup for AEK derivationJouni Malinen2016-06-181-5/+14
| | | | | | | Clean up the mesh_rsn_derive_aek() function by using proper macros and pointer to the location within the context block. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Fix AEK derivation to use AKM suite selectorJouni Malinen2016-06-181-2/+2
| | | | | | | | | mesh_rsn_derive_aek() was hardcoded to use GCMP (even though CCMP was hardcoded elsewhere) cipher suite selector instead of the selected AKM suite selector. This resulted in incorrect AEK getting derived. Fix this by used the SAE AKM suite selector in the input to the KDF. Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Use ieee80211w profile parameterJouni Malinen2016-06-182-4/+19
| | | | | | | | | This is initial step in fixing issues in how PMF configuration for RSN mesh was handled. PMF is an optional capability for mesh and it needs to be configured consistently in both hostapd structures (to get proper RSNE) and key configuration (not included in this commit). Signed-off-by: Jouni Malinen <j@w1.fi>
* mesh: Use WPA_NONCE_LEN macroJouni Malinen2016-06-181-12/+11
| | | | | | | No need to use the magic value 32 here since there is a generic define for the RSN-related nonce values. Signed-off-by: Jouni Malinen <j@w1.fi>
* WPS: Fix memory leak with wps_ie in wpa_bss_is_wps_candidate()vamsi krishna2016-06-171-0/+1
| | | | | | | | | Fix possible memory leak in case if WPS is not enabled on the interface for connection. This path was missed in commit fae7b3726035b57a78aa552378fc5d15402b9ec1 ('WPS: Do not expire probable BSSes for WPS connection'). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* WPS: Do not expire probable BSSes for WPS connectionvamsi krishna2016-06-161-1/+43
| | | | | | | | | When the BSS count reaches max_bss_count, the oldest BSS will be removed in order to accommodate a new BSS. Exclude WPS enabled BSSes when going through a WPS connection so that a possible WPS candidate will not be lost. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Update PKCS#11 references in template wpa_supplicant.confDavid Woodhouse2016-06-111-17/+15
| | | | | | | | Ditch the legacy syntax and manual engine mangling and just give an example using simple PKCS#11 URIs that'll work with both GnuTLS and OpenSSL. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* wpa_supplicant: Make GAS Address3 field selection behavior configurableJouni Malinen2016-06-105-1/+32
| | | | | | | | | | | | | | | | | | | | IEEE Std 802.11-2012, 10.19 (Public Action frame addressing) specifies that the wildcard BSSID value is used in Public Action frames that are transmitted to a STA that is not a member of the same BSS. wpa_supplicant used to use the actual BSSID value for all such frames regardless of whether the destination STA is a member of the BSS. P2P does not follow this rule, so P2P Public Action frame construction must not be changed. However, the cases using GAS/ANQP for non-P2P purposes should follow the standard requirements. Unfortunately, there are deployed AP implementations that do not reply to a GAS request sent using the wildcard BSSID value. The previously used behavior (Address3 = AP BSSID even when not associated) continues to be the default, but the IEEE 802.11 standard compliant addressing behavior can now be configured with gas_address3=1. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>