aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-11-28 17:29:22 (GMT)
committerJouni Malinen <j@w1.fi>2008-11-28 17:29:22 (GMT)
commitff434cbddaeab089e483ca39dbd26d6ef1061632 (patch)
tree2e3e2189d3e5fa192267e9159f4646f97b57e03e /src/eap_peer
parent4b6a71fa31f94a34e0680bf3795cb8c1b380667d (diff)
downloadhostap-06-ff434cbddaeab089e483ca39dbd26d6ef1061632.zip
hostap-06-ff434cbddaeab089e483ca39dbd26d6ef1061632.tar.gz
hostap-06-ff434cbddaeab089e483ca39dbd26d6ef1061632.tar.bz2
WPS: Moved device attributes into wps_context::dev for Enrollee case
Previously, hardcoded values were used in wps_enrollee.c. These are now moved into shared data in struct wps_context. In case of AP/Authenticator, these are initialized in wps_hostapd.c. In case of client/supplicant, these are now initialized in EAP-WSC peer method, but will probably end up being moved into higher layer for better configuration. EAP-WSC peer method for
Diffstat (limited to 'src/eap_peer')
-rw-r--r--src/eap_peer/eap_wsc.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/eap_peer/eap_wsc.c b/src/eap_peer/eap_wsc.c
index f6e2400..dd47e9c 100644
--- a/src/eap_peer/eap_wsc.c
+++ b/src/eap_peer/eap_wsc.c
@@ -131,16 +131,28 @@ static void * eap_wsc_init(struct eap_sm *sm)
data->state = registrar ? MSG : WAIT_START;
data->registrar = registrar;
- if (registrar) {
- struct wps_registrar_config rcfg;
+ wps = os_zalloc(sizeof(*wps));
+ if (wps == NULL) {
+ os_free(data);
+ return NULL;
+ }
- wps = os_zalloc(sizeof(*wps));
- if (wps == NULL) {
- os_free(data);
- return NULL;
- }
+ data->wps_ctx = wps;
+ wps->cb_ctx = data;
+
+ /* TODO: store wps_context at higher layer and make the device data
+ * configurable */
+ wps->dev.device_name = "dev name";
+ wps->dev.manufacturer = "manuf";
+ wps->dev.model_name = "model name";
+ wps->dev.model_number = "model number";
+ wps->dev.serial_number = "12345";
+ wps->dev.categ = WPS_DEV_COMPUTER;
+ wps->dev.oui = WPS_DEV_OUI_WFA;
+ wps->dev.sub_categ = WPS_DEV_COMPUTER_PC;
- wps->cb_ctx = data;
+ if (registrar) {
+ struct wps_registrar_config rcfg;
wps->auth_types = WPS_AUTH_WPA2PSK | WPS_AUTH_WPAPSK;
wps->encr_types = WPS_ENCR_AES | WPS_ENCR_TKIP;
@@ -160,7 +172,6 @@ static void * eap_wsc_init(struct eap_sm *sm)
return NULL;
}
- data->wps_ctx = wps;
}
os_memset(&cfg, 0, sizeof(cfg));