aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* OWE: Process Diffie-Hellman Parameter element in STA modeJouni Malinen2017-03-123-2/+150
| | | | | | | | This adds STA side addition of OWE Diffie-Hellman Parameter element into (Re)Association Request frame and processing it in (Re)Association Response frame. Signed-off-by: Jouni Malinen <j@w1.fi>
* OWE: Process Diffie-Hellman Parameter element in AP modeJouni Malinen2017-03-128-9/+178
| | | | | | | | This adds AP side processing for OWE Diffie-Hellman Parameter element in (Re)Association Request frame and adding it in (Re)Association Response frame. Signed-off-by: Jouni Malinen <j@w1.fi>
* OWE: Add driver capability flag for OWE AKMJouni Malinen2017-03-122-1/+3
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* OWE: Define and parse OWE AKM selectorJouni Malinen2017-03-128-7/+39
| | | | | | This adds a new RSN AKM "OWE". Signed-off-by: Jouni Malinen <j@w1.fi>
* OWE: Define and parse Diffie-Hellman Parameter elementJouni Malinen2017-03-113-0/+9
| | | | | | | Add WLAN_EID_EXT_OWE_DH_PARAM definition and extend ieee802_11_parse_elems() to recognize this element. Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: Extract-and-Expand HKDF (RFC 5869)Jouni Malinen2017-03-111-0/+130
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* Extend hmac_sha256_kdf() to support HKDF-Expand() as defined in RFC 5869Jouni Malinen2017-03-111-6/+14
| | | | | | | | | | The KDF define in RFC 5295 is very similar to HKDF-Expand() defined in RFC 5869. Allow a NULL label to be used to select the RFC 5869 version with arbitrary seed (info in RFC 5869) material without forcing the label and NULL termination to be included. HKDF-Expand() will be needed for OWE. Signed-off-by: Jouni Malinen <j@w1.fi>
* OpenSSL: Add wrapper functions for ECDHJouni Malinen2017-03-112-2/+247
| | | | | | | These allow ECDH to be used with compressed public key encoding (only x-coordinate). This is needed for FILS PFS and OWE. Signed-off-by: Jouni Malinen <j@w1.fi>
* common: Add candidate list parsing helper functionAvraham Stern2017-03-112-0/+105
| | | | | | | | | | Add a helper function that parses candidate list from command line arguments. This function will be used (in the following commits) to add a candidate list to BSS transition management query. Signed-off-by: Avraham Stern <avraham.stern@intel.com>
* MBO: Parse MBO ANQP-element on STAJouni Malinen2017-03-101-0/+1
| | | | | | | | | | | | | This extends the GAS/ANQP parser in wpa_supplicant to process MBO ANQP-elements and indicate received Cellular Data Connection Preference values over the control interface. When a valid MBO ANQP-element is received, the following control interface message is sent: RX-MBO-ANQP <BSSID> cell_conn_pref=<value> Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* MBO: Add MBO ANQP-element processing on APJouni Malinen2017-03-104-41/+142
| | | | | | | | | This extends the GAS server to process MBO ANQP-elements and reply to a query for the Cellular Data Connection Preference (if configured). The new configuration parameter mbo_cell_data_conn_pref can be used to set the value (0, 1, or 255) for the preference to indicate. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* MBO: Add option to add MBO query list to ANQP queryAvraham Stern2017-03-101-2/+4
| | | | | | | | | | | | | | | | | MBO techspec v0.0_r27 changed the MBO ANQP-element format. The MBO element in ANQP query should now include an MBO Query List element that contains a list of MBO elements to query. Add API to add the MBO Query List to an ANQP query. Format: ANQP_GET <addr> <info_id>[,<info_id>]...[,mbo:<subtype>...] Example for querying neighbor report with MBO cellular data connection preference: ANQP_GET <bssid> 272,mbo:2 Signed-off-by: Avraham Stern <avraham.stern@intel.com>
* DFS: Handle pre-CAC expired eventVasanthakumar Thiagarajan2017-03-094-2/+40
| | | | | | | | | | | | | | | | | As FCC DFS requirement does not explicitly mention about the validity of the (pre-)CAC when channel is switched, it is safe to assume that the pre-CAC result will not be valid once the CAC completed channel is switched or radar detection is not active on the (CAC completed) channel within a time period which is allowed (10 seconds - channel switch time) as per FCC DFS requirement. Use the new driver event to allow the driver to notify expiry of the CAC result on a channel. Move the DFS state of the channel to 'usable' when processing pre-CAC expired event. This means any future operation on that channel will require a new CAC to be completed. This event is applicable only when DFS is not offloaded to the kernel driver. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
* nl80211: Handle pre-CAC expired event from the driverVasanthakumar Thiagarajan2017-03-093-0/+14
| | | | | | | Process the new nl80211 event NL80211_RADAR_PRE_CAC_EXPIRED to allow the driver to notify expiry of the CAC result on a channel. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
* Sync with mac80211-next.git include/uapi/linux/nl80211.hJouni Malinen2017-03-091-32/+42
| | | | | | This brings in nl80211 definitions as of 2017-03-06. Signed-off-by: Jouni Malinen <j@w1.fi>
* DFS: Handle CAC completion event from other radioVasanthakumar Thiagarajan2017-03-091-2/+32
| | | | | | | | | | | When DFS channel state is shared across multiple radios on the system it is possible that a CAC completion event is propagated from other radio to us. When in enabled state, do not proceed with setup completion upon processing CAC completion event with devices where DFS is not offloaded, when in state other than enabled make sure the configured DFS channel is in available state before start the AP. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
* nl80211: Add option to delay start of schedule scan plansPurushottam Kushwaha2017-03-092-0/+14
| | | | | | | | | | | | The userspace may want to delay the the first scheduled scan. This enhances sched_scan to add initial delay (in seconds) before starting first scan cycle. The driver may optionally choose to ignore this parameter and start immediately (or at any other time). This uses NL80211_ATTR_SCHED_SCAN_DELAY to add this via user global configurable option: sched_scan_start_delay. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Use os_memdup()Johannes Berg2017-03-0758-314/+169
| | | | | | | | | | | | | | | | | | | | | | This leads to cleaner code overall, and also reduces the size of the hostapd and wpa_supplicant binaries (in hwsim test build on x86_64) by about 2.5 and 3.5KiB respectively. The mechanical conversions all over the code were done with the following spatch: @@ expression SIZE, SRC; expression a; @@ -a = os_malloc(SIZE); +a = os_memdup(SRC, SIZE); <... if (!a) {...} ...> -os_memcpy(a, SRC, SIZE); Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* Introduce os_memdup()Johannes Berg2017-03-074-0/+40
| | | | | | | This can be used to clean the code and reduce size by converting os_malloc() followed by os_memcpy() cases to use a single function call. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* nl80211: Driver command for checking BTM accept/rejectKanchanapally, Vidyullatha2017-03-064-1/+231
| | | | | | | | Add driver interface command using the QCA vendor extensions to check the driverr whether to accept or reject a BSS transition candidate. For the reject case, report an MBO reject reason code. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* tests: Add TEST_FAIL() to radius_msg_add_attr()Jouni Malinen2017-03-051-0/+3
| | | | | | | This makes it easier to test error paths for RADIUS message construction. Signed-off-by: Jouni Malinen <j@w1.fi>
* RADIUS server: Fix error paths in new session creationJouni Malinen2017-03-051-3/+3
| | | | | | | | | | | | radius_server_session_free() does not remove the session from the session list and these radius_server_get_new_session() error paths ended up leaving a pointer to freed memory into the session list. This resulted in the following operations failing due to use of freed memory. Fix this by using radius_server_session_remove() which removes the entry from the list in addition to calling radius_server_session_free(). Signed-off-by: Jouni Malinen <j@w1.fi>
* ACS: Fix memory leak if interface is disabled during scanJouni Malinen2017-03-043-1/+10
| | | | | | | The survey data was not freed if hostapd interface got disabled during an ACS scan. Signed-off-by: Jouni Malinen <j@w1.fi>
* ACS: Simplify code pathsJouni Malinen2017-03-041-31/+13
| | | | | | | This removes some unnecessarily duplicated return paths and simplifies code paths. Signed-off-by: Jouni Malinen <j@w1.fi>
* tests: Add TEST_FAIL() checks in l2_packetJouni Malinen2017-03-041-0/+6
| | | | | | This enables additional test coverage for error paths. Signed-off-by: Jouni Malinen <j@w1.fi>
* Fix DHCP/NDISC snoop deinit followed by failing re-initJouni Malinen2017-03-042-0/+2
| | | | | | | | | It was possible to hit a double-free on the l2_packet socket if initialization of DHCP/NDISC snoop failed on a hostapd interface that had previously had those enabled successfully. Fix this by clearing the l2_packet pointers during deinit. Signed-off-by: Jouni Malinen <j@w1.fi>
* Add QCA vendor command/attr for BRP antenna limit controlAlexei Avshalom Lazar2017-03-021-0/+36
| | | | | | | Add QCA_NL80211_VENDOR_SUBCMD_BRP_SET_ANT_LIMIT for setting the number of antennas that will be active in different modes for each connection. Signed-off-by: Alexei Avshalom Lazar <qca_ailizaro@qca.qualcomm.com>
* WFD: Add WFD R2 SubelementsAmarnath Hullur Subramanyam2017-03-015-1/+22
| | | | | | Define and add support for WFD R2 Subelements. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* QCA nl80211 vendor attribute for specific sub-20 MHz channel widthGaole Zhang2017-03-011-0/+8
| | | | | | | | Define a new attribute QCA_WLAN_VENDOR_ATTR_CONFIG_SUB20_CHAN_WIDTH. This attribute can set a station device to work in 5 or 10 MHz channel width while in disconnect state. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Make the third octet of Country String configurableJouni Malinen2017-03-012-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | The new hostapd.conf parameter country3 can now be used to configure the third octet of the Country String that was previously hardcoded to ' ' (= 0x20). For example: All environments of the current frequency band and country (default) country3=0x20 Outdoor environment only country3=0x4f Indoor environment only country3=0x49 Noncountry entity (country_code=XX) country3=0x58 IEEE 802.11 standard Annex E table indication: 0x01 .. 0x1f Annex E, Table E-4 (Global operating classes) country3=0x04 Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* trace: Look up start to cope with ASLRJohannes Berg2017-02-281-3/+34
| | | | | | | | | | When ASLR is enabled, like it is by default on many distros now, the trace code doesn't work right. Fix this by looking up the start of the executable mapping and subtracing it from all the lookups. Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
* af_alg: Crypto wrappers for Linux kernel crypto (AF_ALG)Jouni Malinen2017-02-281-0/+1006
| | | | | | | | | | | CONFIG_TLS=linux can now be used to select the crypto implementation that uses the user space socket interface (AF_ALG) for the Linux kernel crypto implementation. This commit includes some of the cipher, hash, and HMAC functions. The functions that are not available through AF_ALG (e.g., the actual TLS implementation) use the internal implementation (CONFIG_TLS=internal). Signed-off-by: Jouni Malinen <j@w1.fi>
* crypto: Process des_encrypt() error returns in callersJouni Malinen2017-02-286-41/+61
| | | | | | This updates all the des_encrypt() callers to handle error cases. Signed-off-by: Jouni Malinen <j@w1.fi>
* crypto: Add return value to DES and AES encrypt/decryptJouni Malinen2017-02-289-21/+38
| | | | | | | These operations may fail with some crypto wrappers, so allow the functions to report their results to the caller. Signed-off-by: Jouni Malinen <j@w1.fi>
* hostapd: Get channel number from frequency based on other modes as wellPeng Xu2017-02-261-1/+15
| | | | | | | | When getting the channel number from a frequency, all supported modes should be checked rather than just the current mode. This is needed when hostapd switches to a channel in different band. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* FILS: Fix fils_hlp.c build with older netinet/udp.h definitionsJouni Malinen2017-02-262-2/+8
| | | | | | | | | The __FAVOR_BSD macro was previously used in netinet/udp.h to select between two different names of the variables in struct udphdr. Define that to force the versions with the uh_ prefix. In addition, use the same style consistently within fils_hlp.c. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* Add option to disable broadcast deauth in hostapd on AP start/stopJouni Malinen2017-02-263-3/+10
| | | | | | | | The new broadcast_deauth parameter can be used to disable sending of the Deauthentication frame whenever AP is started or stopped. The default behavior remains identical to the past behavior (broadcast_deauth=1). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd: Fix potential mesh-related change from impacting non-mesh casesJouni Malinen2017-02-261-2/+2
| | | | | | | | | | | Commit 01e2231fdc4fbec61fbc382238e3606a1d2826e4 ('hostapd: Skip some configuration steps for mesh cases') removed some operations based on hapd->iface->mconf being NULL. This was within #ifdef CONFIG_MESH, so it should not impact hostapd, but it can impact AP mode with wpa_supplicant. That does not sound intentional, so make these conditional on hapd->conf->mesh being enabled. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* FILS: Use FILS Cache Identifier to extend PMKSA applicabilityJouni Malinen2017-02-266-14/+102
| | | | | | | | This allows PMKSA cache entries for FILS-enabled BSSs to be shared within an ESS when the BSSs advertise the same FILS Cache Identifier value. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* FILS: Fix BSSID in reassociation caseJouni Malinen2017-02-212-2/+6
| | | | | | | | | | The RSN supplicant implementation needs to be updated to use the new BSSID whenever doing FILS authentication. Previously, this was only done when notifying association and that was too late for the case of reassociation. Fix this by providing the new BSSID when calling fils_process_auth(). This makes PTK derivation use the correct BSSID. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* FILS: Find PMKSA cache entries on AP based on FILS Cache IdentifierJouni Malinen2017-02-214-0/+61
| | | | | | | | This allows PMKSA cache entries to be shared between all the BSSs operated by the same hostapd process when those BSSs use the same FILS Cache Identifier value. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* mka: Fix the order of operations in secure channel deletionBadrish Adiga H R2017-02-201-3/+3
| | | | | | | | The correct order of deleting a secure channel is to purge all the secure associations in the channel before actually deleting the secure channel. Signed-off-by: Badrish Adiga H R <badrish.adigahr@gmail.com>
* RSN: Fix pre-authentication EAPOL-Start startPeriod configurationJouni Malinen2017-02-201-0/+2
| | | | | | | | | The RSN pre-authentication case ended up ignoring the initial startPeriod value and delayed EAPOL-Start message by two seconds. Fix this by forcing the first EAPOL-Start message to be sent when running pre-authentication. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* nl80211: Notify reason for connection timeout failurePurushottam Kushwaha2017-02-202-1/+26
| | | | | | | | | This adds reason for timeout in event CTRL-EVENT-ASSOC-REJECT whenever connection failure happens because of timeout. This extends the "timeout" parameter in the event to include the reason, if available: timeout=scan, timeout=auth, timeout=assoc. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd: Get vendor HE capabilitiesPeng Xu2017-02-192-0/+101
| | | | | | Allow hostapd query device HE capabilities via vendor command. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* QCA vendor command for fetching HE capabilitiesPeng Xu2017-02-191-1/+32
| | | | Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd: Add IEEE 802.11ax HE IEs into Beacon/Probe Response framesPeng Xu2017-02-193-0/+131
| | | | | | | | | IEEE 802.11ax HE changes to include HE IEs in Beacon and Probe Response frames. These elements are using vendor specific forms for now since the IEEE 802.11ax draft is not yet finalized and the element contents is subject to change. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd: Initial IEEE 802.11ax (HE) definitionsPeng Xu2017-02-193-0/+103
| | | | | | | Add IEEE 802.11ax definitions for config, IEEE structures, and constants. These are still subject to change in the IEEE process. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* mesh: Use correct rate in VHT and HT mixed environmentMasashi Honma2017-02-191-1/+1
| | | | | | | | | | | | Let mesh STA A be a STA which has config disable_ht=0 and disable_vht=1. Let mesh STA B be a STA which has config disable_ht=0 and disable_vht=0. The mesh STA A and B was connected. Previously, the mesh STA A sent frame with VHT rate even though its VHT was disabled. This commit fixes the issue by checking the local BSS VHT configuration. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
* mesh: Use correct rate in HT and legacy mixed environmentMasashi Honma2017-02-191-2/+2
| | | | | | | | | | | | Let mesh STA A be a STA which has config disable_ht=1. Let mesh STA B be a STA which has config disable_ht=0. The mesh STA A and B was connected. Previously, the mesh STA A sent frame with HT rate even though its HT was disabled. This commit fixes the issue by checking the local BSS HT configuration. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>