diff --git a/SOURCES/rh1032758-fix-pmksa-cache-entry-clearing.patch b/SOURCES/rh1032758-fix-pmksa-cache-entry-clearing.patch new file mode 100644 index 0000000..91fdc12 --- /dev/null +++ b/SOURCES/rh1032758-fix-pmksa-cache-entry-clearing.patch @@ -0,0 +1,150 @@ +From 4033935dd9098938838d6d7934ceb65f92a1fa3c Mon Sep 17 00:00:00 2001 +From: Jouni Malinen +Date: Wed, 22 May 2013 13:24:30 +0300 +Subject: [PATCH] Fix OKC-based PMKSA cache entry clearing + +Commit c3fea272747f738f5723fc577371fe03711d988f added a call to clear +all other PMKSA cache entries for the same network if the PMKSA cache +entry of the current AP changed. This was needed to fix OKC cases since +the other APs would likely use the new PMK in the future. However, this +ended up clearing entries in cases where that is not desired and this +resulted in needing additional full EAP authentication with networks +that did not support OKC if wpa_supplicant was configured to try to use +it. + +Make PMKSA cache entry flushing more limited so that the other entries +are removed only if they used the old PMK that was replaced for the +current AP and only if that PMK had previously been used successfully +(i.e., opportunistic flag was already cleared back to 0 in +wpa_supplicant_key_neg_complete()). This is still enough to fix the +issue described in that older commit while not causing problems for +standard PMKSA caching operations even if OKC is enabled in +wpa_supplicant configuration. + +Signed-hostap: Jouni Malinen +--- + src/rsn_supp/pmksa_cache.c | 27 ++++++++++++++++++++------- + src/rsn_supp/pmksa_cache.h | 3 ++- + src/rsn_supp/wpa.c | 2 +- + 3 files changed, 23 insertions(+), 9 deletions(-) + +diff --git a/src/rsn_supp/pmksa_cache.c b/src/rsn_supp/pmksa_cache.c +index df67583..93056ea 100644 +--- a/src/rsn_supp/pmksa_cache.c ++++ b/src/rsn_supp/pmksa_cache.c +@@ -160,25 +160,31 @@ pmksa_cache_add(struct rsn_pmksa_cache *pmksa, const u8 *pmk, size_t pmk_len, + os_free(entry); + return pos; + } + if (prev == NULL) + pmksa->pmksa = pos->next; + else + prev->next = pos->next; +- wpa_printf(MSG_DEBUG, "RSN: Replace PMKSA entry for " +- "the current AP"); +- pmksa_cache_free_entry(pmksa, pos, PMKSA_REPLACE); + + /* + * If OKC is used, there may be other PMKSA cache + * entries based on the same PMK. These needs to be + * flushed so that a new entry can be created based on +- * the new PMK. ++ * the new PMK. Only clear other entries if they have a ++ * matching PMK and this PMK has been used successfully ++ * with the current AP, i.e., if opportunistic flag has ++ * been cleared in wpa_supplicant_key_neg_complete(). + */ +- pmksa_cache_flush(pmksa, network_ctx); ++ wpa_printf(MSG_DEBUG, "RSN: Replace PMKSA entry for " ++ "the current AP and any PMKSA cache entry " ++ "that was based on the old PMK"); ++ if (!pos->opportunistic) ++ pmksa_cache_flush(pmksa, network_ctx, pos->pmk, ++ pos->pmk_len); ++ pmksa_cache_free_entry(pmksa, pos, PMKSA_REPLACE); + break; + } + prev = pos; + pos = pos->next; + } + + if (pmksa->pmksa_count >= pmksa_cache_max_entries && pmksa->pmksa) { +@@ -231,23 +237,30 @@ pmksa_cache_add(struct rsn_pmksa_cache *pmksa, const u8 *pmk, size_t pmk_len, + } + + + /** + * pmksa_cache_flush - Flush PMKSA cache entries for a specific network + * @pmksa: Pointer to PMKSA cache data from pmksa_cache_init() + * @network_ctx: Network configuration context or %NULL to flush all entries ++ * @pmk: PMK to match for or %NYLL to match all PMKs ++ * @pmk_len: PMK length + */ +-void pmksa_cache_flush(struct rsn_pmksa_cache *pmksa, void *network_ctx) ++void pmksa_cache_flush(struct rsn_pmksa_cache *pmksa, void *network_ctx, ++ const u8 *pmk, size_t pmk_len) + { + struct rsn_pmksa_cache_entry *entry, *prev = NULL, *tmp; + int removed = 0; + + entry = pmksa->pmksa; + while (entry) { +- if (entry->network_ctx == network_ctx || network_ctx == NULL) { ++ if ((entry->network_ctx == network_ctx || ++ network_ctx == NULL) && ++ (pmk == NULL || ++ (pmk_len == entry->pmk_len && ++ os_memcmp(pmk, entry->pmk, pmk_len) == 0))) { + wpa_printf(MSG_DEBUG, "RSN: Flush PMKSA cache entry " + "for " MACSTR, MAC2STR(entry->aa)); + if (prev) + prev->next = entry->next; + else + pmksa->pmksa = entry->next; + tmp = entry; +diff --git a/src/rsn_supp/pmksa_cache.h b/src/rsn_supp/pmksa_cache.h +index 6f3dfb3..d5aa229 100644 +--- a/src/rsn_supp/pmksa_cache.h ++++ b/src/rsn_supp/pmksa_cache.h +@@ -62,15 +62,16 @@ struct rsn_pmksa_cache_entry * pmksa_cache_get_current(struct wpa_sm *sm); + void pmksa_cache_clear_current(struct wpa_sm *sm); + int pmksa_cache_set_current(struct wpa_sm *sm, const u8 *pmkid, + const u8 *bssid, void *network_ctx, + int try_opportunistic); + struct rsn_pmksa_cache_entry * + pmksa_cache_get_opportunistic(struct rsn_pmksa_cache *pmksa, + void *network_ctx, const u8 *aa); +-void pmksa_cache_flush(struct rsn_pmksa_cache *pmksa, void *network_ctx); ++void pmksa_cache_flush(struct rsn_pmksa_cache *pmksa, void *network_ctx, ++ const u8 *pmk, size_t pmk_len); + + #else /* IEEE8021X_EAPOL and !CONFIG_NO_WPA2 */ + + static inline struct rsn_pmksa_cache * + pmksa_cache_init(void (*free_cb)(struct rsn_pmksa_cache_entry *entry, + void *ctx, int reason), + void *ctx, struct wpa_sm *sm) +diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c +index e50404c..365a710 100644 +--- a/src/rsn_supp/wpa.c ++++ b/src/rsn_supp/wpa.c +@@ -2618,15 +2618,15 @@ void wpa_sm_update_replay_ctr(struct wpa_sm *sm, const u8 *replay_ctr) + os_memcpy(sm->rx_replay_counter, replay_ctr, WPA_REPLAY_COUNTER_LEN); + } + + + void wpa_sm_pmksa_cache_flush(struct wpa_sm *sm, void *network_ctx) + { + #ifndef CONFIG_NO_WPA2 +- pmksa_cache_flush(sm->pmksa, network_ctx); ++ pmksa_cache_flush(sm->pmksa, network_ctx, NULL, 0); + #endif /* CONFIG_NO_WPA2 */ + } + + + #ifdef CONFIG_WNM + int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf) + { +-- +1.8.3.1 + diff --git a/SOURCES/rh948453-man-page.patch b/SOURCES/rh948453-man-page.patch new file mode 100644 index 0000000..06e95ca --- /dev/null +++ b/SOURCES/rh948453-man-page.patch @@ -0,0 +1,397 @@ +diff -up wpa_supplicant-2.0/wpa_supplicant/doc/docbook/eapol_test.sgml.man-page wpa_supplicant-2.0/wpa_supplicant/doc/docbook/eapol_test.sgml +--- wpa_supplicant-2.0/wpa_supplicant/doc/docbook/eapol_test.sgml.man-page 2014-01-20 16:40:02.340869189 -0600 ++++ wpa_supplicant-2.0/wpa_supplicant/doc/docbook/eapol_test.sgml 2014-01-20 16:40:02.340869189 -0600 +@@ -0,0 +1,205 @@ ++ ++ ++ ++ ++ eapol_test ++ 8 ++ ++ ++ eapol_test ++ ++ EAP peer and RADIUS client testing ++ ++ ++ ++ ++ eapol_test ++ -nWS ++ -cconfig file ++ -aserver IP address ++ -Aclient IP address ++ -pUDP port ++ -sshared secret ++ -rre-authentications ++ -ttimeout ++ -CConnect-Info ++ -MMAC address ++ -ofile ++ -Nattr spec ++ ++ ++ eapol_test scard ++ ++ ++ eapol_test sim ++ PIN ++ num triplets ++ ++ ++ ++ ++ Overview ++ ++ eapol_test is a program that links together the same EAP ++ peer implementation that wpa_supplicant is using and the RADIUS ++ authentication client code from hostapd. In addition, it has ++ minimal glue code to combine these two components in similar ++ ways to IEEE 802.1X/EAPOL Authenticator state machines. In other ++ words, it integrates IEEE 802.1X Authenticator (normally, an ++ access point) and IEEE 802.1X Supplicant (normally, a wireless ++ client) together to generate a single program that can be used to ++ test EAP methods without having to setup an access point and a ++ wireless client. ++ ++ The main uses for eapol_test are in interoperability testing ++ of EAP methods against RADIUS servers and in development testing ++ for new EAP methods. It can be easily used to automate EAP testing ++ for interoperability and regression since the program can be run ++ from shell scripts without require additional test components apart ++ from a RADIUS server. For example, the automated EAP tests described ++ in eap_testing.txt are implemented with eapol_test. Similarly, ++ eapol_test could be used to implement an automated regression ++ test suite for a RADIUS authentication server. ++ ++ ++ As an example: ++ ++
++eapol_test -ctest.conf -a127.0.0.1 -p1812 -ssecret -r1 ++
++ ++ tries to complete EAP authentication based on the network ++ configuration from test.conf against the RADIUS server running ++ on the local host. A re-authentication is triggered to test fast ++ re-authentication. The configuration file uses the same format for ++ network blocks as wpa_supplicant. ++ ++
++ ++ Command Arguments ++ ++ ++ -c configuration file path ++ ++ A configuration to use. The configuration should ++ use the same format for network blocks as wpa_supplicant. ++ ++ ++ ++ ++ -a AS address ++ ++ IP address of the authentication server. The ++ default is '127.0.0.1'. ++ ++ ++ ++ -A client address ++ ++ IP address of the client. The default is to ++ select an address automatically. ++ ++ ++ ++ -p AS port ++ ++ UDP port of the authentication server. The ++ default is '1812'. ++ ++ ++ ++ -s AS secret ++ ++ Shared secret with the authentication server. ++ The default is 'radius'. ++ ++ ++ ++ -r count ++ ++ Number of reauthentications. ++ ++ ++ ++ -t timeout ++ ++ Timeout in seconds. The default is 30. ++ ++ ++ ++ -C info ++ ++ RADIUS Connect-Info. The default is ++ 'CONNECT 11Mbps 802.11b'. ++ ++ ++ ++ ++ -M mac address ++ ++ Client MAC address (Calling-Station-Id). The ++ default is '02:00:00:00:00:01'. ++ ++ ++ ++ -o file ++ ++ Location to write out server certificate. ++ ++ ++ ++ ++ -N attr spec ++ ++ Send arbitrary attribute specific by ++ attr_id:syntax:value, or attr_id alone. attr_id should be the numeric ++ ID of the attribute, and syntax should be one of 's' (string), ++ 'd' (integer), or 'x' (octet string). The value is the attribute value ++ to send. When attr_id is given alone, NULL is used as the attribute ++ value. Multiple attributes can be specified by using the option ++ several times. ++ ++ ++ ++ -n ++ ++ Indicates that no MPPE keys are expected. ++ ++ ++ ++ ++ -W ++ ++ Wait for a control interface monitor before starting. ++ ++ ++ ++ ++ -S ++ ++ Save configuration after authentication. ++ ++ ++ ++ ++ ++ ++ See Also ++ ++ ++ wpa_supplicant ++ 8 ++ ++ ++ ++ ++ Legal ++ wpa_supplicant is copyright (c) 2003-2012, ++ Jouni Malinen j@w1.fi and ++ contributors. ++ All Rights Reserved. ++ ++ This program is licensed under the BSD license (the one with ++ advertisement clause removed). ++ ++
+diff -up wpa_supplicant-2.0/wpa_supplicant/doc/docbook/Makefile.man-page wpa_supplicant-2.0/wpa_supplicant/doc/docbook/Makefile +--- wpa_supplicant-2.0/wpa_supplicant/doc/docbook/Makefile.man-page 2013-01-12 09:42:53.000000000 -0600 ++++ wpa_supplicant-2.0/wpa_supplicant/doc/docbook/Makefile 2014-01-20 16:40:02.342869164 -0600 +@@ -1,4 +1,4 @@ +-all: man html pdf ++all: man + + FILES += wpa_background + FILES += wpa_cli +@@ -7,6 +7,7 @@ FILES += wpa_passphrase + FILES += wpa_priv + FILES += wpa_supplicant.conf + FILES += wpa_supplicant ++FILES += eapol_test + + man: + for i in $(FILES); do docbook2man $$i.sgml; done +@@ -20,7 +21,7 @@ pdf: + + + clean: +- rm -f wpa_background.8 wpa_cli.8 wpa_gui.8 wpa_passphrase.8 wpa_priv.8 wpa_supplicant.8 ++ rm -f wpa_background.8 wpa_cli.8 wpa_gui.8 wpa_passphrase.8 wpa_priv.8 wpa_supplicant.8 eapol_test.8 + rm -f wpa_supplicant.conf.5 + rm -f manpage.links manpage.refs + rm -f $(FILES:%=%.pdf) +diff -up wpa_supplicant-2.0/wpa_supplicant/doc/docbook/wpa_cli.sgml.man-page wpa_supplicant-2.0/wpa_supplicant/doc/docbook/wpa_cli.sgml +--- wpa_supplicant-2.0/wpa_supplicant/doc/docbook/wpa_cli.sgml.man-page 2013-01-12 09:42:53.000000000 -0600 ++++ wpa_supplicant-2.0/wpa_supplicant/doc/docbook/wpa_cli.sgml 2014-01-20 16:40:02.339869202 -0600 +@@ -15,10 +15,12 @@ + + wpa_cli + -p path to ctrl sockets ++ -g path to global ctrl_interface socket + -i ifname + -hvB + -a action file + -P pid file ++ -G ping interval + command ... + + +@@ -111,6 +113,14 @@ CTRL-REQ-OTP-2:Challenge 1235663 needed + + + ++ -g control socket path ++ ++ Connect to the global control socket at the ++ indicated path rather than an interface-specific control ++ socket. ++ ++ ++ + -i ifname + + Specify the interface that is being +@@ -161,6 +171,13 @@ CTRL-REQ-OTP-2:Challenge 1235663 needed + + + ++ -G ping interval ++ ++ Set the interval (in seconds) at which ++ wpa_cli pings the supplicant. ++ ++ ++ + command + + Run a command. The available commands are +diff -up wpa_supplicant-2.0/wpa_supplicant/doc/docbook/wpa_supplicant.sgml.man-page wpa_supplicant-2.0/wpa_supplicant/doc/docbook/wpa_supplicant.sgml +--- wpa_supplicant-2.0/wpa_supplicant/doc/docbook/wpa_supplicant.sgml.man-page 2013-01-12 09:42:53.000000000 -0600 ++++ wpa_supplicant-2.0/wpa_supplicant/doc/docbook/wpa_supplicant.sgml 2014-01-20 16:40:02.339869202 -0600 +@@ -12,7 +12,7 @@ + + + wpa_supplicant +- -BddfhKLqqtuvW ++ -BddfhKLqqsTtuvW + -iifname + -cconfig file + -Ddriver +@@ -344,9 +344,20 @@ + + + ++ -e entropy file ++ ++ File for wpa_supplicant to use to ++ maintain its internal entropy store in over restarts. ++ ++ ++ ++ + -f output file + +- Log output to specified file instead of stdout. ++ Log output to specified file instead of stdout. (This ++ is only available if wpa_supplicant was ++ built with the CONFIG_DEBUG_FILE ++ option.) + + + +@@ -387,6 +398,22 @@ + + + ++ -o override driver ++ ++ Override the driver parameter for new ++ interfaces. ++ ++ ++ ++ ++ -O override ctrl_interface ++ ++ Override the ctrl_interface parameter for new ++ interfaces. ++ ++ ++ ++ + -p + + Driver parameters. (Per interface) +@@ -409,10 +436,40 @@ + + + ++ -s ++ ++ Log output to syslog instead of stdout. (This is only ++ available if wpa_supplicant was built ++ with the CONFIG_DEBUG_SYSLOG ++ option.) ++ ++ ++ ++ ++ -T ++ ++ Log output to Linux tracing in addition to any other ++ destinations. (This is only available ++ if wpa_supplicant was built with ++ the CONFIG_DEBUG_LINUX_TRACING ++ option.) ++ ++ ++ ++ ++ -t ++ ++ Include timestamp in debug messages. ++ ++ ++ ++ + -u + +- Enabled DBus control interface. If enabled, interface +- definitions may be omitted. ++ Enable DBus control interface. If enabled, interface ++ definitions may be omitted. (This is only available ++ if wpa_supplicant was built with ++ the CONFIG_DBUS option.) + + + +diff -up wpa_supplicant-2.0/wpa_supplicant/main.c.man-page wpa_supplicant-2.0/wpa_supplicant/main.c +--- wpa_supplicant-2.0/wpa_supplicant/main.c.man-page 2013-01-12 09:42:53.000000000 -0600 ++++ wpa_supplicant-2.0/wpa_supplicant/main.c 2014-01-20 16:40:02.340869189 -0600 +@@ -23,11 +23,11 @@ static void usage(void) + int i; + printf("%s\n\n%s\n" + "usage:\n" +- " wpa_supplicant [-BddhKLqqstuvW] [-P] " ++ " wpa_supplicant [-BddhKLqqtvW] [-P] " + "[-g] \\\n" + " -i -c [-C] [-D] " + "[-p] \\\n" +- " [-b] [-f] [-e] " ++ " [-b] [-e] " + "\\\n" + " [-o] [-O] \\\n" + " [-N -i -c [-C] " diff --git a/SPECS/wpa_supplicant.spec b/SPECS/wpa_supplicant.spec index ce4b24c..65dc604 100644 --- a/SPECS/wpa_supplicant.spec +++ b/SPECS/wpa_supplicant.spec @@ -7,7 +7,7 @@ Summary: WPA/WPA2/IEEE 802.1X Supplicant Name: wpa_supplicant Epoch: 1 Version: 2.0 -Release: 6%{?dist} +Release: 12%{?dist} License: BSD Group: System Environment/Base Source0: http://w1.fi/releases/%{name}-%{version}%{rcver}%{snapshot}.tar.gz @@ -42,6 +42,10 @@ Patch6: wpa_supplicant-gui-qt4.patch Patch7: libnl3-includes.patch # Less aggressive roaming; signal strength is wildly variable Patch8: rh837402-less-aggressive-roaming.patch +# Add missing command-line options to man page, also filed upstream +Patch9: rh948453-man-page.patch +# Don't evict current AP from PMKSA cache when it's large +Patch10: rh1032758-fix-pmksa-cache-entry-clearing.patch %if %{build_libeap} # Dirty hack for WiMAX # http://linuxwimax.org/Download?action=AttachFile&do=get&target=wpa-1.5-README.txt @@ -58,6 +62,7 @@ BuildRequires: readline-devel BuildRequires: dbus-devel BuildRequires: libnl3-devel BuildRequires: systemd-units +BuildRequires: docbook-utils Requires(post): systemd-sysv Requires(post): systemd-units Requires(preun): systemd-units @@ -110,6 +115,8 @@ Don't use this unless you know what you're doing. %patch6 -p1 -b .qt4 %patch7 -p1 -b .libnl3 %patch8 -p1 -b .rh837402-less-aggressive-roaming +%patch9 -p1 -b .man-page +%patch10 -p1 -b .pmksa-clear-fix %build pushd wpa_supplicant @@ -127,6 +134,10 @@ pushd wpa_supplicant make eapol_test popd +pushd wpa_supplicant/doc/docbook + make +popd + %install # init scripts install -D -m 0755 %{SOURCE3} %{buildroot}/%{_unitdir}/%{name}.service @@ -253,6 +264,21 @@ fi %endif %changelog +* Fri Jan 24 2014 Daniel Mach - 1:2.0-12 +- Mass rebuild 2014-01-24 + +* Mon Jan 20 2014 Dan Williams - 1:2.0-11 +- Add eapol_test manpage (rh #948453) + +* Fri Dec 27 2013 Daniel Mach - 1:2.0-10 +- Mass rebuild 2013-12-27 + +* Mon Dec 16 2013 Dan Williams - 1:2.0-9 +- Don't disconnect when PMKSA cache gets too large (rh #1032758) (rh #1016707) + +* Mon Dec 16 2013 Dan Winship - 1:2.0-8 +- Fill in some gaps in the man pages (rh #948453) + * Wed Jul 10 2013 Dan Williams - 1:2.0-6 - Enable full RELRO/PIE/PIC for wpa_supplicant and libeap - Fix changelog dates