aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/hs20_supplicant.c
Commit message (Collapse)AuthorAgeFilesLines
* Use os_memdup()Johannes Berg2017-03-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* HS 2.0: Add an event message to note failed OSU provider writeJouni Malinen2016-07-171-0/+2
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* HS 2.0: Add optional no-scan parameter to FETCH_OSUJouni Malinen2016-07-121-2/+11
| | | | | | | | This is mainly for testing purposes to allow multiple FETCH_OSU ANQP operations to be ran without having to wait for full scan between each query. Signed-off-by: Jouni Malinen <j@w1.fi>
* Interworking: Define control interface message prefixes in wpa_ctrl.hJouni Malinen2016-07-111-9/+9
| | | | | | | These control interface event message are used by external programs, so define them a bit more formally in the header file. Signed-off-by: Jouni Malinen <j@w1.fi>
* HS 2.0: Make hs20_build_anqp_req() staticJouni Malinen2016-07-111-2/+2
| | | | | | This function is not used outside hs20_supplicant.c. Signed-off-by: Jouni Malinen <j@w1.fi>
* HS 2.0: Fix hs20_get_icon() error pathJouni Malinen2016-07-041-1/+1
| | | | | | | | | If base64_encode() fails (e.g., due to memory allocation failure), the return value needs to be checked against NULL before using the (not really) returned length value. The error path here ended up reading uninitialized variable. Signed-off-by: Jouni Malinen <j@w1.fi>
* HS 2.0: Add support for configuring frame filtersMatti Gottlieb2016-04-081-0/+40
| | | | | | | | | | | | | | | When a station starts an association to a Hotspot 2.0 network, request the driver to do the following, based on the BSS capabilities: 1. Enable gratuitous ARP filtering 2. Enable unsolicited Neighbor Advertisement filtering 3. Enable unicast IP packet encrypted with GTK filtering if DGAF disabled bit is zero Clear the filter configuration when the station interface is disassociated. Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
* HS 2.0R2: Clear fetch_anqp_in_progress if fopen failsDaichi Ueura2016-03-031-0/+1
| | | | | | | | | | Clear wpa_s->fetch_anqp_in_progress when osu-providers.txt can't be opened. An issue happens, for instance, when wpa_supplicant doesn't have correct access permission to the directory specified by osu_dir. If hs20_osu_fetch_done method returns without clearing the flag, 'FETCH_OSU' command will never work correctly. Signed-off-by: Daichi Ueura <daichi.ueura@sonymobile.com>
* HS 2.0: Remove duplicate icon entriesJouni Malinen2015-12-191-0/+20
| | | | | | | | | | Only one of the icon entries with a matching BSSID and file name can be fetched from wpa_supplicant and as such, there is no need to maintain the old data if it was not explicitly deleted before running a new fetch for the same BSSID and icon. Remove older duplicated entries whenever completing a pending icon fetch to optimize memory use. Signed-off-by: Jouni Malinen <j@w1.fi>
* HS 2.0: Convert icon storage to use dl_listJouni Malinen2015-12-191-30/+18
| | | | | | This simplifies the list operations quite a bit. Signed-off-by: Jouni Malinen <j@w1.fi>
* HS 2.0: Add a command to retrieve icon with in-memory storageJan Nordqvist2015-12-191-6/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new command based Hotspot 2.0 icon retrieval option. In short, here is the new command sequence: 1. REQ_HS20_ICON <bssid> <file-name> 2. event: RX-HS20-ICON <bssid> <file-name> <size> 3. GET_HS20_ICON <bssid> <file-name> <offset> <size> (if needed, repeat with larger offset values until full icon is fetched) 5. DEL_HS20_ICON <bssid> <file-name> REQ_HS20_ICON is a new command that is analogous to HS20_ICON_REQUEST with the slight difference that an entry to store the icon in memory is prepared. The RX-HS20-ICON event has been augmented with BSSID, file-name and size, and GET_HS20_ICON is used to retrieve a chunk of up to <size> bytes of icon data at offset <offset>. Each chunk is returned as a base64 encoded fragment, preceded by "HS20-ICON-DATA", BSSID, and file-name as well as the starting offset of the data. If there is no entry prepared for the icon when the ANQP result comes back, hs20_process_icon_binary_file falls back to legacy behavior. Finally the DEL_HS20_ICON command deletes (all) icons associated with BSSID and file-name (there could be several if retries are used and they have different dialog tokens). Signed-off-by: Jan Nordqvist <jannq@google.com>
* HS 2.0: Avoid undefined behavior in pointer arithmeticJouni Malinen2015-10-251-32/+32
| | | | | | | | | Reorder terms in a way that no invalid pointers are generated with pos+len operations. end-pos is always defined (with a valid pos pointer) while pos+len could end up pointing beyond the end pointer which would be undefined behavior. Signed-off-by: Jouni Malinen <j@w1.fi>
* Fix sending ANQP request to an unknown BSS while associatedMatti Gottlieb2015-05-031-6/+8
| | | | | | | | | | | | | | While being associated, if an ANQP request is received for a different AP that doesn't exist in the BSS list, the ANQP request will be sent on the frequency of the AP that we are currently associated to. In such a case, it is possible that the ANQP request would be sent on a channel different than that of the requested AP, potentially delaying other requests/activities. Avoid sending the ANQP request to an AP that is not in the BSS list. Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
* Use SSID_MAX_LEN define instead of value 32 when comparing SSID lengthJouni Malinen2015-04-221-2/+2
| | | | | | This makes the implementation easier to understand. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* HS 2.0: Add support to update the HS20 Capability List into the BSSASHUTOSH NARAYAN2015-02-211-0/+5
| | | | | | | In addition, add support for returning the capability list through the BSS control interface command. Signed-off-by: ASHUTOSH NARAYAN <ashutoshx.narayan@intel.com>
* HS20: Provide appropriate permission to the OSU related filesASHUTOSH NARAYAN2015-01-201-0/+31
| | | | | | | | The icon files and the osu-providers.txt that are generated may not have proper permission for external programs to access. Set the access permissions to the same as the permissions for osu_dir. Signed-off-by: ASHUTOSH NARAYAN <ashutoshx.narayan@intel.com>
* HS 2.0: Try to use same BSS entry for storing GAS resultsJouni Malinen2015-01-171-2/+2
| | | | | | | | | | | | | | Commit 17b8995cf5813d7c027cd7a6884700e791d72392 ('Interworking: Try to use same BSS entry for storing GAS results') added a mechanism to try to pair GAS request and response to a single BSS entry to cover cases where multiple BSS entries may exists for the same BSSID. However, that commit did not cover the Hotspot 2.0 ANQP elements. Extend this mechanism to all ANQP elements. This can help in cases where information in the Hotspot 2.0 specific ANQP elements got lost if a hidden SSID or some other reason of duplicated BSS entries was present while doing ANQP fetches. Signed-off-by: Jouni Malinen <j@w1.fi>
* HS 2.0: Allow CANCEL_FETCH_OSU to stop at scan completionJouni Malinen2014-12-141-0/+6
| | | | | | | There is no need to start the GAS/ANQP fetch if the FETCH_OSU operation has already been canceled. Signed-off-by: Jouni Malinen <j@w1.fi>
* HS 2.0: Clarify OSU Provider list length validationJouni Malinen2014-12-041-18/+41
| | | | | | | | The previous version was somewhat too complex for some static analyzers. Use local variables for the extracted length fields and explicitly compare these against the remaining buffer length. (CID 68121) Signed-off-by: Jouni Malinen <j@w1.fi>
* HS 2.0: Clarify OSU Server URI length validationJouni Malinen2014-11-231-3/+10
| | | | | | | | The previous version was valid, but apparently too complex for some static analyzers. Use a local variable for uri_len and explicitly compare it against the remaining buffer length. (CID 68121) Signed-off-by: Jouni Malinen <j@w1.fi>
* HS 2.0: More explicit hs20_osu_icon_fetch() length validationJouni Malinen2014-11-231-1/+1
| | | | | | | The previous version was fine, but too much for some static analyzers to understand as proper bounds checking. (CID 68122) Signed-off-by: Jouni Malinen <j@w1.fi>
* HS 2.0R2: Add update_identifier field to networkDmitry Shmidt2014-07-021-1/+7
| | | | | | | | | This can be used to configure a Hotspot 2.0 Release 2 network externally for a case where wpa_supplicant-based Interworking network selection is not used and the update_identifier cannot be copied directly from a cred. Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* Remove leftover timeouts on cleanupAlexandru Costache2014-05-121-0/+7
| | | | Signed-off-by: Alexandru Costache <alexandru.costache.100@gmail.com>
* HS 2.0: Extend ANQP_GET to accept Hotspot 2.0 subtypesDmitry Shmidt2014-03-251-5/+16
| | | | | | | | | | | | | This allows a single ANQP query to be used to fetch both IEEE 802.11 defined ANQP elements and Hotspot 2.0 vendor specific elements. ANQP_GET <addr> <info id>[,<info id>]... [,hs20:<subtype>][...,hs20:<subtype>] For example: ANQP_GET 00:11:22:33:44:55:66 258,268,hs20:3,hs20:4 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* HS 2.0R2: Fix temporary network disabling in Deauth Req caseJouni Malinen2014-02-271-4/+4
| | | | | | | | | | | | | Commits 7ef6947993d4b09dea6797b96f34dbcfed57d90e and 533536d82ac63512c31ff0bae403d437392d34e0 added this temporarily disabling case, but those commits were merged in without having been converted to the new os_reltime design used for ssid->disabled_until. Consequently, they ended up disabling the network for 44 years or so too long time (depending on what values the relative timestamp had accummulated so far). Fix this by using relative timestamps consistently. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* HS 2.0R2: Try to scan multiple times for OSU providersJouni Malinen2014-02-251-2/+12
| | | | | | | Scan operation is not that reliable, so try couple of times if no OSU provider matches are found during fetch_osu command. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* HS 2.0R2: Disable full ESS for as a workaround for per-BSS issuesJouni Malinen2014-02-251-0/+13
| | | | | | | For now, disable full ESS since some drivers may not support disabling per BSS. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* HS 2.0R2: Add GAS operation duration statistics into debugJouni Malinen2014-02-251-0/+10
| | | | Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* HS 2.0R2: Add routine for fetching OSU provider informationJouni Malinen2014-02-251-29/+572
| | | | | | | | | The new wpa_cli fetch_osu command can be used to fetch information about all OSU providers and write that to a text file with the icons in separate files. cancel_osu_fetch command can be used to stop ongoing OSU provider list fetch. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* HS 2.0R2: Add OSU Providers list ANQP elementJouni Malinen2014-02-251-1/+10
| | | | | | | wpa_supplicant can now request OSU Providers list with "hs20_anqp_get <BSSID> 8". Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* HS 2.0R2: Add Icon Request and Icon binary File ANQP elementsJouni Malinen2014-02-251-0/+46
| | | | | | | | wpa_supplicant can request OSU icon data with "hs20_icon_request <BSSID> <icon filename>". This transmits an Icon Request ANQP element and processes the response in Icon Binary File ANQP elements. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* HS 2.0R2: Add STA support for Deauthentication Request notificationJouni Malinen2014-02-251-0/+32
| | | | | | | If requested, disable the network based on the HS 2.0 deauthentication request. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* HS 2.0R2: Add WNM-Notification Request for Subscription RemediationJouni Malinen2014-02-251-0/+11
| | | | | | | | Subscription remediation notification WNM-Notification Request is now shown in the following way in wpa_supplicant control interface: <3>HS20-SUBSCRIPTION-REMEDIATION http://example.com/foo/ Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* HS 2.0R2: Update Indication element to Release 2Jouni Malinen2014-02-251-3/+26
| | | | | | | | | | | | The HS 2.0 Indication element from wpa_supplicant now includes the release number field and wpa_supplicant shows the release number of the AP in STATUS command (hs20=1 replaced with hs20=<release>). The new update_identifier field in the cred block can now be used to configure the PPS MO ID so that wpa_supplicant adds it to the Indication element in Association Request frames. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* GAS: Delay GAS query Tx while another query is in progressKyeyoon Park2013-10-211-1/+1
| | | | | | | | | It would be possible to issue another GAS query when a previous one is still in progress and this could result in conflicting offchannel operations. Prevent that by delaying GAS query initiation until the previous operation has been completed. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* HS 2.0: Include HS 2.0 Indication element only for HS 2.0 associationJouni Malinen2013-05-051-0/+29
| | | | | | | | | | | | | The Hotspot 2.0 specification seems to mandate this element to be included in all (Re)Association Request frames if the station is Hotspot 2.0 capable. However, that results in conflicts with other requirements like no TKIP use when this element is present. The design is really supposed to include the indication element only for Hotspot 2.0 associations regardless of what the current specification implies. Remove the HS 2.0 Indication element from (Re)Association Request frame whenever the connection is not for Hotspot 2.0 purposes. Signed-hostap: Jouni Malinen <j@w1.fi>
* Interworking: Unshare ANQP results on explicit ANQP requestsJouni Malinen2012-10-031-1/+3
| | | | | | | | | When ANQP_GET or HS20_ANQP_GET is used to request ANQP information, unshare the ANQP information (i.e., create a per-BSS copy of it) to make sure the information from the specified BSS is available in case the APs provide different information within HESSID. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* HS 2.0: Include parsed WAN Metrics in RX-HS20-ANQP eventJouni Malinen2012-10-031-2/+9
| | | | | | | | | | | | | | | | | | | | | This adds parsed version of WAN Metrics information to the control event message as follows: RX-HS20-ANQP 02:00:00:00:01:00 WAN Metrics 01:8000:1000:80:240:3000 format: <WAN Info>:<DL Speed>:<UL Speed>:<DL Load>:<UL Load>:<LMD> WAN Info: B0-B1: Link Status, B2: Symmetric Link, B3: At Capabity (encoded as two hex digits) Downlink Speed: Estimate of WAN backhaul link current downlink speed in kbps; 1..4294967295; 0 = unknown Uplink Speed: Estimate of WAN backhaul link current uplink speed in kbps 1..4294967295; 0 = unknown Downlink Load: Current load of downlink WAN connection (scaled to 255 = 100%) Uplink Load: Current load of uplink WAN connection (scaled to 255 = 100%) Load Measurement Duration: Duration for measuring downlink/uplink load in tenths of a second (1..65535); 0 if load cannot be determined Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Interworking: Move BSS ANQP information into separate structJouni Malinen2012-09-041-12/+16
| | | | | | | | This is an initial step in allowing the ANQP responses to be shared among multiple BSSes if the BSSes are determined to be operating under identical configuration. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* HS 2.0: Add Hotspot 2.0 indication into Probe RequestJay Katabathuni2012-05-081-0/+10
| | | | Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* HS 2.0: Add Hotspot 2.0 ANQP routinesJay Katabathuni2012-05-081-0/+162
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>