wpa_supplicant AP: Set static WEP keys if configured

This is needed to configure static WEP keys to the driver through the
hostapd configuration structures.
This commit is contained in:
Jouni Malinen 2011-09-15 15:04:46 +03:00 committed by Jouni Malinen
parent 697cd03fc2
commit 6bcb1c2ba5

View file

@ -160,6 +160,22 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
return -1;
os_memcpy(bss->ssid.wpa_psk->psk, ssid->psk, PMK_LEN);
bss->ssid.wpa_psk->group = 1;
} else if (ssid->wep_key_len[0] || ssid->wep_key_len[1] ||
ssid->wep_key_len[2] || ssid->wep_key_len[3]) {
struct hostapd_wep_keys *wep = &bss->ssid.wep;
int i;
for (i = 0; i < NUM_WEP_KEYS; i++) {
if (ssid->wep_key_len[i] == 0)
continue;
wep->key[i] = os_malloc(ssid->wep_key_len[i]);
if (wep->key[i] == NULL)
return -1;
os_memcpy(wep->key[i], ssid->wep_key[i],
ssid->wep_key_len[i]);
wep->len[i] = ssid->wep_key_len[i];
}
wep->idx = ssid->wep_tx_keyidx;
wep->keys_set = 1;
}
/* Select group cipher based on the enabled pairwise cipher suites */