From af24bf3c9513019bdc491d6125142afb10145d76 Mon Sep 17 00:00:00 2001 From: openeuler_eason Date: Fri, 10 Jan 2020 11:13:18 +0800 Subject: [PATCH] wpa_supplicant: clean code --- ...allow-to-override-names-of-qt4-tools.patch | 28 ++-- build-config | 2 + ...74-0001-D-Bus-Implement-Pmf-property.patch | 141 ------------------ rh837402-less-aggressive-roaming.patch | 42 ------ wpa_supplicant-assoc-timeout.patch | 16 -- wpa_supplicant-flush-debug-output.patch | 49 ------ ...upplicant-quiet-scan-results-message.patch | 30 ---- wpa_supplicant.logrotate | 1 + wpa_supplicant.spec | 18 +-- wpa_supplicant.sysconfig | 11 -- 10 files changed, 21 insertions(+), 317 deletions(-) rename wpa_supplicant-gui-qt4.patch => allow-to-override-names-of-qt4-tools.patch (59%) delete mode 100644 rh1567474-0001-D-Bus-Implement-Pmf-property.patch delete mode 100644 rh837402-less-aggressive-roaming.patch delete mode 100644 wpa_supplicant-assoc-timeout.patch delete mode 100644 wpa_supplicant-flush-debug-output.patch delete mode 100644 wpa_supplicant-quiet-scan-results-message.patch delete mode 100644 wpa_supplicant.sysconfig diff --git a/wpa_supplicant-gui-qt4.patch b/allow-to-override-names-of-qt4-tools.patch similarity index 59% rename from wpa_supplicant-gui-qt4.patch rename to allow-to-override-names-of-qt4-tools.patch index c54cd9a..480d57f 100644 --- a/wpa_supplicant-gui-qt4.patch +++ b/allow-to-override-names-of-qt4-tools.patch @@ -1,29 +1,27 @@ -From 9404f356e394604d1d3d6dbffc52abd54260e4d4 Mon Sep 17 00:00:00 2001 -From: Lubomir Rintel -Date: Tue, 27 Oct 2015 08:56:35 +0100 -Subject: [PATCH] wpa_supplicant: allow overriding the names of the Qt4 tools +From 96e803dc2502f1d822258048bb8dd5febe733dc7 Mon Sep 17 00:00:00 2001 +From: openEuler Buildteam +Date: Fri, 10 Jan 2020 09:25:47 +0800 +Subject: [PATCH] allow to override names of the Qt4 tools. -This is useful for distributions that ship different versions of Qt in -different locations. --- - wpa_supplicant/Makefile | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) + wpa_supplicant/Makefile | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile -index ad9ead9..b19676d 100644 +index 371789d..56c319c 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -11,6 +11,9 @@ export INCDIR ?= /usr/local/include/ +@@ -21,7 +21,8 @@ export LIBDIR ?= /usr/local/lib/ + export INCDIR ?= /usr/local/include/ export BINDIR ?= /usr/local/sbin/ PKG_CONFIG ?= pkg-config - -+QMAKE ?= qmake +- +LRELEASE ?= lrelease -+ ++QMAKE ?= qmake CFLAGS += $(EXTRA_CFLAGS) CFLAGS += -I$(abspath ../src) CFLAGS += -I$(abspath ../src/utils) -@@ -1787,10 +1790,10 @@ wpa_gui: +@@ -1811,10 +1812,10 @@ wpa_gui: @echo "wpa_gui has been removed - see wpa_gui-qt4 for replacement" wpa_gui-qt4/Makefile: @@ -37,5 +35,5 @@ index ad9ead9..b19676d 100644 wpa_gui-qt4: wpa_gui-qt4/Makefile wpa_gui-qt4/lang/wpa_gui_de.qm $(MAKE) -C wpa_gui-qt4 -- -2.6.2 +1.8.3.1 diff --git a/build-config b/build-config index c33b321..b7369ec 100644 --- a/build-config +++ b/build-config @@ -1,3 +1,5 @@ +# some build configs for wpa_supplicant + CONFIG_CTRL_IFACE=y CONFIG_CTRL_IFACE_DBUS=y CONFIG_CTRL_IFACE_DBUS_NEW=y diff --git a/rh1567474-0001-D-Bus-Implement-Pmf-property.patch b/rh1567474-0001-D-Bus-Implement-Pmf-property.patch deleted file mode 100644 index 7e3e95d..0000000 --- a/rh1567474-0001-D-Bus-Implement-Pmf-property.patch +++ /dev/null @@ -1,141 +0,0 @@ -From adf8f45f8af27a9ac9429ecde81776b19b6f9224 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Stijn Tintel -Date: Thu, 12 Jan 2017 17:13:26 +0100 -Subject: [PATCH] D-Bus: Implement Pmf property - -The Pmf property is documented in doc/dbus.doxygen, but does not exist, -so implement it. - -Signed-off-by: Stijn Tintel ---- - wpa_supplicant/dbus/dbus_new.c | 12 +++++++ - wpa_supplicant/dbus/dbus_new.h | 1 + - wpa_supplicant/dbus/dbus_new_handlers.c | 55 +++++++++++++++++++++++++++++++++ - wpa_supplicant/dbus/dbus_new_handlers.h | 2 ++ - 4 files changed, 70 insertions(+) - -diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c -index a60118254..0c355f799 100644 ---- a/wpa_supplicant/dbus/dbus_new.c -+++ b/wpa_supplicant/dbus/dbus_new.c -@@ -1987,6 +1987,11 @@ void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s, - case WPAS_DBUS_PROP_AP_SCAN: - prop = "ApScan"; - break; -+#ifdef CONFIG_IEEE80211W -+ case WPAS_DBUS_PROP_PMF: -+ prop = "Pmf"; -+ break; -+#endif /* CONFIG_IEEE80211W */ - case WPAS_DBUS_PROP_SCANNING: - prop = "Scanning"; - break; -@@ -3138,6 +3143,13 @@ static const struct wpa_dbus_property_desc wpas_dbus_interface_properties[] = { - wpas_dbus_setter_ap_scan, - NULL - }, -+#ifdef CONFIG_IEEE80211W -+ { "Pmf", WPAS_DBUS_NEW_IFACE_INTERFACE, "u", -+ wpas_dbus_getter_pmf, -+ wpas_dbus_setter_pmf, -+ NULL -+ }, -+#endif /* CONFIG_IEEE80211W */ - { "BSSExpireAge", WPAS_DBUS_NEW_IFACE_INTERFACE, "u", - wpas_dbus_getter_bss_expire_age, - wpas_dbus_setter_bss_expire_age, -diff --git a/wpa_supplicant/dbus/dbus_new.h b/wpa_supplicant/dbus/dbus_new.h -index 2b0b775d3..bd0e07433 100644 ---- a/wpa_supplicant/dbus/dbus_new.h -+++ b/wpa_supplicant/dbus/dbus_new.h -@@ -22,6 +22,7 @@ struct wps_credential; - - enum wpas_dbus_prop { - WPAS_DBUS_PROP_AP_SCAN, -+ WPAS_DBUS_PROP_PMF, - WPAS_DBUS_PROP_SCANNING, - WPAS_DBUS_PROP_STATE, - WPAS_DBUS_PROP_CURRENT_BSS, -diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c -index e36226d86..094301045 100644 ---- a/wpa_supplicant/dbus/dbus_new_handlers.c -+++ b/wpa_supplicant/dbus/dbus_new_handlers.c -@@ -2787,6 +2787,61 @@ dbus_bool_t wpas_dbus_setter_ap_scan( - } - - -+#ifdef CONFIG_IEEE80211W -+ -+/** -+ * wpas_dbus_getter_pmf - Control PMF default -+ * @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 function for "Pmf" property. -+ */ -+dbus_bool_t wpas_dbus_getter_pmf( -+ const struct wpa_dbus_property_desc *property_desc, -+ DBusMessageIter *iter, DBusError *error, void *user_data) -+{ -+ struct wpa_supplicant *wpa_s = user_data; -+ dbus_uint32_t pmf = wpa_s->conf->pmf; -+ -+ return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT32, -+ &pmf, error); -+} -+ -+ -+/** -+ * wpas_dbus_setter_pmf - Control PMF default -+ * @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 -+ * -+ * Setter function for "Pmf" property. -+ */ -+dbus_bool_t wpas_dbus_setter_pmf( -+ const struct wpa_dbus_property_desc *property_desc, -+ DBusMessageIter *iter, DBusError *error, void *user_data) -+{ -+ struct wpa_supplicant *wpa_s = user_data; -+ dbus_uint32_t pmf; -+ -+ if (!wpas_dbus_simple_property_setter(iter, error, DBUS_TYPE_UINT32, -+ &pmf)) -+ return FALSE; -+ -+ if (pmf > 2) { -+ dbus_set_error_const(error, DBUS_ERROR_FAILED, -+ "Pmf must be 0, 1, or 2"); -+ return FALSE; -+ } -+ wpa_s->conf->pmf = pmf; -+ return TRUE; -+} -+ -+#endif /* CONFIG_IEEE80211W */ -+ -+ - /** - * wpas_dbus_getter_fast_reauth - Control fast - * reauthentication (TLS session resumption) -diff --git a/wpa_supplicant/dbus/dbus_new_handlers.h b/wpa_supplicant/dbus/dbus_new_handlers.h -index fe8767a11..3b8f0966f 100644 ---- a/wpa_supplicant/dbus/dbus_new_handlers.h -+++ b/wpa_supplicant/dbus/dbus_new_handlers.h -@@ -138,6 +138,8 @@ DECLARE_ACCESSOR(wpas_dbus_getter_state); - DECLARE_ACCESSOR(wpas_dbus_getter_scanning); - DECLARE_ACCESSOR(wpas_dbus_getter_ap_scan); - DECLARE_ACCESSOR(wpas_dbus_setter_ap_scan); -+DECLARE_ACCESSOR(wpas_dbus_getter_pmf); -+DECLARE_ACCESSOR(wpas_dbus_setter_pmf); - DECLARE_ACCESSOR(wpas_dbus_getter_fast_reauth); - DECLARE_ACCESSOR(wpas_dbus_setter_fast_reauth); - DECLARE_ACCESSOR(wpas_dbus_getter_disconnect_reason); --- -2.14.3 - diff --git a/rh837402-less-aggressive-roaming.patch b/rh837402-less-aggressive-roaming.patch deleted file mode 100644 index d6fea85..0000000 --- a/rh837402-less-aggressive-roaming.patch +++ /dev/null @@ -1,42 +0,0 @@ -From b82d45d4bbd5c160fa97a8c5355243c78a55bf14 Mon Sep 17 00:00:00 2001 -From: Dan Williams -Date: Tue, 22 Nov 2016 15:50:01 +0100 -Subject: [PATCH 2/2] Less aggressive roaming; signal strength is wildly - variable - -dcbw states (2015-04): "upstream doesn't like that patch so it's been discussed -and I think rejected." ---- - wpa_supplicant/events.c | 14 ++++++-------- - 1 file changed, 6 insertions(+), 8 deletions(-) - -diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c -index 72a0412..4dc044c 100644 ---- a/wpa_supplicant/events.c -+++ b/wpa_supplicant/events.c -@@ -1443,16 +1443,14 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s, - - min_diff = 2; - if (current_bss->level < 0) { -- if (current_bss->level < -85) -- min_diff = 1; -- else if (current_bss->level < -80) -- min_diff = 2; -- else if (current_bss->level < -75) -- min_diff = 3; -- else if (current_bss->level < -70) -+ if (current_bss->level < -75) - min_diff = 4; -+ else if (current_bss->level < -70) -+ min_diff = 6; -+ else if (current_bss->level < -65) -+ min_diff = 8; - else -- min_diff = 5; -+ min_diff = 15; - } - if (to_5ghz) { - /* Make it easier to move to 5 GHz band */ --- -2.9.3 - diff --git a/wpa_supplicant-assoc-timeout.patch b/wpa_supplicant-assoc-timeout.patch deleted file mode 100644 index c3b3568..0000000 --- a/wpa_supplicant-assoc-timeout.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -up wpa_supplicant-0.7.3/wpa_supplicant/wpa_supplicant.c.assoc-timeout wpa_supplicant-0.7.3/wpa_supplicant/wpa_supplicant.c ---- wpa_supplicant-0.7.3/wpa_supplicant/wpa_supplicant.c.assoc-timeout 2010-09-07 10:43:39.000000000 -0500 -+++ wpa_supplicant-0.7.3/wpa_supplicant/wpa_supplicant.c 2010-12-07 18:57:45.163457000 -0600 -@@ -1262,10 +1262,10 @@ void wpa_supplicant_associate(struct wpa - - if (assoc_failed) { - /* give IBSS a bit more time */ -- timeout = ssid->mode == WPAS_MODE_IBSS ? 10 : 5; -+ timeout = ssid->mode == WPAS_MODE_IBSS ? 20 : 10; - } else if (wpa_s->conf->ap_scan == 1) { - /* give IBSS a bit more time */ -- timeout = ssid->mode == WPAS_MODE_IBSS ? 20 : 10; -+ timeout = ssid->mode == WPAS_MODE_IBSS ? 20 : 20; - } - wpa_supplicant_req_auth_timeout(wpa_s, timeout, 0); - } diff --git a/wpa_supplicant-flush-debug-output.patch b/wpa_supplicant-flush-debug-output.patch deleted file mode 100644 index a686851..0000000 --- a/wpa_supplicant-flush-debug-output.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- wpa_supplicant-0.6.3/src/utils/wpa_debug.c.flush-debug 2007-07-30 23:15:34.000000000 -0400 -+++ wpa_supplicant-0.6.3/src/utils/wpa_debug.c 2007-07-30 23:17:06.000000000 -0400 -@@ -157,6 +157,7 @@ void wpa_debug_print_timestamp(void) - if (out_file) { - fprintf(out_file, "%ld.%06u: ", (long) tv.sec, - (unsigned int) tv.usec); -+ fflush(out_file); - } else - #endif /* CONFIG_DEBUG_FILE */ - printf("%ld.%06u: ", (long) tv.sec, (unsigned int) tv.usec); -@@ -185,6 +186,7 @@ void wpa_printf(int level, char *fmt, .. - if (out_file) { - vfprintf(out_file, fmt, ap); - fprintf(out_file, "\n"); -+ fflush(out_file); - } else { - #endif /* CONFIG_DEBUG_FILE */ - vprintf(fmt, ap); -@@ -217,6 +219,7 @@ static void _wpa_hexdump(int level, cons - fprintf(out_file, " [REMOVED]"); - } - fprintf(out_file, "\n"); -+ fflush(out_file); - } else { - #endif /* CONFIG_DEBUG_FILE */ - printf("%s - hexdump(len=%lu):", title, (unsigned long) len); -@@ -262,12 +265,14 @@ static void _wpa_hexdump_ascii(int level - fprintf(out_file, - "%s - hexdump_ascii(len=%lu): [REMOVED]\n", - title, (unsigned long) len); -+ fflush(out_file); - return; - } - if (buf == NULL) { - fprintf(out_file, - "%s - hexdump_ascii(len=%lu): [NULL]\n", - title, (unsigned long) len); -+ fflush(out_file); - return; - } - fprintf(out_file, "%s - hexdump_ascii(len=%lu):\n", -@@ -292,6 +297,7 @@ static void _wpa_hexdump_ascii(int level - pos += llen; - len -= llen; - } -+ fflush(out_file); - } else { - #endif /* CONFIG_DEBUG_FILE */ - if (!show) { diff --git a/wpa_supplicant-quiet-scan-results-message.patch b/wpa_supplicant-quiet-scan-results-message.patch deleted file mode 100644 index c646a30..0000000 --- a/wpa_supplicant-quiet-scan-results-message.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 763a4ef660e2bd81f6cdc71a2f29a0a3e71b2ebc Mon Sep 17 00:00:00 2001 -From: Dan Williams -Date: Tue, 22 Nov 2016 15:48:17 +0100 -Subject: [PATCH 1/2] quiet an annoying and frequent syslog message - ---- - wpa_supplicant/events.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c -index abe3b47..72a0412 100644 ---- a/wpa_supplicant/events.c -+++ b/wpa_supplicant/events.c -@@ -1555,11 +1555,11 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s, - if (wpa_s->last_scan_req == MANUAL_SCAN_REQ && - wpa_s->manual_scan_use_id && wpa_s->own_scan_running && - own_request && !(data && data->scan_info.external_scan)) { -- wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS "id=%u", -+ wpa_msg_ctrl(wpa_s, MSG_DEBUG, WPA_EVENT_SCAN_RESULTS "id=%u", - wpa_s->manual_scan_id); - wpa_s->manual_scan_use_id = 0; - } else { -- wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS); -+ wpa_msg_ctrl(wpa_s, MSG_DEBUG, WPA_EVENT_SCAN_RESULTS); - } - wpas_notify_scan_results(wpa_s); - --- -2.9.3 - diff --git a/wpa_supplicant.logrotate b/wpa_supplicant.logrotate index bd7ef91..d6eed2e 100644 --- a/wpa_supplicant.logrotate +++ b/wpa_supplicant.logrotate @@ -1,4 +1,5 @@ /var/log/wpa_supplicant.log { + maxage 365 missingok notifempty size 30k diff --git a/wpa_supplicant.spec b/wpa_supplicant.spec index 0e13de6..55ebfeb 100644 --- a/wpa_supplicant.spec +++ b/wpa_supplicant.spec @@ -1,6 +1,6 @@ Name: wpa_supplicant Epoch: 1 -Version: 2.6 +Version: 2.7 Release: 22 Summary: A WPA Supplicant with support for WPA and WPA2 (IEEE 802.11i / RSN) License: BSD @@ -9,17 +9,10 @@ Source0: http://w1.fi/releases/%{name}-%{version}.tar.gz Source1: build-config Source2: %{name}.conf Source3: %{name}.service -Source4: %{name}.sysconfig Source5: %{name}.logrotate #patches number ranging between [0,6000) are from fedora/redhat upstream #patches number ranging between [6000,9000) are backport from higher versions, including some CVE fixes -Patch0000: wpa_supplicant-assoc-timeout.patch -Patch0001: wpa_supplicant-flush-debug-output.patch -Patch0003: wpa_supplicant-quiet-scan-results-message.patch -Patch0004: wpa_supplicant-gui-qt4.patch -Patch0005: rh837402-less-aggressive-roaming.patch - Patch6000: macsec-0001-mka-Move-structs-transmit-receive-_-sa-sc-to-a-commo.patch Patch6001: macsec-0002-mka-Pass-full-structures-down-to-macsec-drivers-pack.patch Patch6002: macsec-0003-mka-Pass-full-structures-down-to-macsec-drivers-tran.patch @@ -72,9 +65,6 @@ Patch6048: rh1462262-use-system-openssl-ciphers.patch Patch6049: rh1465138-openssl-Fix-openssl-1-1-private-key-callback.patch Patch6050: rh1497640-mka-add-error-handling-for-secy_init_macsec.patch Patch6051: rh1497640-pae-validate-input-before-pointer.patch - -Patch0006: rh1567474-0001-D-Bus-Implement-Pmf-property.patch - Patch6052: rh1567474-0002-D-Bus-Add-pmf-to-global-capabilities.patch Patch6053: rh1570903-nl80211-Fix-NL80211_ATTR_SMPS_MODE-encoding.patch Patch6054: CVE-2019-9496-SAE-Fix-confirm-message-validation-in-error-cases.patch @@ -93,6 +83,7 @@ Patch6066: CVE-2019-11555-1.patch Patch6067: CVE-2019-11555-2.patch Patch9000: add-options-of-wpa_supplicant-service.patch +Patch9001: allow-to-override-names-of-qt4-tools.patch BuildRequires: qt-devel >= 4.0 openssl-devel readline-devel dbus-devel libnl3-devel systemd-units docbook-utils Requires(post): systemd-sysv @@ -142,7 +133,6 @@ cp -f %{SOURCE1} %{name}/.config %install install -Dm600 %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf install -Dm644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service -install -Dm644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/%{name} install -Dm644 %{SOURCE5} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} install -d %{buildroot}/%{_sbindir} @@ -167,7 +157,6 @@ install -m644 %{name}/doc/docbook/*.5 %{buildroot}%{_mandir}/man5 %files %license COPYING %config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf -%config(noreplace) %{_sysconfdir}/sysconfig/%{name} %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %{_unitdir}/%{name}.service %{_sysconfdir}/dbus-1/system.d/%{name}.conf @@ -188,6 +177,9 @@ install -m644 %{name}/doc/docbook/*.5 %{buildroot}%{_mandir}/man5 %{_mandir}/man5/* %changelog +* Fri Jan 10 2020 openEuler Buildteam - 1:2.6-23 +- clean code + * Tue Dec 31 2019 openEuler Buildteam - 1:2.6-22 - add options of wpa_supplicant.service diff --git a/wpa_supplicant.sysconfig b/wpa_supplicant.sysconfig deleted file mode 100644 index 33bd7af..0000000 --- a/wpa_supplicant.sysconfig +++ /dev/null @@ -1,11 +0,0 @@ -# Use the flag "-i" before each of your interfaces, like so: -# INTERFACES="-ieth1 -iwlan0" -INTERFACES="" - -# Use the flag "-D" before each driver, like so: -# DRIVERS="-Dwext" -DRIVERS="" - -# Other arguments -# -s Use syslog logging backend -OTHER_ARGS="-s" -- Gitee