Make WEP functionality an optional build parameter
WEP should not be used for anything anymore. As a step towards removing it completely, move all WEP related functionality to be within CONFIG_WEP blocks. This will be included in builds only if CONFIG_WEP=y is explicitly set in build configuration. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
bca44f4e4e
commit
200c7693c9
48 changed files with 386 additions and 71 deletions
|
@ -54,12 +54,16 @@ void hostapd_config_defaults_bss(struct hostapd_bss_config *bss)
|
|||
bss->logger_syslog = (unsigned int) -1;
|
||||
bss->logger_stdout = (unsigned int) -1;
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
bss->auth_algs = WPA_AUTH_ALG_OPEN | WPA_AUTH_ALG_SHARED;
|
||||
|
||||
bss->wep_rekeying_period = 300;
|
||||
/* use key0 in individual key and key1 in broadcast key */
|
||||
bss->broadcast_key_idx_min = 1;
|
||||
bss->broadcast_key_idx_max = 2;
|
||||
#else /* CONFIG_WEP */
|
||||
bss->auth_algs = WPA_AUTH_ALG_OPEN;
|
||||
#endif /* CONFIG_WEP */
|
||||
bss->eap_reauth_period = 3600;
|
||||
|
||||
bss->wpa_group_rekey = 600;
|
||||
|
@ -636,6 +640,7 @@ void hostapd_config_free_eap_users(struct hostapd_eap_user *user)
|
|||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
static void hostapd_config_free_wep(struct hostapd_wep_keys *keys)
|
||||
{
|
||||
int i;
|
||||
|
@ -644,6 +649,7 @@ static void hostapd_config_free_wep(struct hostapd_wep_keys *keys)
|
|||
keys->key[i] = NULL;
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
|
||||
void hostapd_config_clear_wpa_psk(struct hostapd_wpa_psk **l)
|
||||
|
@ -732,7 +738,9 @@ void hostapd_config_free_bss(struct hostapd_bss_config *conf)
|
|||
|
||||
str_clear_free(conf->ssid.wpa_passphrase);
|
||||
os_free(conf->ssid.wpa_psk_file);
|
||||
#ifdef CONFIG_WEP
|
||||
hostapd_config_free_wep(&conf->ssid.wep);
|
||||
#endif /* CONFIG_WEP */
|
||||
#ifdef CONFIG_FULL_DYNAMIC_VLAN
|
||||
os_free(conf->ssid.vlan_tagged_interface);
|
||||
#endif /* CONFIG_FULL_DYNAMIC_VLAN */
|
||||
|
@ -1106,6 +1114,7 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
|
|||
return -1;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
if (bss->wpa) {
|
||||
int wep, i;
|
||||
|
||||
|
@ -1123,6 +1132,7 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
if (full_config && bss->wpa &&
|
||||
bss->wpa_psk_radius != PSK_RADIUS_IGNORED &&
|
||||
|
@ -1177,12 +1187,14 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
|
|||
"allowed, disabling HT capabilities");
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
if (full_config && conf->ieee80211n &&
|
||||
bss->ssid.security_policy == SECURITY_STATIC_WEP) {
|
||||
bss->disable_11n = 1;
|
||||
wpa_printf(MSG_ERROR, "HT (IEEE 802.11n) with WEP is not "
|
||||
"allowed, disabling HT capabilities");
|
||||
}
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
if (full_config && conf->ieee80211n && bss->wpa &&
|
||||
!(bss->wpa_pairwise & WPA_CIPHER_CCMP) &&
|
||||
|
@ -1196,12 +1208,14 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
|
|||
}
|
||||
|
||||
#ifdef CONFIG_IEEE80211AC
|
||||
#ifdef CONFIG_WEP
|
||||
if (full_config && conf->ieee80211ac &&
|
||||
bss->ssid.security_policy == SECURITY_STATIC_WEP) {
|
||||
bss->disable_11ac = 1;
|
||||
wpa_printf(MSG_ERROR,
|
||||
"VHT (IEEE 802.11ac) with WEP is not allowed, disabling VHT capabilities");
|
||||
}
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
if (full_config && conf->ieee80211ac && bss->wpa &&
|
||||
!(bss->wpa_pairwise & WPA_CIPHER_CCMP) &&
|
||||
|
@ -1221,12 +1235,14 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
|
|||
bss->wps_state = 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
if (full_config && bss->wps_state &&
|
||||
bss->ssid.wep.keys_set && bss->wpa == 0) {
|
||||
wpa_printf(MSG_INFO, "WPS: WEP configuration forced WPS to be "
|
||||
"disabled");
|
||||
bss->wps_state = 0;
|
||||
}
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
if (full_config && bss->wps_state && bss->wpa &&
|
||||
(!(bss->wpa & 2) ||
|
||||
|
@ -1350,11 +1366,13 @@ int hostapd_config_check(struct hostapd_config *conf, int full_config)
|
|||
void hostapd_set_security_params(struct hostapd_bss_config *bss,
|
||||
int full_config)
|
||||
{
|
||||
#ifdef CONFIG_WEP
|
||||
if (bss->individual_wep_key_len == 0) {
|
||||
/* individual keys are not use; can use key idx0 for
|
||||
* broadcast keys */
|
||||
bss->broadcast_key_idx_min = 0;
|
||||
}
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
if ((bss->wpa & 2) && bss->rsn_pairwise == 0)
|
||||
bss->rsn_pairwise = bss->wpa_pairwise;
|
||||
|
@ -1380,6 +1398,7 @@ void hostapd_set_security_params(struct hostapd_bss_config *bss,
|
|||
} else if (bss->ieee802_1x) {
|
||||
int cipher = WPA_CIPHER_NONE;
|
||||
bss->ssid.security_policy = SECURITY_IEEE_802_1X;
|
||||
#ifdef CONFIG_WEP
|
||||
bss->ssid.wep.default_len = bss->default_wep_key_len;
|
||||
if (full_config && bss->default_wep_key_len) {
|
||||
cipher = bss->default_wep_key_len >= 13 ?
|
||||
|
@ -1390,11 +1409,13 @@ void hostapd_set_security_params(struct hostapd_bss_config *bss,
|
|||
else
|
||||
cipher = WPA_CIPHER_WEP40;
|
||||
}
|
||||
#endif /* CONFIG_WEP */
|
||||
bss->wpa_group = cipher;
|
||||
bss->wpa_pairwise = cipher;
|
||||
bss->rsn_pairwise = cipher;
|
||||
if (full_config)
|
||||
bss->wpa_key_mgmt = WPA_KEY_MGMT_IEEE8021X_NO_WPA;
|
||||
#ifdef CONFIG_WEP
|
||||
} else if (bss->ssid.wep.keys_set) {
|
||||
int cipher = WPA_CIPHER_WEP40;
|
||||
if (bss->ssid.wep.len[0] >= 13)
|
||||
|
@ -1405,6 +1426,7 @@ void hostapd_set_security_params(struct hostapd_bss_config *bss,
|
|||
bss->rsn_pairwise = cipher;
|
||||
if (full_config)
|
||||
bss->wpa_key_mgmt = WPA_KEY_MGMT_NONE;
|
||||
#endif /* CONFIG_WEP */
|
||||
} else if (bss->osen) {
|
||||
bss->ssid.security_policy = SECURITY_OSEN;
|
||||
bss->wpa_group = WPA_CIPHER_CCMP;
|
||||
|
|
|
@ -67,6 +67,7 @@ struct hostapd_radius_servers;
|
|||
struct ft_remote_r0kh;
|
||||
struct ft_remote_r1kh;
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
#define NUM_WEP_KEYS 4
|
||||
struct hostapd_wep_keys {
|
||||
u8 idx;
|
||||
|
@ -75,10 +76,13 @@ struct hostapd_wep_keys {
|
|||
int keys_set;
|
||||
size_t default_len; /* key length used for dynamic key generation */
|
||||
};
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
typedef enum hostap_security_policy {
|
||||
SECURITY_PLAINTEXT = 0,
|
||||
#ifdef CONFIG_WEP
|
||||
SECURITY_STATIC_WEP = 1,
|
||||
#endif /* CONFIG_WEP */
|
||||
SECURITY_IEEE_802_1X = 2,
|
||||
SECURITY_WPA_PSK = 3,
|
||||
SECURITY_WPA = 4,
|
||||
|
@ -102,7 +106,9 @@ struct hostapd_ssid {
|
|||
char *wpa_psk_file;
|
||||
struct sae_pt *pt;
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
struct hostapd_wep_keys wep;
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
#define DYNAMIC_VLAN_DISABLED 0
|
||||
#define DYNAMIC_VLAN_OPTIONAL 1
|
||||
|
@ -321,10 +327,12 @@ struct hostapd_bss_config {
|
|||
size_t eap_req_id_text_len;
|
||||
int eapol_key_index_workaround;
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
size_t default_wep_key_len;
|
||||
int individual_wep_key_len;
|
||||
int wep_rekeying_period;
|
||||
int broadcast_key_idx_min, broadcast_key_idx_max;
|
||||
#endif /* CONFIG_WEP */
|
||||
int eap_reauth_period;
|
||||
int erp_send_reauth_start;
|
||||
char *erp_domain;
|
||||
|
|
|
@ -1360,10 +1360,13 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
|
|||
params->key_mgmt_suites = hapd->conf->wpa_key_mgmt;
|
||||
params->auth_algs = hapd->conf->auth_algs;
|
||||
params->wpa_version = hapd->conf->wpa;
|
||||
params->privacy = hapd->conf->ssid.wep.keys_set || hapd->conf->wpa ||
|
||||
params->privacy = hapd->conf->wpa;
|
||||
#ifdef CONFIG_WEP
|
||||
params->privacy |= hapd->conf->ssid.wep.keys_set ||
|
||||
(hapd->conf->ieee802_1x &&
|
||||
(hapd->conf->default_wep_key_len ||
|
||||
hapd->conf->individual_wep_key_len));
|
||||
#endif /* CONFIG_WEP */
|
||||
switch (hapd->conf->ignore_broadcast_ssid) {
|
||||
case 0:
|
||||
params->hide_ssid = NO_SSID_HIDING;
|
||||
|
|
|
@ -58,8 +58,10 @@
|
|||
|
||||
|
||||
static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason);
|
||||
#ifdef CONFIG_WEP
|
||||
static int hostapd_setup_encryption(char *iface, struct hostapd_data *hapd);
|
||||
static int hostapd_broadcast_wep_clear(struct hostapd_data *hapd);
|
||||
#endif /* CONFIG_WEP */
|
||||
static int setup_interface2(struct hostapd_iface *iface);
|
||||
static void channel_list_update_timeout(void *eloop_ctx, void *timeout_ctx);
|
||||
static void hostapd_interface_setup_failure_handler(void *eloop_ctx,
|
||||
|
@ -89,7 +91,9 @@ void hostapd_reconfig_encryption(struct hostapd_data *hapd)
|
|||
return;
|
||||
|
||||
hostapd_set_privacy(hapd, 0);
|
||||
#ifdef CONFIG_WEP
|
||||
hostapd_setup_encryption(hapd->conf->iface, hapd);
|
||||
#endif /* CONFIG_WEP */
|
||||
}
|
||||
|
||||
|
||||
|
@ -142,7 +146,9 @@ static void hostapd_reload_bss(struct hostapd_data *hapd)
|
|||
wpa_deinit(hapd->wpa_auth);
|
||||
hapd->wpa_auth = NULL;
|
||||
hostapd_set_privacy(hapd, 0);
|
||||
#ifdef CONFIG_WEP
|
||||
hostapd_setup_encryption(hapd->conf->iface, hapd);
|
||||
#endif /* CONFIG_WEP */
|
||||
hostapd_set_generic_elem(hapd, (u8 *) "", 0);
|
||||
}
|
||||
|
||||
|
@ -170,7 +176,9 @@ static void hostapd_clear_old(struct hostapd_iface *iface)
|
|||
for (j = 0; j < iface->num_bss; j++) {
|
||||
hostapd_flush_old_stations(iface->bss[j],
|
||||
WLAN_REASON_PREV_AUTH_NOT_VALID);
|
||||
#ifdef CONFIG_WEP
|
||||
hostapd_broadcast_wep_clear(iface->bss[j]);
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
#ifndef CONFIG_NO_RADIUS
|
||||
/* TODO: update dynamic data based on changed configuration
|
||||
|
@ -284,6 +292,8 @@ int hostapd_reload_config(struct hostapd_iface *iface)
|
|||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
|
||||
static void hostapd_broadcast_key_clear_iface(struct hostapd_data *hapd,
|
||||
const char *ifname)
|
||||
{
|
||||
|
@ -339,6 +349,8 @@ static int hostapd_broadcast_wep_set(struct hostapd_data *hapd)
|
|||
return errors;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
|
||||
static void hostapd_free_hapd_data(struct hostapd_data *hapd)
|
||||
{
|
||||
|
@ -524,6 +536,8 @@ static void hostapd_cleanup_iface(struct hostapd_iface *iface)
|
|||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
|
||||
static void hostapd_clear_wep(struct hostapd_data *hapd)
|
||||
{
|
||||
if (hapd->drv_priv && !hapd->iface->driver_ap_teardown && hapd->conf) {
|
||||
|
@ -571,6 +585,8 @@ static int hostapd_setup_encryption(char *iface, struct hostapd_data *hapd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
|
||||
static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason)
|
||||
{
|
||||
|
@ -606,7 +622,9 @@ static void hostapd_bss_deinit_no_free(struct hostapd_data *hapd)
|
|||
{
|
||||
hostapd_free_stas(hapd);
|
||||
hostapd_flush_old_stations(hapd, WLAN_REASON_DEAUTH_LEAVING);
|
||||
#ifdef CONFIG_WEP
|
||||
hostapd_clear_wep(hapd);
|
||||
#endif /* CONFIG_WEP */
|
||||
}
|
||||
|
||||
|
||||
|
@ -1161,9 +1179,11 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
|
|||
WLAN_REASON_PREV_AUTH_NOT_VALID);
|
||||
hostapd_set_privacy(hapd, 0);
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
hostapd_broadcast_wep_clear(hapd);
|
||||
if (hostapd_setup_encryption(conf->iface, hapd))
|
||||
return -1;
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
/*
|
||||
* Fetch the SSID from the system and use it or,
|
||||
|
|
|
@ -223,7 +223,7 @@ u8 * hostapd_eid_rm_enabled_capab(struct hostapd_data *hapd, u8 *eid,
|
|||
u16 hostapd_own_capab_info(struct hostapd_data *hapd)
|
||||
{
|
||||
int capab = WLAN_CAPABILITY_ESS;
|
||||
int privacy;
|
||||
int privacy = 0;
|
||||
int dfs;
|
||||
int i;
|
||||
|
||||
|
@ -239,12 +239,14 @@ u16 hostapd_own_capab_info(struct hostapd_data *hapd)
|
|||
hapd->iconf->preamble == SHORT_PREAMBLE)
|
||||
capab |= WLAN_CAPABILITY_SHORT_PREAMBLE;
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
privacy = hapd->conf->ssid.wep.keys_set;
|
||||
|
||||
if (hapd->conf->ieee802_1x &&
|
||||
(hapd->conf->default_wep_key_len ||
|
||||
hapd->conf->individual_wep_key_len))
|
||||
privacy = 1;
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
if (hapd->conf->wpa)
|
||||
privacy = 1;
|
||||
|
@ -284,6 +286,7 @@ u16 hostapd_own_capab_info(struct hostapd_data *hapd)
|
|||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
#ifndef CONFIG_NO_RC4
|
||||
static u16 auth_shared_key(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
u16 auth_transaction, const u8 *challenge,
|
||||
|
@ -340,6 +343,7 @@ static u16 auth_shared_key(struct hostapd_data *hapd, struct sta_info *sta,
|
|||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_NO_RC4 */
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
|
||||
static int send_auth_reply(struct hostapd_data *hapd, struct sta_info *sta,
|
||||
|
@ -2543,6 +2547,7 @@ static void handle_auth(struct hostapd_data *hapd,
|
|||
sta->auth_alg = WLAN_AUTH_OPEN;
|
||||
mlme_authenticate_indication(hapd, sta);
|
||||
break;
|
||||
#ifdef CONFIG_WEP
|
||||
#ifndef CONFIG_NO_RC4
|
||||
case WLAN_AUTH_SHARED_KEY:
|
||||
resp = auth_shared_key(hapd, sta, auth_transaction, challenge,
|
||||
|
@ -2561,6 +2566,7 @@ static void handle_auth(struct hostapd_data *hapd,
|
|||
}
|
||||
break;
|
||||
#endif /* CONFIG_NO_RC4 */
|
||||
#endif /* CONFIG_WEP */
|
||||
#ifdef CONFIG_IEEE80211R_AP
|
||||
case WLAN_AUTH_FT:
|
||||
sta->auth_alg = WLAN_AUTH_FT;
|
||||
|
@ -4946,6 +4952,7 @@ static void hostapd_set_wds_encryption(struct hostapd_data *hapd,
|
|||
struct sta_info *sta,
|
||||
char *ifname_wds)
|
||||
{
|
||||
#ifdef CONFIG_WEP
|
||||
int i;
|
||||
struct hostapd_ssid *ssid = &hapd->conf->ssid;
|
||||
|
||||
|
@ -4966,6 +4973,7 @@ static void hostapd_set_wds_encryption(struct hostapd_data *hapd,
|
|||
break;
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_WEP */
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -137,6 +137,7 @@ void ieee802_1x_set_sta_authorized(struct hostapd_data *hapd,
|
|||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
#ifndef CONFIG_FIPS
|
||||
#ifndef CONFIG_NO_RC4
|
||||
|
||||
|
@ -297,6 +298,7 @@ static void ieee802_1x_tx_key(struct hostapd_data *hapd, struct sta_info *sta)
|
|||
|
||||
#endif /* CONFIG_NO_RC4 */
|
||||
#endif /* CONFIG_FIPS */
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
|
||||
const char *radius_mode_txt(struct hostapd_data *hapd)
|
||||
|
@ -2114,6 +2116,8 @@ void ieee802_1x_abort_auth(struct hostapd_data *hapd, struct sta_info *sta)
|
|||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
|
||||
static int ieee802_1x_rekey_broadcast(struct hostapd_data *hapd)
|
||||
{
|
||||
struct eapol_authenticator *eapol = hapd->eapol_auth;
|
||||
|
@ -2198,6 +2202,8 @@ static void ieee802_1x_rekey(void *eloop_ctx, void *timeout_ctx)
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
|
||||
static void ieee802_1x_eapol_send(void *ctx, void *sta_ctx, u8 type,
|
||||
const u8 *data, size_t datalen)
|
||||
|
@ -2361,6 +2367,7 @@ static void _ieee802_1x_abort_auth(void *ctx, void *sta_ctx)
|
|||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
static void _ieee802_1x_tx_key(void *ctx, void *sta_ctx)
|
||||
{
|
||||
#ifndef CONFIG_FIPS
|
||||
|
@ -2372,6 +2379,7 @@ static void _ieee802_1x_tx_key(void *ctx, void *sta_ctx)
|
|||
#endif /* CONFIG_NO_RC4 */
|
||||
#endif /* CONFIG_FIPS */
|
||||
}
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
|
||||
static void ieee802_1x_eapol_event(void *ctx, void *sta_ctx,
|
||||
|
@ -2422,7 +2430,6 @@ static int ieee802_1x_erp_add_key(void *ctx, struct eap_server_erp_key *erp)
|
|||
|
||||
int ieee802_1x_init(struct hostapd_data *hapd)
|
||||
{
|
||||
int i;
|
||||
struct eapol_auth_config conf;
|
||||
struct eapol_auth_cb cb;
|
||||
|
||||
|
@ -2433,7 +2440,9 @@ int ieee802_1x_init(struct hostapd_data *hapd)
|
|||
conf.ctx = hapd;
|
||||
conf.eap_reauth_period = hapd->conf->eap_reauth_period;
|
||||
conf.wpa = hapd->conf->wpa;
|
||||
#ifdef CONFIG_WEP
|
||||
conf.individual_wep_key_len = hapd->conf->individual_wep_key_len;
|
||||
#endif /* CONFIG_WEP */
|
||||
conf.eap_req_id_text = hapd->conf->eap_req_id_text;
|
||||
conf.eap_req_id_text_len = hapd->conf->eap_req_id_text_len;
|
||||
conf.erp_send_reauth_start = hapd->conf->erp_send_reauth_start;
|
||||
|
@ -2448,7 +2457,9 @@ int ieee802_1x_init(struct hostapd_data *hapd)
|
|||
cb.logger = ieee802_1x_logger;
|
||||
cb.set_port_authorized = ieee802_1x_set_port_authorized;
|
||||
cb.abort_auth = _ieee802_1x_abort_auth;
|
||||
#ifdef CONFIG_WEP
|
||||
cb.tx_key = _ieee802_1x_tx_key;
|
||||
#endif /* CONFIG_WEP */
|
||||
cb.eapol_event = ieee802_1x_eapol_event;
|
||||
#ifdef CONFIG_ERP
|
||||
cb.erp_get_key = ieee802_1x_erp_get_key;
|
||||
|
@ -2469,7 +2480,10 @@ int ieee802_1x_init(struct hostapd_data *hapd)
|
|||
return -1;
|
||||
#endif /* CONFIG_NO_RADIUS */
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
if (hapd->conf->default_wep_key_len) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
hostapd_drv_set_key(hapd->conf->iface, hapd,
|
||||
WPA_ALG_NONE, NULL, i, 0, 0, NULL,
|
||||
|
@ -2480,6 +2494,7 @@ int ieee802_1x_init(struct hostapd_data *hapd)
|
|||
if (!hapd->eapol_auth->default_wep_key)
|
||||
return -1;
|
||||
}
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -2499,7 +2514,9 @@ void ieee802_1x_erp_flush(struct hostapd_data *hapd)
|
|||
|
||||
void ieee802_1x_deinit(struct hostapd_data *hapd)
|
||||
{
|
||||
#ifdef CONFIG_WEP
|
||||
eloop_cancel_timeout(ieee802_1x_rekey, hapd, NULL);
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
if (hapd->driver && hapd->drv_priv &&
|
||||
(hapd->conf->ieee802_1x || hapd->conf->wpa))
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
static int vlan_if_add(struct hostapd_data *hapd, struct hostapd_vlan *vlan,
|
||||
int existsok)
|
||||
{
|
||||
int ret, i;
|
||||
int ret;
|
||||
#ifdef CONFIG_WEP
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_WEP_KEYS; i++) {
|
||||
if (!hapd->conf->ssid.wep.key[i])
|
||||
|
@ -32,6 +34,7 @@ static int vlan_if_add(struct hostapd_data *hapd, struct hostapd_vlan *vlan,
|
|||
vlan->ifname);
|
||||
return -1;
|
||||
}
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
if (!iface_exists(vlan->ifname))
|
||||
ret = hostapd_vlan_if_add(hapd, vlan->ifname);
|
||||
|
|
|
@ -651,8 +651,10 @@ static int hapd_wps_cred_cb(struct hostapd_data *hapd, void *ctx)
|
|||
(str_starts(buf, "ssid=") ||
|
||||
str_starts(buf, "ssid2=") ||
|
||||
str_starts(buf, "auth_algs=") ||
|
||||
#ifdef CONFIG_WEP
|
||||
str_starts(buf, "wep_default_key=") ||
|
||||
str_starts(buf, "wep_key") ||
|
||||
#endif /* CONFIG_WEP */
|
||||
str_starts(buf, "wps_state=") ||
|
||||
(pmf_changed && str_starts(buf, "ieee80211w=")) ||
|
||||
str_starts(buf, "wpa=") ||
|
||||
|
@ -1196,6 +1198,7 @@ int hostapd_init_wps(struct hostapd_data *hapd,
|
|||
wpa_snprintf_hex((char *) wps->network_key, 2 * PMK_LEN + 1,
|
||||
conf->ssid.wpa_psk->psk, PMK_LEN);
|
||||
wps->network_key_len = 2 * PMK_LEN;
|
||||
#ifdef CONFIG_WEP
|
||||
} else if (conf->ssid.wep.keys_set && conf->ssid.wep.key[0]) {
|
||||
wps->network_key = os_malloc(conf->ssid.wep.len[0]);
|
||||
if (wps->network_key == NULL)
|
||||
|
@ -1203,6 +1206,7 @@ int hostapd_init_wps(struct hostapd_data *hapd,
|
|||
os_memcpy(wps->network_key, conf->ssid.wep.key[0],
|
||||
conf->ssid.wep.len[0]);
|
||||
wps->network_key_len = conf->ssid.wep.len[0];
|
||||
#endif /* CONFIG_WEP */
|
||||
}
|
||||
|
||||
if (conf->ssid.wpa_psk) {
|
||||
|
|
|
@ -1965,10 +1965,12 @@ const char * wpa_cipher_txt(int cipher)
|
|||
switch (cipher) {
|
||||
case WPA_CIPHER_NONE:
|
||||
return "NONE";
|
||||
#ifdef CONFIG_WEP
|
||||
case WPA_CIPHER_WEP40:
|
||||
return "WEP-40";
|
||||
case WPA_CIPHER_WEP104:
|
||||
return "WEP-104";
|
||||
#endif /* CONFIG_WEP */
|
||||
case WPA_CIPHER_TKIP:
|
||||
return "TKIP";
|
||||
case WPA_CIPHER_CCMP:
|
||||
|
@ -2467,10 +2469,12 @@ int wpa_parse_cipher(const char *value)
|
|||
val |= WPA_CIPHER_GCMP;
|
||||
else if (os_strcmp(start, "TKIP") == 0)
|
||||
val |= WPA_CIPHER_TKIP;
|
||||
#ifdef CONFIG_WEP
|
||||
else if (os_strcmp(start, "WEP104") == 0)
|
||||
val |= WPA_CIPHER_WEP104;
|
||||
else if (os_strcmp(start, "WEP40") == 0)
|
||||
val |= WPA_CIPHER_WEP40;
|
||||
#endif /* CONFIG_WEP */
|
||||
else if (os_strcmp(start, "NONE") == 0)
|
||||
val |= WPA_CIPHER_NONE;
|
||||
else if (os_strcmp(start, "GTK_NOT_USED") == 0)
|
||||
|
|
|
@ -648,6 +648,8 @@ SM_STEP(REAUTH_TIMER)
|
|||
|
||||
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
|
||||
/* Authenticator Key Transmit state machine */
|
||||
|
||||
SM_STATE(AUTH_KEY_TX, NO_KEY_TRANSMIT)
|
||||
|
@ -726,6 +728,8 @@ SM_STEP(KEY_RX)
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
|
||||
|
||||
/* Controlled Directions state machine */
|
||||
|
@ -813,10 +817,12 @@ eapol_auth_alloc(struct eapol_authenticator *eapol, const u8 *addr,
|
|||
|
||||
sm->portControl = Auto;
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
if (!eapol->conf.wpa &&
|
||||
(eapol->default_wep_key || eapol->conf.individual_wep_key_len > 0))
|
||||
sm->keyTxEnabled = TRUE;
|
||||
else
|
||||
#endif /* CONFIG_WEP */
|
||||
sm->keyTxEnabled = FALSE;
|
||||
if (eapol->conf.wpa)
|
||||
sm->portValid = FALSE;
|
||||
|
@ -910,10 +916,12 @@ restart:
|
|||
SM_STEP_RUN(BE_AUTH);
|
||||
if (sm->initializing || eapol_sm_sta_entry_alive(eapol, addr))
|
||||
SM_STEP_RUN(REAUTH_TIMER);
|
||||
#ifdef CONFIG_WEP
|
||||
if (sm->initializing || eapol_sm_sta_entry_alive(eapol, addr))
|
||||
SM_STEP_RUN(AUTH_KEY_TX);
|
||||
if (sm->initializing || eapol_sm_sta_entry_alive(eapol, addr))
|
||||
SM_STEP_RUN(KEY_RX);
|
||||
#endif /* CONFIG_WEP */
|
||||
if (sm->initializing || eapol_sm_sta_entry_alive(eapol, addr))
|
||||
SM_STEP_RUN(CTRL_DIR);
|
||||
|
||||
|
@ -1167,7 +1175,9 @@ static int eapol_auth_conf_clone(struct eapol_auth_config *dst,
|
|||
dst->ctx = src->ctx;
|
||||
dst->eap_reauth_period = src->eap_reauth_period;
|
||||
dst->wpa = src->wpa;
|
||||
#ifdef CONFIG_WEP
|
||||
dst->individual_wep_key_len = src->individual_wep_key_len;
|
||||
#endif /* CONFIG_WEP */
|
||||
os_free(dst->eap_req_id_text);
|
||||
if (src->eap_req_id_text) {
|
||||
dst->eap_req_id_text = os_memdup(src->eap_req_id_text,
|
||||
|
@ -1221,10 +1231,12 @@ struct eapol_authenticator * eapol_auth_init(struct eapol_auth_config *conf,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WEP
|
||||
if (conf->individual_wep_key_len > 0) {
|
||||
/* use key0 in individual key and key1 in broadcast key */
|
||||
eapol->default_wep_key_idx = 1;
|
||||
}
|
||||
#endif /* CONFIG_WEP */
|
||||
|
||||
eapol->cb.eapol_send = cb->eapol_send;
|
||||
eapol->cb.aaa_send = cb->aaa_send;
|
||||
|
@ -1249,6 +1261,8 @@ void eapol_auth_deinit(struct eapol_authenticator *eapol)
|
|||
return;
|
||||
|
||||
eapol_auth_conf_free(&eapol->conf);
|
||||
#ifdef CONFIG_WEP
|
||||
os_free(eapol->default_wep_key);
|
||||
#endif /* CONFIG_WEP */
|
||||
os_free(eapol);
|
||||
}
|
||||
|
|
|
@ -692,6 +692,7 @@ struct eap_key_data {
|
|||
|
||||
static void eapol_sm_processKey(struct eapol_sm *sm)
|
||||
{
|
||||
#ifdef CONFIG_WEP
|
||||
#ifndef CONFIG_FIPS
|
||||
struct ieee802_1x_hdr *hdr;
|
||||
struct ieee802_1x_eapol_key *key;
|
||||
|
@ -866,6 +867,7 @@ static void eapol_sm_processKey(struct eapol_sm *sm)
|
|||
}
|
||||
}
|
||||
#endif /* CONFIG_FIPS */
|
||||
#endif /* CONFIG_WEP */
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue