From 7d17530e229db79208e99741071df97ea4faeec6 Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Tue, 6 Sep 2016 13:11:34 -0700 Subject: Cumulative patch from commit fcd85d9a3f2d9d63d0fa57e93446ad467db75b23 fcd85d9 Add QCA vendor commands/attributes for indoor location d1723c5 wpa_supplicant: Allow FTM functionality to be published faecb39 hostapd: Allow FTM functionality to be published fc72a48 hostapd: Use stations nsts capability in (Re)Association Response frame 22950d0 QCA vendor subcommand for LL_STATS extension b44d9c7 D-Bus: Add ConfigFile parameter into the interface properties 7dcec24 mka: Clean up key allocation 95e9460 mka: Get rid of struct ieee802_1x_cp_conf 07a6bfe mka: Store cipher suite ID in a u64 instead of u8 pointer 535a8b8 mka: Make csindex unsigned 343eb3b mka: Reorganize live peer creation and key server election 34dbe90 mka: Share a single delete mka implementation 0dabf79 mka: Introduce compare_priorities() 53080f7 mka: Clean up ieee802_1x_kay_mkpdu_sanity_check() 05283e7 mka: Simplify ieee802_1x_mka_dist_sak_body_present() 87b19c8 mka: Replace participant->kay with a local kay variable f9ea083 mka: Fix typos in grammar in variable names and comments 921171f mka: Use named initializers for mka_body_handler[] 86bef17 mka: Remove unused enum mka_created_mode values ec958ae mka: Remove cs_len argument from the set_current_cipher_suite functions 46bbda2 mka: Clean up ieee802_1x_mka_decode_potential_peer_body() cf375eb mka: Simplify ieee802_1x_mka_encode_icv_body() memory copying 8b4a148 mka: Simplify ieee802_1x_mka_sak_use_body_present() b3df783 mka: Reorganize loops in number of KaY functions de7f533 mka: Remove unused body_peer incrementation 2b13bca mka: Add reset_participant_mi() helper 3ceb458 mka: Clean up printf formats 8fab9e1 mka: Use named initializers for static structs d4f668f mka: Add MKA_ALIGN_LENGTH macro 1de7a9f mka: Add helper functions for dumping and creating peer d9639d1 mka: Clean up ieee802_1x_kay_get_cipher_suite() lookup function 7c547cf mka: Refactor the get_*_peer() functions 515bc1a mka: Fix a typo in mka_body_handler (mak to mka) a33e3c3 mka: Add a helper function, sci_equal(), for sci comparison cefeb8e mka: Use less bitfields in the IEEE 802.1X-2010 structs 2e94489 mka: Fix a typo in macsec_capbility f2f8616 Initialize hapd->nr_db in hostapd_alloc_bss_data() 30e0745 Fix TRACK_STA_LIST before BSS enabled 1f3b8b4 Check for driver initialization before doing driver operations 833d0d4 radius: Sanity check for NULL pointer segfault Change-Id: I500fe4f62e1a0010ea82c277f73becd2ac2dfa43 Signed-off-by: Dmitry Shmidt --- wpa_supplicant/ap.c | 3 +++ wpa_supplicant/config.c | 2 ++ wpa_supplicant/config.h | 26 ++++++++++++++++++++++++++ wpa_supplicant/config_file.c | 5 +++++ wpa_supplicant/dbus/dbus_new.c | 5 +++++ wpa_supplicant/dbus/dbus_new_handlers.c | 24 ++++++++++++++++++++++++ wpa_supplicant/dbus/dbus_new_handlers.h | 1 + wpa_supplicant/driver_i.h | 5 ++--- wpa_supplicant/mesh.c | 1 + wpa_supplicant/mesh_mpm.c | 2 +- wpa_supplicant/wpa_supplicant.c | 11 +++++++++++ wpa_supplicant/wpa_supplicant.conf | 16 ++++++++++++++++ wpa_supplicant/wpas_kay.c | 5 ++--- 13 files changed, 99 insertions(+), 7 deletions(-) (limited to 'wpa_supplicant') diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c index 7710a8df..356784ab 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c @@ -468,6 +468,9 @@ no_wps: wpabuf_dup(wpa_s->conf->ap_vendor_elements); } + bss->ftm_responder = wpa_s->conf->ftm_responder; + bss->ftm_initiator = wpa_s->conf->ftm_initiator; + return 0; } diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index 3f69936d..dd922caf 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -4369,6 +4369,8 @@ static const struct global_parse_data global_fields[] = { MBO_CELL_CAPA_NOT_SUPPORTED), 0 }, #endif /*CONFIG_MBO */ { INT(gas_address3), 0 }, + { INT_RANGE(ftm_responder, 0, 1), 0 }, + { INT_RANGE(ftm_initiator, 0, 1), 0 }, }; #undef FUNC diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h index 15357389..48e64be5 100644 --- a/wpa_supplicant/config.h +++ b/wpa_supplicant/config.h @@ -1302,6 +1302,32 @@ struct wpa_config { * sent to not-associated AP; if associated, AP BSSID) */ int gas_address3; + + /** + * ftm_responder - Publish FTM (fine timing measurement) + * responder functionality + * + * Values: + * 0 - do not publish FTM responder functionality (Default) + * 1 - publish FTM responder functionality in + * bit 70 of Extended Capabilities element + * Note, actual FTM responder operation is managed outside + * wpa_supplicant. + */ + int ftm_responder; + + /** + * ftm_initiator - Publish FTM (fine timing measurement) + * initiator functionality + * + * Values: + * 0 - do not publish FTM initiator functionality (Default) + * 1 - publish FTM initiator functionality in + * bit 71 of Extended Capabilities element + * Note, actual FTM initiator operation is managed outside + * wpa_supplicant. + */ + int ftm_initiator; }; diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index 994d5ea6..7ae16545 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -1339,6 +1339,11 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config) if (config->gas_address3) fprintf(f, "gas_address3=%d\n", config->gas_address3); + + if (config->ftm_responder) + fprintf(f, "ftm_responder=%d\n", config->ftm_responder); + if (config->ftm_initiator) + fprintf(f, "ftm_initiator=%d\n", config->ftm_initiator); } #endif /* CONFIG_NO_CONFIG_WRITE */ diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c index 6d73bbc7..27b3012a 100644 --- a/wpa_supplicant/dbus/dbus_new.c +++ b/wpa_supplicant/dbus/dbus_new.c @@ -3158,6 +3158,11 @@ static const struct wpa_dbus_property_desc wpas_dbus_interface_properties[] = { NULL, NULL }, + { "ConfigFile", WPAS_DBUS_NEW_IFACE_INTERFACE, "s", + wpas_dbus_getter_config_file, + NULL, + NULL + }, { "CurrentBSS", WPAS_DBUS_NEW_IFACE_INTERFACE, "o", wpas_dbus_getter_current_bss, NULL, diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c index f185f278..e11dd36c 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers.c +++ b/wpa_supplicant/dbus/dbus_new_handlers.c @@ -3239,6 +3239,30 @@ dbus_bool_t wpas_dbus_getter_bridge_ifname( } +/** + * wpas_dbus_getter_config_file - Get interface configuration file path + * @iter: Pointer to incoming dbus message iter + * @error: Location to store error on failure + * @user_data: Function specific data + * Returns: TRUE on success, FALSE on failure + * + * Getter for "ConfigFile" property. + */ +dbus_bool_t wpas_dbus_getter_config_file( + const struct wpa_dbus_property_desc *property_desc, + DBusMessageIter *iter, DBusError *error, void *user_data) +{ + struct wpa_supplicant *wpa_s = user_data; + char *confname = ""; + + if (wpa_s->confname) + confname = wpa_s->confname; + + return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_STRING, + &confname, error); +} + + /** * wpas_dbus_getter_bsss - Get array of BSSs objects * @iter: Pointer to incoming dbus message iter diff --git a/wpa_supplicant/dbus/dbus_new_handlers.h b/wpa_supplicant/dbus/dbus_new_handlers.h index cd299c05..1d6235d6 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers.h +++ b/wpa_supplicant/dbus/dbus_new_handlers.h @@ -150,6 +150,7 @@ DECLARE_ACCESSOR(wpas_dbus_setter_scan_interval); DECLARE_ACCESSOR(wpas_dbus_getter_ifname); DECLARE_ACCESSOR(wpas_dbus_getter_driver); DECLARE_ACCESSOR(wpas_dbus_getter_bridge_ifname); +DECLARE_ACCESSOR(wpas_dbus_getter_config_file); DECLARE_ACCESSOR(wpas_dbus_getter_current_bss); DECLARE_ACCESSOR(wpas_dbus_getter_current_network); DECLARE_ACCESSOR(wpas_dbus_getter_current_auth_mode); diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h index 7a16b7aa..220b7ba3 100644 --- a/wpa_supplicant/driver_i.h +++ b/wpa_supplicant/driver_i.h @@ -733,12 +733,11 @@ static inline int wpa_drv_set_replay_protect(struct wpa_supplicant *wpa_s, } static inline int wpa_drv_set_current_cipher_suite(struct wpa_supplicant *wpa_s, - const u8 *cs, size_t cs_len) + u64 cs) { if (!wpa_s->driver->set_current_cipher_suite) return -1; - return wpa_s->driver->set_current_cipher_suite(wpa_s->drv_priv, cs, - cs_len); + return wpa_s->driver->set_current_cipher_suite(wpa_s->drv_priv, cs); } static inline int wpa_drv_enable_controlled_port(struct wpa_supplicant *wpa_s, diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c index 741670be..d67d3b2a 100644 --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c @@ -178,6 +178,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, ifmsh->bss[0] = bss = os_zalloc(sizeof(struct hostapd_data)); if (!bss) goto out_free; + dl_list_init(&bss->nr_db); os_memcpy(bss->own_addr, wpa_s->own_addr, ETH_ALEN); bss->driver = wpa_s->driver; diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c index 7ffdefe2..d14c7e3b 100644 --- a/wpa_supplicant/mesh_mpm.c +++ b/wpa_supplicant/mesh_mpm.c @@ -348,7 +348,7 @@ static void mesh_mpm_send_plink_action(struct wpa_supplicant *wpa_s, if (type != PLINK_CLOSE && wpa_s->mesh_vht_enabled) { u8 vht_capa_oper[2 + 12 + 2 + 5]; - pos = hostapd_eid_vht_capabilities(bss, vht_capa_oper); + pos = hostapd_eid_vht_capabilities(bss, vht_capa_oper, 0); pos = hostapd_eid_vht_operation(bss, pos); wpabuf_put_data(buf, vht_capa_oper, pos - vht_capa_oper); } diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 5bb1f72c..07855764 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -1456,6 +1456,14 @@ static void wpas_ext_capab_byte(struct wpa_supplicant *wpa_s, u8 *pos, int idx) break; case 6: /* Bits 48-55 */ break; + case 7: /* Bits 56-63 */ + break; + case 8: /* Bits 64-71 */ + if (wpa_s->conf->ftm_responder) + *pos |= 0x40; /* Bit 70 - FTM responder */ + if (wpa_s->conf->ftm_initiator) + *pos |= 0x80; /* Bit 71 - FTM initiator */ + break; } } @@ -1465,6 +1473,9 @@ int wpas_build_ext_capab(struct wpa_supplicant *wpa_s, u8 *buf, size_t buflen) u8 *pos = buf; u8 len = 6, i; + if (len < 9 && + (wpa_s->conf->ftm_initiator || wpa_s->conf->ftm_responder)) + len = 9; if (len < wpa_s->extended_capa_len) len = wpa_s->extended_capa_len; if (buflen < (size_t) len + 2) { diff --git a/wpa_supplicant/wpa_supplicant.conf b/wpa_supplicant/wpa_supplicant.conf index 6ece942d..c3d52724 100644 --- a/wpa_supplicant/wpa_supplicant.conf +++ b/wpa_supplicant/wpa_supplicant.conf @@ -449,6 +449,22 @@ fast_reauth=1 # sent to not-associated AP; if associated, AP BSSID) #gas_address3=0 +# Publish fine timing measurement (FTM) responder functionality in +# the Extended Capabilities element bit 70. +# Controls whether FTM responder functionality will be published by AP/STA. +# Note that actual FTM responder operation is managed outside wpa_supplicant. +# 0 = Do not publish; default +# 1 = Publish +#ftm_responder=0 + +# Publish fine timing measurement (FTM) initiator functionality in +# the Extended Capabilities element bit 71. +# Controls whether FTM initiator functionality will be published by AP/STA. +# Note that actual FTM initiator operation is managed outside wpa_supplicant. +# 0 = Do not publish; default +# 1 = Publish +#ftm_initiator=0 + # credential block # # Each credential used for automatic network selection is configured as a set diff --git a/wpa_supplicant/wpas_kay.c b/wpa_supplicant/wpas_kay.c index 0b876008..d6ec8c50 100644 --- a/wpa_supplicant/wpas_kay.c +++ b/wpa_supplicant/wpas_kay.c @@ -50,10 +50,9 @@ static int wpas_set_replay_protect(void *wpa_s, Boolean enabled, u32 window) } -static int wpas_set_current_cipher_suite(void *wpa_s, const u8 *cs, - size_t cs_len) +static int wpas_set_current_cipher_suite(void *wpa_s, u64 cs) { - return wpa_drv_set_current_cipher_suite(wpa_s, cs, cs_len); + return wpa_drv_set_current_cipher_suite(wpa_s, cs); } -- cgit v1.2.3