aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_server
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-01-14 03:38:41 (GMT)
committerJouni Malinen <j@w1.fi>2008-01-14 03:38:41 (GMT)
commitbf843af5cd4adabdecaab0f67e229fc6af794770 (patch)
treee1caf65187d6b8082097fe629fa35f93e8eb32a3 /src/eap_server
parent2e6a91c459ab1f3bb210d05eec2f141c1dbb4473 (diff)
downloadhostap-history-bf843af5cd4adabdecaab0f67e229fc6af794770.zip
hostap-history-bf843af5cd4adabdecaab0f67e229fc6af794770.tar.gz
hostap-history-bf843af5cd4adabdecaab0f67e229fc6af794770.tar.bz2
WPS: Move device-specific data from Registrar to generic WPS context
This adds a new struct wps_context for device-specific data that fits better for number of variables than struct wps_registrar. This allows AP configuration to be provided to Enrollee code so that M7 can be built with current AP configuration for external Registrar registration. In addition, Network Key is now hex encoded in wps_hostapd.c if needed to use correct fixed-PSK/passphrase setting. It should be noted that the option of using per-device PSK works only when the supplicant is acting as an Enrollee. If the supplicant is acting as a Registrar, generating a new per-device PSK would likely not work since the external Registrar could provision that PSK to other devices.
Diffstat (limited to 'src/eap_server')
-rw-r--r--src/eap_server/eap.c2
-rw-r--r--src/eap_server/eap.h2
-rw-r--r--src/eap_server/eap_i.h2
-rw-r--r--src/eap_server/eap_wsc.c5
4 files changed, 6 insertions, 5 deletions
diff --git a/src/eap_server/eap.c b/src/eap_server/eap.c
index 589ca9c..857dfcd 100644
--- a/src/eap_server/eap.c
+++ b/src/eap_server/eap.c
@@ -1154,7 +1154,7 @@ struct eap_sm * eap_server_sm_init(void *eapol_ctx,
if (conf->eap_fast_a_id)
sm->eap_fast_a_id = os_strdup(conf->eap_fast_a_id);
sm->eap_sim_aka_result_ind = conf->eap_sim_aka_result_ind;
- sm->wps_registrar = conf->wps_registrar;
+ sm->wps = conf->wps;
wpa_printf(MSG_DEBUG, "EAP: Server state machine created");
diff --git a/src/eap_server/eap.h b/src/eap_server/eap.h
index e06c597..b7ce505 100644
--- a/src/eap_server/eap.h
+++ b/src/eap_server/eap.h
@@ -97,7 +97,7 @@ struct eap_config {
u8 *pac_opaque_encr_key;
char *eap_fast_a_id;
int eap_sim_aka_result_ind;
- struct wps_registrar *wps_registrar;
+ struct wps_context *wps;
};
diff --git a/src/eap_server/eap_i.h b/src/eap_server/eap_i.h
index 38b0f3e..2be4d2b 100644
--- a/src/eap_server/eap_i.h
+++ b/src/eap_server/eap_i.h
@@ -172,7 +172,7 @@ struct eap_sm {
u8 *pac_opaque_encr_key;
char *eap_fast_a_id;
int eap_sim_aka_result_ind;
- struct wps_registrar *wps_registrar;
+ struct wps_context *wps;
};
int eap_user_get(struct eap_sm *sm, const u8 *identity, size_t identity_len,
diff --git a/src/eap_server/eap_wsc.c b/src/eap_server/eap_wsc.c
index c788ec6..b81b539 100644
--- a/src/eap_server/eap_wsc.c
+++ b/src/eap_server/eap_wsc.c
@@ -90,14 +90,15 @@ static void * eap_wsc_init(struct eap_sm *sm)
os_memset(&cfg, 0, sizeof(cfg));
cfg.authenticator = 1;
+ cfg.wps = sm->wps;
if (registrar) {
- if (sm->wps_registrar == NULL) {
+ if (sm->wps == NULL || sm->wps->registrar == NULL) {
wpa_printf(MSG_INFO, "EAP-WSC: WPS Registrar not "
"initialized");
os_free(data);
return NULL;
}
- cfg.registrar = sm->wps_registrar;
+ cfg.registrar = sm->wps->registrar;
} else {
if (sm->user == NULL || sm->user->password == NULL) {
wpa_printf(MSG_INFO, "EAP-WSC: No AP PIN (password) "