aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-11-28 18:02:32 (GMT)
committerJouni Malinen <j@w1.fi>2008-11-28 18:02:32 (GMT)
commitbcbbc7af45cc4b84a5c10e65f4283fdf68cd785a (patch)
tree7d110829491964ba3094be1adab76dfd1bfc8b93 /src/eap_peer
parentfa201b694f55194331d99877b6c64058c1ebd990 (diff)
downloadhostap-06-bcbbc7af45cc4b84a5c10e65f4283fdf68cd785a.zip
hostap-06-bcbbc7af45cc4b84a5c10e65f4283fdf68cd785a.tar.gz
hostap-06-bcbbc7af45cc4b84a5c10e65f4283fdf68cd785a.tar.bz2
WPS: Merged two cred_cb variables into the same one
Previously, wpa_supplicant as Enrollee case was handled using a different callback function pointer. However, now that the wps_context structure is allocated for all cases, the same variable can be used in all cases.
Diffstat (limited to 'src/eap_peer')
-rw-r--r--src/eap_peer/eap.h2
-rw-r--r--src/eap_peer/eap_wsc.c8
2 files changed, 3 insertions, 7 deletions
diff --git a/src/eap_peer/eap.h b/src/eap_peer/eap.h
index a23f88a..00a8f76 100644
--- a/src/eap_peer/eap.h
+++ b/src/eap_peer/eap.h
@@ -223,7 +223,7 @@ struct eapol_callbacks {
* 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
diff --git a/src/eap_peer/eap_wsc.c b/src/eap_peer/eap_wsc.c
index dd47e9c..13bd768 100644
--- a/src/eap_peer/eap_wsc.c
+++ b/src/eap_peer/eap_wsc.c
@@ -68,8 +68,6 @@ static void eap_wsc_state(struct eap_wsc_data *data, int state)
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);
@@ -83,7 +81,6 @@ static int eap_wsc_new_psk_cb(void *ctx, const u8 *mac_addr, const u8 *psk,
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)))
@@ -138,7 +135,8 @@ static void * eap_wsc_init(struct eap_sm *sm)
}
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 */
@@ -212,8 +210,6 @@ static void * eap_wsc_init(struct eap_sm *sm)
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);