WPS: Enable WSC 2.0 support unconditionally
There is not much point in building devices with WPS 1.0 only supported nowadays. As such, there is not sufficient justification for maintaining extra complexity for the CONFIG_WPS2 build option either. Remove this by enabling WSC 2.0 support unconditionally. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
91364b7f10
commit
c201f93a9e
24 changed files with 4 additions and 158 deletions
|
@ -393,10 +393,6 @@ NEED_AES_UNWRAP=y
|
|||
endif
|
||||
|
||||
ifdef CONFIG_WPS
|
||||
ifdef CONFIG_WPS2
|
||||
L_CFLAGS += -DCONFIG_WPS2
|
||||
endif
|
||||
|
||||
L_CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
|
||||
OBJS += src/utils/uuid.c
|
||||
OBJS += src/ap/wps_hostapd.c
|
||||
|
|
|
@ -376,10 +376,6 @@ NEED_AES_UNWRAP=y
|
|||
endif
|
||||
|
||||
ifdef CONFIG_WPS
|
||||
ifdef CONFIG_WPS2
|
||||
CFLAGS += -DCONFIG_WPS2
|
||||
endif
|
||||
|
||||
CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
|
||||
OBJS += ../src/utils/uuid.o
|
||||
OBJS += ../src/ap/wps_hostapd.o
|
||||
|
|
|
@ -63,7 +63,6 @@ includes WPS support and uses madwifi driver interface:
|
|||
CONFIG_DRIVER_MADWIFI=y
|
||||
CFLAGS += -I/usr/src/madwifi-0.9.3
|
||||
CONFIG_WPS=y
|
||||
CONFIG_WPS2=y
|
||||
CONFIG_WPS_UPNP=y
|
||||
|
||||
Following parameter can be used to enable support for NFC config method:
|
||||
|
|
|
@ -108,8 +108,6 @@ CONFIG_IEEE80211W=y
|
|||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
CONFIG_WPS=y
|
||||
# Enable WSC 2.0 support
|
||||
CONFIG_WPS2=y
|
||||
# Enable UPnP support for external WPS Registrars
|
||||
#CONFIG_WPS_UPNP=y
|
||||
|
||||
|
|
|
@ -113,8 +113,6 @@ CONFIG_EAP_TTLS=y
|
|||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
#CONFIG_WPS=y
|
||||
# Enable WSC 2.0 support
|
||||
#CONFIG_WPS2=y
|
||||
# Enable UPnP support for external WPS Registrars
|
||||
#CONFIG_WPS_UPNP=y
|
||||
# Enable WPS support with NFC config method
|
||||
|
|
|
@ -782,7 +782,7 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
|
|||
}
|
||||
#endif /* CONFIG_IEEE80211N */
|
||||
|
||||
#ifdef CONFIG_WPS2
|
||||
#ifdef CONFIG_WPS
|
||||
if (full_config && bss->wps_state && bss->ignore_broadcast_ssid) {
|
||||
wpa_printf(MSG_INFO, "WPS: ignore_broadcast_ssid "
|
||||
"configuration forced WPS to be disabled");
|
||||
|
@ -803,7 +803,7 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
|
|||
"WPA2/CCMP forced WPS to be disabled");
|
||||
bss->wps_state = 0;
|
||||
}
|
||||
#endif /* CONFIG_WPS2 */
|
||||
#endif /* CONFIG_WPS */
|
||||
|
||||
#ifdef CONFIG_HS20
|
||||
if (full_config && bss->hs20 &&
|
||||
|
|
|
@ -128,14 +128,14 @@ int hostapd_build_ap_extra_ies(struct hostapd_data *hapd,
|
|||
}
|
||||
#endif /* CONFIG_P2P_MANAGER */
|
||||
|
||||
#ifdef CONFIG_WPS2
|
||||
#ifdef CONFIG_WPS
|
||||
if (hapd->conf->wps_state) {
|
||||
struct wpabuf *a = wps_build_assoc_resp_ie();
|
||||
if (a && wpabuf_resize(&assocresp, wpabuf_len(a)) == 0)
|
||||
wpabuf_put_buf(assocresp, a);
|
||||
wpabuf_free(a);
|
||||
}
|
||||
#endif /* CONFIG_WPS2 */
|
||||
#endif /* CONFIG_WPS */
|
||||
|
||||
#ifdef CONFIG_P2P_MANAGER
|
||||
if (hapd->conf->p2p & P2P_MANAGE) {
|
||||
|
|
|
@ -378,48 +378,11 @@ static int hapd_wps_reconfig_in_memory(struct hostapd_data *hapd,
|
|||
}
|
||||
bss->auth_algs = 1;
|
||||
} else {
|
||||
#ifdef CONFIG_WPS2
|
||||
/*
|
||||
* WPS 2.0 does not allow WEP to be configured, so no need to
|
||||
* process that option here either.
|
||||
*/
|
||||
bss->auth_algs = 1;
|
||||
#else /* CONFIG_WPS2 */
|
||||
if ((cred->auth_type & WPS_AUTH_OPEN) &&
|
||||
(cred->auth_type & WPS_AUTH_SHARED))
|
||||
bss->auth_algs = 3;
|
||||
else if (cred->auth_type & WPS_AUTH_SHARED)
|
||||
bss->auth_algs = 2;
|
||||
else
|
||||
bss->auth_algs = 1;
|
||||
if (cred->encr_type & WPS_ENCR_WEP && cred->key_idx > 0 &&
|
||||
cred->key_idx <= 4) {
|
||||
struct hostapd_wep_keys *wep = &bss->ssid.wep;
|
||||
int idx = cred->key_idx;
|
||||
if (idx)
|
||||
idx--;
|
||||
wep->idx = idx;
|
||||
if (cred->key_len == 10 || cred->key_len == 26) {
|
||||
os_free(wep->key[idx]);
|
||||
wep->key[idx] = os_malloc(cred->key_len / 2);
|
||||
if (wep->key[idx] == NULL ||
|
||||
hexstr2bin((const char *) cred->key,
|
||||
wep->key[idx],
|
||||
cred->key_len / 2))
|
||||
return -1;
|
||||
wep->len[idx] = cred->key_len / 2;
|
||||
} else {
|
||||
os_free(wep->key[idx]);
|
||||
wep->key[idx] = os_malloc(cred->key_len);
|
||||
if (wep->key[idx] == NULL)
|
||||
return -1;
|
||||
os_memcpy(wep->key[idx], cred->key,
|
||||
cred->key_len);
|
||||
wep->len[idx] = cred->key_len;
|
||||
}
|
||||
wep->keys_set = 1;
|
||||
}
|
||||
#endif /* CONFIG_WPS2 */
|
||||
}
|
||||
|
||||
/* Schedule configuration reload after short period of time to allow
|
||||
|
@ -594,39 +557,11 @@ static int hapd_wps_cred_cb(struct hostapd_data *hapd, void *ctx)
|
|||
|
||||
fprintf(nconf, "auth_algs=1\n");
|
||||
} else {
|
||||
#ifdef CONFIG_WPS2
|
||||
/*
|
||||
* WPS 2.0 does not allow WEP to be configured, so no need to
|
||||
* process that option here either.
|
||||
*/
|
||||
fprintf(nconf, "auth_algs=1\n");
|
||||
#else /* CONFIG_WPS2 */
|
||||
if ((cred->auth_type & WPS_AUTH_OPEN) &&
|
||||
(cred->auth_type & WPS_AUTH_SHARED))
|
||||
fprintf(nconf, "auth_algs=3\n");
|
||||
else if (cred->auth_type & WPS_AUTH_SHARED)
|
||||
fprintf(nconf, "auth_algs=2\n");
|
||||
else
|
||||
fprintf(nconf, "auth_algs=1\n");
|
||||
|
||||
if (cred->encr_type & WPS_ENCR_WEP && cred->key_idx <= 4) {
|
||||
int key_idx = cred->key_idx;
|
||||
if (key_idx)
|
||||
key_idx--;
|
||||
fprintf(nconf, "wep_default_key=%d\n", key_idx);
|
||||
fprintf(nconf, "wep_key%d=", key_idx);
|
||||
if (cred->key_len == 10 || cred->key_len == 26) {
|
||||
/* WEP key as a hex string */
|
||||
for (i = 0; i < cred->key_len; i++)
|
||||
fputc(cred->key[i], nconf);
|
||||
} else {
|
||||
/* Raw WEP key; convert to hex */
|
||||
for (i = 0; i < cred->key_len; i++)
|
||||
fprintf(nconf, "%02x", cred->key[i]);
|
||||
}
|
||||
fprintf(nconf, "\n");
|
||||
}
|
||||
#endif /* CONFIG_WPS2 */
|
||||
}
|
||||
|
||||
fprintf(nconf, "# WPS configuration - END\n");
|
||||
|
@ -1078,7 +1013,6 @@ int hostapd_init_wps(struct hostapd_data *hapd,
|
|||
os_strdup(hapd->conf->serial_number) : NULL;
|
||||
wps->config_methods =
|
||||
wps_config_methods_str2bin(hapd->conf->config_methods);
|
||||
#ifdef CONFIG_WPS2
|
||||
if ((wps->config_methods &
|
||||
(WPS_CONFIG_DISPLAY | WPS_CONFIG_VIRT_DISPLAY |
|
||||
WPS_CONFIG_PHY_DISPLAY)) == WPS_CONFIG_DISPLAY) {
|
||||
|
@ -1093,7 +1027,6 @@ int hostapd_init_wps(struct hostapd_data *hapd,
|
|||
"virtual_push_button for WPS 2.0 compliance");
|
||||
wps->config_methods |= WPS_CONFIG_VIRT_PUSHBUTTON;
|
||||
}
|
||||
#endif /* CONFIG_WPS2 */
|
||||
os_memcpy(wps->dev.pri_dev_type, hapd->conf->device_type,
|
||||
WPS_DEV_TYPE_LEN);
|
||||
|
||||
|
|
|
@ -511,13 +511,11 @@ struct wpabuf * wps_build_probe_req_ie(u16 pw_id, struct wps_device_data *dev,
|
|||
wps_build_assoc_state(NULL, ie) ||
|
||||
wps_build_config_error(ie, WPS_CFG_NO_ERROR) ||
|
||||
wps_build_dev_password_id(ie, pw_id) ||
|
||||
#ifdef CONFIG_WPS2
|
||||
wps_build_manufacturer(dev, ie) ||
|
||||
wps_build_model_name(dev, ie) ||
|
||||
wps_build_model_number(dev, ie) ||
|
||||
wps_build_dev_name(dev, ie) ||
|
||||
wps_build_wfa_ext(ie, req_type == WPS_REQ_ENROLLEE, NULL, 0) ||
|
||||
#endif /* CONFIG_WPS2 */
|
||||
wps_build_req_dev_type(dev, ie, num_req_dev_types, req_dev_types)
|
||||
||
|
||||
wps_build_secondary_dev_type(dev, ie)
|
||||
|
@ -526,13 +524,6 @@ struct wpabuf * wps_build_probe_req_ie(u16 pw_id, struct wps_device_data *dev,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_WPS2
|
||||
if (dev->p2p && wps_build_dev_name(dev, ie)) {
|
||||
wpabuf_free(ie);
|
||||
return NULL;
|
||||
}
|
||||
#endif /* CONFIG_WPS2 */
|
||||
|
||||
return wps_ie_encapsulate(ie);
|
||||
}
|
||||
|
||||
|
|
|
@ -205,7 +205,6 @@ int wps_build_version(struct wpabuf *msg)
|
|||
int wps_build_wfa_ext(struct wpabuf *msg, int req_to_enroll,
|
||||
const u8 *auth_macs, size_t auth_macs_count)
|
||||
{
|
||||
#ifdef CONFIG_WPS2
|
||||
u8 *len;
|
||||
|
||||
#ifdef CONFIG_WPS_TESTING
|
||||
|
@ -246,7 +245,6 @@ int wps_build_wfa_ext(struct wpabuf *msg, int req_to_enroll,
|
|||
}
|
||||
|
||||
WPA_PUT_BE16(len, (u8 *) wpabuf_put(msg, 0) - len - 2);
|
||||
#endif /* CONFIG_WPS2 */
|
||||
|
||||
#ifdef CONFIG_WPS_TESTING
|
||||
if (WPS_VERSION > 0x20) {
|
||||
|
@ -299,9 +297,7 @@ int wps_build_auth_type_flags(struct wps_data *wps, struct wpabuf *msg)
|
|||
/* WPA/WPA2-Enterprise enrollment not supported through WPS */
|
||||
auth_types &= ~WPS_AUTH_WPA;
|
||||
auth_types &= ~WPS_AUTH_WPA2;
|
||||
#ifdef CONFIG_WPS2
|
||||
auth_types &= ~WPS_AUTH_SHARED;
|
||||
#endif /* CONFIG_WPS2 */
|
||||
wpa_printf(MSG_DEBUG, "WPS: * Authentication Type Flags");
|
||||
wpabuf_put_be16(msg, ATTR_AUTH_TYPE_FLAGS);
|
||||
wpabuf_put_be16(msg, 2);
|
||||
|
@ -313,9 +309,7 @@ int wps_build_auth_type_flags(struct wps_data *wps, struct wpabuf *msg)
|
|||
int wps_build_encr_type_flags(struct wps_data *wps, struct wpabuf *msg)
|
||||
{
|
||||
u16 encr_types = WPS_ENCR_TYPES;
|
||||
#ifdef CONFIG_WPS2
|
||||
encr_types &= ~WPS_ENCR_WEP;
|
||||
#endif /* CONFIG_WPS2 */
|
||||
wpa_printf(MSG_DEBUG, "WPS: * Encryption Type Flags");
|
||||
wpabuf_put_be16(msg, ATTR_ENCR_TYPE_FLAGS);
|
||||
wpabuf_put_be16(msg, 2);
|
||||
|
|
|
@ -531,9 +531,7 @@ u16 wps_config_methods_str2bin(const char *str)
|
|||
if (str == NULL) {
|
||||
/* Default to enabling methods based on build configuration */
|
||||
methods |= WPS_CONFIG_DISPLAY | WPS_CONFIG_KEYPAD;
|
||||
#ifdef CONFIG_WPS2
|
||||
methods |= WPS_CONFIG_VIRT_DISPLAY;
|
||||
#endif /* CONFIG_WPS2 */
|
||||
#ifdef CONFIG_WPS_NFC
|
||||
methods |= WPS_CONFIG_NFC_INTERFACE;
|
||||
#endif /* CONFIG_WPS_NFC */
|
||||
|
@ -554,7 +552,6 @@ u16 wps_config_methods_str2bin(const char *str)
|
|||
methods |= WPS_CONFIG_PUSHBUTTON;
|
||||
if (os_strstr(str, "keypad"))
|
||||
methods |= WPS_CONFIG_KEYPAD;
|
||||
#ifdef CONFIG_WPS2
|
||||
if (os_strstr(str, "virtual_display"))
|
||||
methods |= WPS_CONFIG_VIRT_DISPLAY;
|
||||
if (os_strstr(str, "physical_display"))
|
||||
|
@ -563,7 +560,6 @@ u16 wps_config_methods_str2bin(const char *str)
|
|||
methods |= WPS_CONFIG_VIRT_PUSHBUTTON;
|
||||
if (os_strstr(str, "physical_push_button"))
|
||||
methods |= WPS_CONFIG_PHY_PUSHBUTTON;
|
||||
#endif /* CONFIG_WPS2 */
|
||||
}
|
||||
|
||||
return methods;
|
||||
|
|
|
@ -18,11 +18,7 @@ extern int wps_corrupt_pkhash;
|
|||
|
||||
#else /* CONFIG_WPS_TESTING */
|
||||
|
||||
#ifdef CONFIG_WPS2
|
||||
#define WPS_VERSION 0x20
|
||||
#else /* CONFIG_WPS2 */
|
||||
#define WPS_VERSION 0x10
|
||||
#endif /* CONFIG_WPS2 */
|
||||
|
||||
#endif /* CONFIG_WPS_TESTING */
|
||||
|
||||
|
@ -246,12 +242,10 @@ enum wps_error_indication {
|
|||
#define WPS_CONFIG_NFC_INTERFACE 0x0040
|
||||
#define WPS_CONFIG_PUSHBUTTON 0x0080
|
||||
#define WPS_CONFIG_KEYPAD 0x0100
|
||||
#ifdef CONFIG_WPS2
|
||||
#define WPS_CONFIG_VIRT_PUSHBUTTON 0x0280
|
||||
#define WPS_CONFIG_PHY_PUSHBUTTON 0x0480
|
||||
#define WPS_CONFIG_VIRT_DISPLAY 0x2008
|
||||
#define WPS_CONFIG_PHY_DISPLAY 0x4008
|
||||
#endif /* CONFIG_WPS2 */
|
||||
|
||||
/* Connection Type Flags */
|
||||
#define WPS_CONN_ESS 0x01
|
||||
|
|
|
@ -130,10 +130,8 @@ static struct wpabuf * wps_build_m1(struct wps_data *wps)
|
|||
* workaround.
|
||||
*/
|
||||
config_methods &= ~WPS_CONFIG_PUSHBUTTON;
|
||||
#ifdef CONFIG_WPS2
|
||||
config_methods &= ~(WPS_CONFIG_VIRT_PUSHBUTTON |
|
||||
WPS_CONFIG_PHY_PUSHBUTTON);
|
||||
#endif /* CONFIG_WPS2 */
|
||||
}
|
||||
|
||||
if (wps_build_version(msg) ||
|
||||
|
@ -698,7 +696,6 @@ static int wps_process_cred_e(struct wps_data *wps, const u8 *cred,
|
|||
#endif /* CONFIG_WPS_STRICT */
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WPS2
|
||||
if (!(wps->cred.encr_type &
|
||||
(WPS_ENCR_NONE | WPS_ENCR_TKIP | WPS_ENCR_AES))) {
|
||||
if (wps->cred.encr_type & WPS_ENCR_WEP) {
|
||||
|
@ -712,7 +709,6 @@ static int wps_process_cred_e(struct wps_data *wps, const u8 *cred,
|
|||
"invalid encr_type 0x%x", wps->cred.encr_type);
|
||||
return -1;
|
||||
}
|
||||
#endif /* CONFIG_WPS2 */
|
||||
|
||||
if (wps->wps->cred_cb) {
|
||||
wps->cred.cred_attr = cred - 4;
|
||||
|
@ -799,7 +795,6 @@ static int wps_process_ap_settings_e(struct wps_data *wps,
|
|||
#endif /* CONFIG_WPS_STRICT */
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WPS2
|
||||
if (!(cred.encr_type & (WPS_ENCR_NONE | WPS_ENCR_TKIP | WPS_ENCR_AES)))
|
||||
{
|
||||
if (cred.encr_type & WPS_ENCR_WEP) {
|
||||
|
@ -813,7 +808,6 @@ static int wps_process_ap_settings_e(struct wps_data *wps,
|
|||
"invalid encr_type 0x%x", cred.encr_type);
|
||||
return -1;
|
||||
}
|
||||
#endif /* CONFIG_WPS2 */
|
||||
|
||||
#ifdef CONFIG_WPS_STRICT
|
||||
if (wps2) {
|
||||
|
@ -830,7 +824,6 @@ static int wps_process_ap_settings_e(struct wps_data *wps,
|
|||
}
|
||||
#endif /* CONFIG_WPS_STRICT */
|
||||
|
||||
#ifdef CONFIG_WPS2
|
||||
if ((cred.encr_type & (WPS_ENCR_TKIP | WPS_ENCR_AES)) == WPS_ENCR_TKIP)
|
||||
{
|
||||
wpa_printf(MSG_DEBUG, "WPS: Upgrade encr_type TKIP -> "
|
||||
|
@ -844,7 +837,6 @@ static int wps_process_ap_settings_e(struct wps_data *wps,
|
|||
"WPAPSK+WPA2PSK");
|
||||
cred.auth_type |= WPS_AUTH_WPA2PSK;
|
||||
}
|
||||
#endif /* CONFIG_WPS2 */
|
||||
|
||||
if (wps->wps->cred_cb) {
|
||||
cred.cred_attr = wpabuf_head(attrs);
|
||||
|
|
|
@ -1490,11 +1490,9 @@ static int wps_er_build_sel_reg_config_methods(struct wpabuf *msg,
|
|||
|
||||
static int wps_er_build_uuid_r(struct wpabuf *msg, const u8 *uuid_r)
|
||||
{
|
||||
#ifdef CONFIG_WPS2
|
||||
wpabuf_put_be16(msg, ATTR_UUID_R);
|
||||
wpabuf_put_be16(msg, WPS_UUID_LEN);
|
||||
wpabuf_put_data(msg, uuid_r, WPS_UUID_LEN);
|
||||
#endif /* CONFIG_WPS2 */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1506,9 +1504,7 @@ void wps_er_set_sel_reg(struct wps_er *er, int sel_reg, u16 dev_passwd_id,
|
|||
struct wps_er_ap *ap;
|
||||
struct wps_registrar *reg = er->wps->registrar;
|
||||
const u8 *auth_macs;
|
||||
#ifdef CONFIG_WPS2
|
||||
u8 bcast[ETH_ALEN];
|
||||
#endif /* CONFIG_WPS2 */
|
||||
size_t count;
|
||||
union wps_event_data data;
|
||||
|
||||
|
@ -1522,13 +1518,11 @@ void wps_er_set_sel_reg(struct wps_er *er, int sel_reg, u16 dev_passwd_id,
|
|||
return;
|
||||
|
||||
auth_macs = wps_authorized_macs(reg, &count);
|
||||
#ifdef CONFIG_WPS2
|
||||
if (count == 0) {
|
||||
os_memset(bcast, 0xff, ETH_ALEN);
|
||||
auth_macs = bcast;
|
||||
count = 1;
|
||||
}
|
||||
#endif /* CONFIG_WPS2 */
|
||||
|
||||
if (wps_build_version(msg) ||
|
||||
wps_er_build_selected_registrar(msg, sel_reg) ||
|
||||
|
|
|
@ -538,7 +538,6 @@ static int wps_build_sel_pbc_reg_uuid_e(struct wps_registrar *reg,
|
|||
static void wps_set_pushbutton(u16 *methods, u16 conf_methods)
|
||||
{
|
||||
*methods |= WPS_CONFIG_PUSHBUTTON;
|
||||
#ifdef CONFIG_WPS2
|
||||
if ((conf_methods & WPS_CONFIG_VIRT_PUSHBUTTON) ==
|
||||
WPS_CONFIG_VIRT_PUSHBUTTON)
|
||||
*methods |= WPS_CONFIG_VIRT_PUSHBUTTON;
|
||||
|
@ -556,7 +555,6 @@ static void wps_set_pushbutton(u16 *methods, u16 conf_methods)
|
|||
*/
|
||||
*methods |= WPS_CONFIG_PHY_PUSHBUTTON;
|
||||
}
|
||||
#endif /* CONFIG_WPS2 */
|
||||
}
|
||||
|
||||
|
||||
|
@ -568,10 +566,8 @@ static int wps_build_sel_reg_config_methods(struct wps_registrar *reg,
|
|||
return 0;
|
||||
methods = reg->wps->config_methods;
|
||||
methods &= ~WPS_CONFIG_PUSHBUTTON;
|
||||
#ifdef CONFIG_WPS2
|
||||
methods &= ~(WPS_CONFIG_VIRT_PUSHBUTTON |
|
||||
WPS_CONFIG_PHY_PUSHBUTTON);
|
||||
#endif /* CONFIG_WPS2 */
|
||||
if (reg->pbc)
|
||||
wps_set_pushbutton(&methods, reg->wps->config_methods);
|
||||
if (reg->sel_reg_config_methods_override >= 0)
|
||||
|
@ -594,10 +590,8 @@ static int wps_build_probe_config_methods(struct wps_registrar *reg,
|
|||
* external Registrars.
|
||||
*/
|
||||
methods = reg->wps->config_methods & ~WPS_CONFIG_PUSHBUTTON;
|
||||
#ifdef CONFIG_WPS2
|
||||
methods &= ~(WPS_CONFIG_VIRT_PUSHBUTTON |
|
||||
WPS_CONFIG_PHY_PUSHBUTTON);
|
||||
#endif /* CONFIG_WPS2 */
|
||||
wpa_printf(MSG_DEBUG, "WPS: * Config Methods (%x)", methods);
|
||||
wpabuf_put_be16(msg, ATTR_CONFIG_METHODS);
|
||||
wpabuf_put_be16(msg, 2);
|
||||
|
@ -617,13 +611,11 @@ const u8 * wps_authorized_macs(struct wps_registrar *reg, size_t *count)
|
|||
{
|
||||
*count = 0;
|
||||
|
||||
#ifdef CONFIG_WPS2
|
||||
while (*count < WPS_MAX_AUTHORIZED_MACS) {
|
||||
if (is_zero_ether_addr(reg->authorized_macs_union[*count]))
|
||||
break;
|
||||
(*count)++;
|
||||
}
|
||||
#endif /* CONFIG_WPS2 */
|
||||
|
||||
return (const u8 *) reg->authorized_macs_union;
|
||||
}
|
||||
|
@ -1217,10 +1209,8 @@ static void wps_cb_set_sel_reg(struct wps_registrar *reg)
|
|||
|
||||
if (reg->selected_registrar) {
|
||||
methods = reg->wps->config_methods & ~WPS_CONFIG_PUSHBUTTON;
|
||||
#ifdef CONFIG_WPS2
|
||||
methods &= ~(WPS_CONFIG_VIRT_PUSHBUTTON |
|
||||
WPS_CONFIG_PHY_PUSHBUTTON);
|
||||
#endif /* CONFIG_WPS2 */
|
||||
if (reg->pbc)
|
||||
wps_set_pushbutton(&methods, reg->wps->config_methods);
|
||||
}
|
||||
|
@ -3446,10 +3436,8 @@ void wps_registrar_selected_registrar_changed(struct wps_registrar *reg,
|
|||
u16 methods;
|
||||
|
||||
methods = reg->wps->config_methods & ~WPS_CONFIG_PUSHBUTTON;
|
||||
#ifdef CONFIG_WPS2
|
||||
methods &= ~(WPS_CONFIG_VIRT_PUSHBUTTON |
|
||||
WPS_CONFIG_PHY_PUSHBUTTON);
|
||||
#endif /* CONFIG_WPS2 */
|
||||
if (reg->pbc) {
|
||||
reg->sel_reg_dev_password_id_override =
|
||||
DEV_PW_PUSHBUTTON;
|
||||
|
@ -3510,7 +3498,6 @@ int wps_registrar_get_info(struct wps_registrar *reg, const u8 *addr,
|
|||
int wps_registrar_config_ap(struct wps_registrar *reg,
|
||||
struct wps_credential *cred)
|
||||
{
|
||||
#ifdef CONFIG_WPS2
|
||||
wpa_printf(MSG_DEBUG, "WPS: encr_type=0x%x", cred->encr_type);
|
||||
if (!(cred->encr_type & (WPS_ENCR_NONE | WPS_ENCR_TKIP |
|
||||
WPS_ENCR_AES))) {
|
||||
|
@ -3538,7 +3525,6 @@ int wps_registrar_config_ap(struct wps_registrar *reg,
|
|||
"WPAPSK+WPA2PSK");
|
||||
cred->auth_type |= WPS_AUTH_WPA2PSK;
|
||||
}
|
||||
#endif /* CONFIG_WPS2 */
|
||||
|
||||
if (reg->wps->cred_cb)
|
||||
return reg->wps->cred_cb(reg->wps->cb_ctx, cred);
|
||||
|
|
|
@ -61,11 +61,9 @@ int upnp_er_set_selected_registrar(struct wps_registrar *reg,
|
|||
os_memcpy(s->authorized_macs, attr.authorized_macs,
|
||||
count * ETH_ALEN);
|
||||
} else if (!attr.version2) {
|
||||
#ifdef CONFIG_WPS2
|
||||
wpa_printf(MSG_DEBUG, "WPS: Add broadcast "
|
||||
"AuthorizedMACs for WPS 1.0 ER");
|
||||
os_memset(s->authorized_macs, 0xff, ETH_ALEN);
|
||||
#endif /* CONFIG_WPS2 */
|
||||
}
|
||||
eloop_register_timeout(WPS_PBC_WALK_TIME, 0,
|
||||
upnp_er_set_selected_timeout, s, reg);
|
||||
|
|
|
@ -617,10 +617,6 @@ NEED_SHA256=y
|
|||
endif
|
||||
|
||||
ifdef CONFIG_WPS
|
||||
ifdef CONFIG_WPS2
|
||||
L_CFLAGS += -DCONFIG_WPS2
|
||||
endif
|
||||
|
||||
# EAP-WSC
|
||||
L_CFLAGS += -DCONFIG_WPS -DEAP_WSC
|
||||
OBJS += wps_supplicant.c
|
||||
|
|
|
@ -622,10 +622,6 @@ NEED_SHA256=y
|
|||
endif
|
||||
|
||||
ifdef CONFIG_WPS
|
||||
ifdef CONFIG_WPS2
|
||||
CFLAGS += -DCONFIG_WPS2
|
||||
endif
|
||||
|
||||
# EAP-WSC
|
||||
CFLAGS += -DCONFIG_WPS -DEAP_WSC
|
||||
OBJS += wps_supplicant.o
|
||||
|
|
|
@ -60,7 +60,6 @@ driver interface:
|
|||
|
||||
CONFIG_DRIVER_NL80211=y
|
||||
CONFIG_WPS=y
|
||||
CONFIG_WPS2=y
|
||||
|
||||
If you want to enable WPS external registrar (ER) functionality, you
|
||||
will also need to add following line:
|
||||
|
|
|
@ -141,8 +141,6 @@ CONFIG_EAP_AKA_PRIME=y
|
|||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
CONFIG_WPS=y
|
||||
# Enable WSC 2.0 support
|
||||
CONFIG_WPS2=y
|
||||
# Enable WPS external registrar functionality
|
||||
CONFIG_WPS_ER=y
|
||||
# Disable credentials for an open network by default when acting as a WPS
|
||||
|
|
|
@ -311,12 +311,10 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
|
|||
if (bss->ssid.security_policy != SECURITY_WPA_PSK &&
|
||||
bss->ssid.security_policy != SECURITY_PLAINTEXT)
|
||||
goto no_wps;
|
||||
#ifdef CONFIG_WPS2
|
||||
if (bss->ssid.security_policy == SECURITY_WPA_PSK &&
|
||||
(!(bss->rsn_pairwise & WPA_CIPHER_CCMP) || !(bss->wpa & 2)))
|
||||
goto no_wps; /* WPS2 does not allow WPA/TKIP-only
|
||||
* configuration */
|
||||
#endif /* CONFIG_WPS2 */
|
||||
bss->eap_server = 1;
|
||||
|
||||
if (!ssid->ignore_broadcast_ssid)
|
||||
|
|
|
@ -2163,10 +2163,8 @@ static char * wpa_supplicant_wps_ie_txt_buf(struct wpa_supplicant *wpa_s,
|
|||
return pos;
|
||||
if (wps_is_selected_pbc_registrar(wps_ie))
|
||||
txt = "[WPS-PBC]";
|
||||
#ifdef CONFIG_WPS2
|
||||
else if (wps_is_addr_authorized(wps_ie, wpa_s->own_addr, 0))
|
||||
txt = "[WPS-AUTH]";
|
||||
#endif /* CONFIG_WPS2 */
|
||||
else if (wps_is_selected_pin_registrar(wps_ie))
|
||||
txt = "[WPS-PIN]";
|
||||
else
|
||||
|
|
|
@ -152,8 +152,6 @@ CONFIG_EAP_LEAP=y
|
|||
|
||||
# Wi-Fi Protected Setup (WPS)
|
||||
#CONFIG_WPS=y
|
||||
# Enable WSC 2.0 support
|
||||
#CONFIG_WPS2=y
|
||||
# Enable WPS external registrar functionality
|
||||
#CONFIG_WPS_ER=y
|
||||
# Disable credentials for an open network by default when acting as a WPS
|
||||
|
|
|
@ -1301,7 +1301,6 @@ static void wpas_wps_set_sel_reg_cb(void *ctx, int sel_reg, u16 dev_passwd_id,
|
|||
|
||||
static u16 wps_fix_config_methods(u16 config_methods)
|
||||
{
|
||||
#ifdef CONFIG_WPS2
|
||||
if ((config_methods &
|
||||
(WPS_CONFIG_DISPLAY | WPS_CONFIG_VIRT_DISPLAY |
|
||||
WPS_CONFIG_PHY_DISPLAY)) == WPS_CONFIG_DISPLAY) {
|
||||
|
@ -1316,7 +1315,6 @@ static u16 wps_fix_config_methods(u16 config_methods)
|
|||
"virtual_push_button for WPS 2.0 compliance");
|
||||
config_methods |= WPS_CONFIG_VIRT_PUSHBUTTON;
|
||||
}
|
||||
#endif /* CONFIG_WPS2 */
|
||||
|
||||
return config_methods;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue