Browse Source

Fixed opportunistic key caching (OKC)

wpa_sm_set_config() can be called even if the network block does not
change. However, the previous version ended up calling
pmksa_cache_notify_reconfig() every time and this cleared the network
context from PMKSA cache entries. This prevented OKC from ever being used.

Do not call pmksa_cache_notify_reconfig() if the network context remains
unchanged to allow OKC to be used.
Jouni Malinen 16 years ago
parent
commit
3ff77e070d
2 changed files with 3 additions and 1 deletions
  1. 2 1
      src/rsn_supp/wpa.c
  2. 1 0
      wpa_supplicant/ChangeLog

+ 2 - 1
src/rsn_supp/wpa.c

@@ -2014,7 +2014,8 @@ void wpa_sm_set_config(struct wpa_sm *sm, struct rsn_supp_config *config)
 		sm->eap_conf_ctx = NULL;
 		sm->eap_conf_ctx = NULL;
 		sm->ssid_len = 0;
 		sm->ssid_len = 0;
 	}
 	}
-	pmksa_cache_notify_reconfig(sm->pmksa);
+	if (config == NULL || config->network_ctx != sm->network_ctx)
+		pmksa_cache_notify_reconfig(sm->pmksa);
 }
 }
 
 
 
 

+ 1 - 0
wpa_supplicant/ChangeLog

@@ -16,6 +16,7 @@ ChangeLog for wpa_supplicant
 	  calculations (CONFIG_INTERNAL_LIBTOMMATH_FAST=y)
 	  calculations (CONFIG_INTERNAL_LIBTOMMATH_FAST=y)
 	* fixed race condition between disassociation event and group key
 	* fixed race condition between disassociation event and group key
 	  handshake to avoid getting stuck in incorrect state [Bug 261]
 	  handshake to avoid getting stuck in incorrect state [Bug 261]
+	* fixed opportunistic key caching (proactive_key_caching)
 
 
 2008-02-22 - v0.6.3
 2008-02-22 - v0.6.3
 	* removed 'nai' and 'eappsk' network configuration variables that were
 	* removed 'nai' and 'eappsk' network configuration variables that were