aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2005-06-26 00:54:56 (GMT)
committerJouni Malinen <j@w1.fi>2005-06-26 00:54:56 (GMT)
commitdb3872a0d35a3c37765c7b89a7e8bb88bb933f26 (patch)
treef5224188815f63b53bfa1a65a1ba3760bddd7333
parent675134617cd0fef53b3bfbb9de24cc753cbb2b59 (diff)
downloadhostap-history-db3872a0d35a3c37765c7b89a7e8bb88bb933f26.zip
hostap-history-db3872a0d35a3c37765c7b89a7e8bb88bb933f26.tar.gz
hostap-history-db3872a0d35a3c37765c7b89a7e8bb88bb933f26.tar.bz2
wpa_s->assoc_wpa_ie is set by default to wpa_supplicant-generated IE
when starting association, so need to have special case for wpa_s->assoc_wpa_ie == NULL in message 2/4 generation.
-rw-r--r--wpa_supplicant/wpa.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/wpa_supplicant/wpa.c b/wpa_supplicant/wpa.c
index 900370e..b8bd635 100644
--- a/wpa_supplicant/wpa.c
+++ b/wpa_supplicant/wpa.c
@@ -1001,28 +1001,19 @@ static int wpa_supplicant_send_2_of_4(struct wpa_sm *sm,
size_t rlen;
struct wpa_eapol_key *reply;
struct wpa_ptk *ptk;
- u8 buf[8], *rbuf, wpa_ie_buf[80], *wpa_ie;
+ u8 buf[8], *rbuf, *wpa_ie;
int wpa_ie_len;
- if (wpa_s->assoc_wpa_ie) {
- /* The driver reported a WPA IE that may be different from the
- * one that the Supplicant would use. Message 2/4 has to use
- * the exact copy of the WPA IE from the Association Request,
- * so use the value reported by the driver. */
- wpa_ie = wpa_s->assoc_wpa_ie;
- wpa_ie_len = wpa_s->assoc_wpa_ie_len;
- } else {
- wpa_ie = 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).");
- return -1;
- }
- wpa_hexdump(MSG_DEBUG, "WPA: WPA IE for msg 2/4",
- wpa_ie, wpa_ie_len);
+ if (wpa_s->assoc_wpa_ie == NULL) {
+ wpa_printf(MSG_WARNING, "WPA: No assoc_wpa_ie set - cannot "
+ "generate msg 2/4");
+ return -1;
}
+ wpa_ie = wpa_s->assoc_wpa_ie;
+ wpa_ie_len = wpa_s->assoc_wpa_ie_len;
+ wpa_hexdump(MSG_DEBUG, "WPA: WPA IE for msg 2/4", wpa_ie, wpa_ie_len);
+
rbuf = wpa_alloc_eapol(sm->ctx, src_addr, ETH_P_EAPOL,
IEEE802_1X_TYPE_EAPOL_KEY, NULL,
sizeof(*reply) + wpa_ie_len,