aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2005-06-24 05:08:37 (GMT)
committerJouni Malinen <j@w1.fi>2005-06-24 05:08:37 (GMT)
commit90ff33a82ae732e5220840689f39cc6c2774dff8 (patch)
treeca482eaed959517d89ee657c0a2c6ced71fb1ab9
parent2af2a613bfdc7a2033e722e99a236974d79d8cf0 (diff)
downloadhostap-history-90ff33a82ae732e5220840689f39cc6c2774dff8.zip
hostap-history-90ff33a82ae732e5220840689f39cc6c2774dff8.tar.gz
hostap-history-90ff33a82ae732e5220840689f39cc6c2774dff8.tar.bz2
Clear wpa_s->keys_cleared automatically on wpa_drv_set_key() calls
instead of having to clear it separately wherever keys are configured.
-rw-r--r--wpa_supplicant/wpa.c2
-rw-r--r--wpa_supplicant/wpa_supplicant.c2
-rw-r--r--wpa_supplicant/wpa_supplicant_i.h1
3 files changed, 1 insertions, 4 deletions
diff --git a/wpa_supplicant/wpa.c b/wpa_supplicant/wpa.c
index f390a36..95d57fd 100644
--- a/wpa_supplicant/wpa.c
+++ b/wpa_supplicant/wpa.c
@@ -1200,7 +1200,6 @@ static int wpa_supplicant_install_ptk(struct wpa_supplicant *wpa_s,
wpa_hexdump(MSG_DEBUG, "WPA: RSC", key_rsc, rsclen);
}
- wpa_s->keys_cleared = 0;
if (wpa_drv_set_key(wpa_s, alg, src_addr, 0, 1, key_rsc, rsclen,
(u8 *) &sm->ptk.tk1, keylen) < 0) {
wpa_printf(MSG_WARNING, "WPA: Failed to set PTK to the "
@@ -1292,7 +1291,6 @@ static int wpa_supplicant_install_gtk(struct wpa_supplicant *wpa_s,
memcpy(gtk_buf + 24, gd->gtk + 16, 8);
_gtk = gtk_buf;
}
- wpa_s->keys_cleared = 0;
if (sm->pairwise_cipher == WPA_CIPHER_NONE) {
if (wpa_drv_set_key(wpa_s, gd->alg,
(u8 *) "\xff\xff\xff\xff\xff\xff",
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 90479f0..ece51e8 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -244,7 +244,6 @@ static int wpa_eapol_set_wep_key(void *ctx, int unicast, int keyidx,
u8 *key, size_t keylen)
{
struct wpa_supplicant *wpa_s = ctx;
- wpa_s->keys_cleared = 0;
return wpa_drv_set_key(wpa_s, WPA_ALG_WEP,
unicast ? wpa_s->bssid :
(u8 *) "\xff\xff\xff\xff\xff\xff",
@@ -257,7 +256,6 @@ static int wpa_set_wep_key(void *ctx, int set_tx, int keyidx, const u8 *key,
size_t keylen)
{
struct wpa_supplicant *wpa_s = ctx;
- wpa_s->keys_cleared = 0;
return wpa_drv_set_key(wpa_s, WPA_ALG_WEP,
(u8 *) "\xff\xff\xff\xff\xff\xff",
keyidx, set_tx, (u8 *) "", 0, key, keylen);
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index 7608f7c..2698d8f 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -307,6 +307,7 @@ static inline int wpa_drv_set_key(struct wpa_supplicant *wpa_s, wpa_alg alg,
const u8 *key, size_t key_len)
{
if (wpa_s->driver->set_key) {
+ wpa_s->keys_cleared = 0;
return wpa_s->driver->set_key(wpa_s->drv_priv, alg, addr,
key_idx, set_tx, seq, seq_len,
key, key_len);