aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2005-06-25 17:40:10 (GMT)
committerJouni Malinen <j@w1.fi>2005-06-25 17:40:10 (GMT)
commit327fcc79a26118efbd67a2beedf355a3eff8843d (patch)
tree8035e5c5b52a8f6b308fef1654f9b298ff75ad9b
parentabbbc3573fd748862aea8d3d83b36d66e96a3820 (diff)
downloadhostap-history-327fcc79a26118efbd67a2beedf355a3eff8843d.zip
hostap-history-327fcc79a26118efbd67a2beedf355a3eff8843d.tar.gz
hostap-history-327fcc79a26118efbd67a2beedf355a3eff8843d.tar.bz2
Changed wpa_gen_wpa_ie() to use struct wpa_sm instead of
struct wpa_supplicant.
-rw-r--r--wpa_supplicant/wpa.c9
-rw-r--r--wpa_supplicant/wpa.h5
-rw-r--r--wpa_supplicant/wpa_supplicant.c2
3 files changed, 6 insertions, 10 deletions
diff --git a/wpa_supplicant/wpa.c b/wpa_supplicant/wpa.c
index 97026ef..a556a53 100644
--- a/wpa_supplicant/wpa.c
+++ b/wpa_supplicant/wpa.c
@@ -636,19 +636,18 @@ static int wpa_gen_wpa_ie_rsn(u8 *rsn_ie, size_t rsn_ie_len,
/**
* wpa_gen_wpa_ie - Generate WPA/RSN IE based on current security policy
- * @wpa_s: Pointer to wpa_supplicant data
+ * @sm: Pointer to WPA state machine data from wpa_sm_init()
* @wpa_ie: Pointer to memory area for the generated WPA/RSN IE
* @wpa_ie_len: Maximum length of the generated WPA/RSN IE
* Returns: Length of the generated WPA/RSN IE or -1 on failure
*/
-int wpa_gen_wpa_ie(struct wpa_supplicant *wpa_s, u8 *wpa_ie, size_t wpa_ie_len)
+int wpa_gen_wpa_ie(struct wpa_sm *sm, u8 *wpa_ie, size_t wpa_ie_len)
{
- struct wpa_sm *sm = wpa_s->wpa;
if (sm->proto == WPA_PROTO_RSN)
return wpa_gen_wpa_ie_rsn(wpa_ie, wpa_ie_len,
sm->pairwise_cipher,
sm->group_cipher,
- sm->key_mgmt, wpa_s->wpa);
+ sm->key_mgmt, sm);
else
return wpa_gen_wpa_ie_wpa(wpa_ie, wpa_ie_len,
sm->pairwise_cipher,
@@ -1014,7 +1013,7 @@ static int wpa_supplicant_send_2_of_4(struct wpa_sm *sm,
wpa_ie_len = wpa_s->assoc_wpa_ie_len;
} else {
wpa_ie = wpa_ie_buf;
- wpa_ie_len = wpa_gen_wpa_ie(wpa_s, wpa_ie, sizeof(wpa_ie_buf));
+ wpa_ie_len = wpa_gen_wpa_ie(sm, wpa_ie, sizeof(wpa_ie_buf));
if (wpa_ie_len < 0) {
wpa_printf(MSG_WARNING, "WPA: Failed to generate "
"WPA IE (for msg 2 of 4).");
diff --git a/wpa_supplicant/wpa.h b/wpa_supplicant/wpa.h
index 740664c..8bf0b98 100644
--- a/wpa_supplicant/wpa.h
+++ b/wpa_supplicant/wpa.h
@@ -180,10 +180,7 @@ struct wpa_ie_data {
int wpa_parse_wpa_ie(const u8 *wpa_ie, size_t wpa_ie_len,
struct wpa_ie_data *data);
-struct wpa_supplicant;
-
-int wpa_gen_wpa_ie(struct wpa_supplicant *wpa_s, u8 *wpa_ie,
- size_t wpa_ie_len);
+int wpa_gen_wpa_ie(struct wpa_sm *sm, u8 *wpa_ie, size_t wpa_ie_len);
int wpa_sm_rx_eapol(struct wpa_sm *sm, const unsigned char *src_addr,
unsigned char *buf, size_t len);
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 5bb17e3..870ae18 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1051,7 +1051,7 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
wpa_s->pairwise_cipher);
wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_GROUP, wpa_s->group_cipher);
- *wpa_ie_len = wpa_gen_wpa_ie(wpa_s, wpa_ie, *wpa_ie_len);
+ *wpa_ie_len = wpa_gen_wpa_ie(wpa_s->wpa, wpa_ie, *wpa_ie_len);
if (*wpa_ie_len < 0) {
wpa_printf(MSG_WARNING, "WPA: Failed to generate WPA IE.");
return -1;