* new credentials. This can be left %NULL if no WPS functionality is
* enabled.
*/
- int (*wps_cred)(void *ctx, struct wps_credential *cred);
+ int (*wps_cred)(void *ctx, const struct wps_credential *cred);
/**
* eap_param_needed - Notify that EAP parameter is needed
static int eap_wsc_new_psk_cb(void *ctx, const u8 *mac_addr, const u8 *psk,
size_t psk_len)
{
- /* struct eap_wsc_data *data = ctx; */
-
wpa_printf(MSG_DEBUG, "EAP-WSC: Received new WPA/WPA2-PSK from WPS for"
" STA " MACSTR, MAC2STR(mac_addr));
wpa_hexdump_key(MSG_DEBUG, "Per-device PSK", psk, psk_len);
static void eap_wsc_pin_needed_cb(void *ctx, const u8 *uuid_e,
const struct wps_device_data *dev)
{
- /* struct eap_wsc_data *data = ctx; */
char uuid[40], txt[400];
int len;
if (uuid_bin2str(uuid_e, uuid, sizeof(uuid)))
}
data->wps_ctx = wps;
- wps->cb_ctx = data;
+ wps->cb_ctx = sm->eapol_ctx;
+ wps->cred_cb = sm->eapol_cb->wps_cred;
/* TODO: store wps_context at higher layer and make the device data
* configurable */
os_memcpy(wps->uuid, sm->uuid, UUID_LEN);
else
cfg.uuid = sm->uuid;
- cfg.wps_cred_cb = sm->eapol_cb->wps_cred;
- cfg.cb_ctx = sm->eapol_ctx;
data->wps = wps_init(&cfg);
if (data->wps == NULL) {
os_free(data);
#ifdef CONFIG_WPS
-static int eapol_sm_wps_cred(void *ctx, struct wps_credential *cred)
+static int eapol_sm_wps_cred(void *ctx, const struct wps_credential *cred)
{
struct eapol_sm *sm = ctx;
wpa_printf(MSG_DEBUG, "EAPOL: received new WPS credential");
* new credentials. This can be left %NULL if no WPS functionality is
* enabled.
*/
- int (*wps_cred)(void *ctx, struct wps_credential *cred);
+ int (*wps_cred)(void *ctx, const struct wps_credential *cred);
/**
* eap_param_needed - Notify that EAP parameter is needed
data->dev_password_len = 8;
}
- data->wps_cred_cb = cfg->wps_cred_cb;
- data->cb_ctx = cfg->cb_ctx;
-
data->state = data->registrar ? RECV_M1 : SEND_M1;
return data;
size_t pin_len;
const u8 *uuid; /* 128-bit Enrollee UUID (NULL for Registrar) */
int pbc;
-
- int (*wps_cred_cb)(void *ctx, struct wps_credential *cred);
- void *cb_ctx;
};
struct wps_data * wps_init(const struct wps_config *cfg);
wps_process_cred(&attr, &wps->cred))
return -1;
- if (wps->wps_cred_cb)
- wps->wps_cred_cb(wps->cb_ctx, &wps->cred);
+ if (wps->wps->cred_cb)
+ wps->wps->cred_cb(wps->wps->cb_ctx, &wps->cred);
return 0;
}
int wps_pin_revealed;
struct wps_credential cred;
- int (*wps_cred_cb)(void *ctx, struct wps_credential *cred);
- void *cb_ctx;
-
struct wps_device_data peer_dev;
};
if (!wps->wps->ap) {
wpa_printf(MSG_DEBUG, "WPS: Update local configuration based "
"on the modified AP configuration");
- if (wps->wps_cred_cb)
- wps->wps_cred_cb(wps->cb_ctx, &wps->cred);
+ if (wps->wps->cred_cb)
+ wps->wps->cred_cb(wps->wps->cb_ctx, &wps->cred);
}
if (wps->new_psk) {
}
-static int wpa_supplicant_wps_cred(void *ctx, struct wps_credential *cred)
+static int wpa_supplicant_wps_cred(void *ctx,
+ const struct wps_credential *cred)
{
struct wpa_supplicant *wpa_s = ctx;
struct wpa_ssid *ssid = wpa_s->current_ssid;