diff --git a/src/drivers/driver.h b/src/drivers/driver.h index ce83a3dd7..51e390966 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -209,6 +209,9 @@ struct wpa_driver_auth_params { int auth_alg; const u8 *ie; size_t ie_len; + const u8 *wep_key[4]; + size_t wep_key_len[4]; + int wep_tx_keyidx; }; /** diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index f720f3457..08a52d0bf 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -1488,7 +1488,7 @@ static int wpa_driver_nl80211_authenticate( void *priv, struct wpa_driver_auth_params *params) { struct wpa_driver_nl80211_data *drv = priv; - int ret = -1; + int ret = -1, i; struct nl_msg *msg; enum nl80211_auth_type type; @@ -1500,6 +1500,16 @@ static int wpa_driver_nl80211_authenticate( wpa_printf(MSG_DEBUG, "nl80211: Authenticate (ifindex=%d)", drv->ifindex); + + for (i = 0; i < 4; i++) { + if (!params->wep_key[i]) + continue; + wpa_driver_nl80211_set_key(drv, WPA_ALG_WEP, NULL, i, + i == params->wep_tx_keyidx, NULL, 0, + params->wep_key[i], + params->wep_key_len[i]); + } + genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0, 0, NL80211_CMD_AUTHENTICATE, 0); diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index 97a5f8056..87b6b9598 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -35,6 +35,7 @@ void sme_authenticate(struct wpa_supplicant *wpa_s, #ifdef CONFIG_IEEE80211R const u8 *md = NULL; #endif /* CONFIG_IEEE80211R */ + int i; if (bss == NULL) { wpa_printf(MSG_ERROR, "SME: No scan result available for the " @@ -84,6 +85,13 @@ void sme_authenticate(struct wpa_supplicant *wpa_s, params.auth_alg); } + for (i = 0; i < NUM_WEP_KEYS; i++) { + if (ssid->wep_key_len[i]) + params.wep_key[i] = ssid->wep_key[i]; + params.wep_key_len[i] = ssid->wep_key_len[i]; + } + params.wep_tx_keyidx = ssid->wep_tx_keyidx; + os_memset(wpa_s->bssid, 0, ETH_ALEN); os_memcpy(wpa_s->pending_bssid, bss->bssid, ETH_ALEN);