wps_context::ap is available for this purpose and there is no need to
change between AP and not AP between protocol runs.
}
os_memset(&cfg, 0, sizeof(cfg));
}
os_memset(&cfg, 0, sizeof(cfg));
cfg.wps = wps;
cfg.registrar = registrar ? data->wps_ctx->registrar : NULL;
cfg.wps = wps;
cfg.registrar = registrar ? data->wps_ctx->registrar : NULL;
data->registrar = registrar;
os_memset(&cfg, 0, sizeof(cfg));
data->registrar = registrar;
os_memset(&cfg, 0, sizeof(cfg));
cfg.wps = sm->wps;
if (registrar) {
if (sm->wps == NULL || sm->wps->registrar == NULL) {
cfg.wps = sm->wps;
if (registrar) {
if (sm->wps == NULL || sm->wps->registrar == NULL) {
struct wps_data *data = os_zalloc(sizeof(*data));
if (data == NULL)
return NULL;
struct wps_data *data = os_zalloc(sizeof(*data));
if (data == NULL)
return NULL;
- data->authenticator = cfg->authenticator;
data->wps = cfg->wps;
data->registrar = cfg->registrar;
if (cfg->registrar) {
data->wps = cfg->wps;
data->registrar = cfg->registrar;
if (cfg->registrar) {
*/
struct wps_config {
/**
*/
struct wps_config {
/**
- * authenticator - Whether the local end is Authenticator
- * 1 = Authenticator, 0 = Supplicant
- */
- int authenticator;
-
- /**
* wps - Pointer to long term WPS context
*/
struct wps_context *wps;
* wps - Pointer to long term WPS context
*/
struct wps_context *wps;
wps_build_msg_type(msg, WPS_M7) ||
wps_build_registrar_nonce(wps, msg) ||
wps_build_e_snonce2(wps, plain) ||
wps_build_msg_type(msg, WPS_M7) ||
wps_build_registrar_nonce(wps, msg) ||
wps_build_e_snonce2(wps, plain) ||
(wps_build_cred_ssid(wps, plain) ||
wps_build_cred_mac_addr(wps, plain) ||
wps_build_cred_auth_type(wps, plain) ||
(wps_build_cred_ssid(wps, plain) ||
wps_build_cred_mac_addr(wps, plain) ||
wps_build_cred_auth_type(wps, plain) ||
- if (wps->authenticator)
wps->state = RECV_ACK;
else {
wps_success_event(wps->wps);
wps->state = RECV_ACK;
else {
wps_success_event(wps->wps);
*op_code = WSC_MSG;
break;
case RECEIVED_M2D:
*op_code = WSC_MSG;
break;
case RECEIVED_M2D:
- if (wps->authenticator) {
msg = wps_build_wsc_nack(wps);
*op_code = WSC_NACK;
break;
msg = wps_build_wsc_nack(wps);
*op_code = WSC_NACK;
break;
- if (wps->authenticator)
return 0;
if (num_cred == 0) {
return 0;
if (num_cred == 0) {
{
struct wps_credential cred;
{
struct wps_credential cred;
- if (!wps->authenticator)
return 0;
if (wps_process_ap_settings(attr, &cred) < 0)
return 0;
if (wps_process_ap_settings(attr, &cred) < 0)
- if (wps->authenticator && wps->wps->ap_setup_locked) {
+ if (wps->wps->ap && wps->wps->ap_setup_locked) {
wpa_printf(MSG_DEBUG, "WPS: AP Setup is locked - refuse "
"registration of a new Registrar");
wps->config_error = WPS_CFG_SETUP_LOCKED;
wpa_printf(MSG_DEBUG, "WPS: AP Setup is locked - refuse "
"registration of a new Registrar");
wps->config_error = WPS_CFG_SETUP_LOCKED;
- if (wps->state == RECV_ACK && wps->authenticator) {
+ if (wps->state == RECV_ACK && wps->wps->ap) {
wpa_printf(MSG_DEBUG, "WPS: External Registrar registration "
"completed successfully");
wps_success_event(wps->wps);
wpa_printf(MSG_DEBUG, "WPS: External Registrar registration "
"completed successfully");
wps_success_event(wps->wps);
- * authenticator - Whether the local end is Authenticator
- * 1 = Authenticator, 0 = Supplicant
- */
- int authenticator;
-
- /**
* wps - Pointer to long term WPS context
*/
struct wps_context *wps;
* wps - Pointer to long term WPS context
*/
struct wps_context *wps;
if (msg == NULL)
return NULL;
if (msg == NULL)
return NULL;
- if (wps->authenticator && wps->wps->ap_setup_locked)
+ if (wps->wps->ap && wps->wps->ap_setup_locked)
err = WPS_CFG_SETUP_LOCKED;
if (wps_build_version(msg) ||
err = WPS_CFG_SETUP_LOCKED;
if (wps_build_version(msg) ||