WPS: Moved mac_addr and uuid configuration into wps_context
There is no need to complicate EAPOL and EAP interfaces with WPS specific parameters now that wps_context is passed through.
This commit is contained in:
parent
116654ce24
commit
398cfbf6be
9 changed files with 4 additions and 41 deletions
|
@ -1178,10 +1178,6 @@ struct eap_sm * eap_peer_sm_init(void *eapol_ctx,
|
||||||
sm->eapol_cb = eapol_cb;
|
sm->eapol_cb = eapol_cb;
|
||||||
sm->msg_ctx = msg_ctx;
|
sm->msg_ctx = msg_ctx;
|
||||||
sm->ClientTimeout = 60;
|
sm->ClientTimeout = 60;
|
||||||
if (conf->mac_addr)
|
|
||||||
os_memcpy(sm->mac_addr, conf->mac_addr, ETH_ALEN);
|
|
||||||
if (conf->uuid)
|
|
||||||
os_memcpy(sm->uuid, conf->uuid, 16);
|
|
||||||
sm->wps = conf->wps;
|
sm->wps = conf->wps;
|
||||||
|
|
||||||
os_memset(&tlsconf, 0, sizeof(tlsconf));
|
os_memset(&tlsconf, 0, sizeof(tlsconf));
|
||||||
|
|
|
@ -245,18 +245,6 @@ struct eap_config {
|
||||||
* Usually, path to opensc-pkcs11.so.
|
* Usually, path to opensc-pkcs11.so.
|
||||||
*/
|
*/
|
||||||
const char *pkcs11_module_path;
|
const char *pkcs11_module_path;
|
||||||
/**
|
|
||||||
* mac_addr - MAC address of the peer
|
|
||||||
*
|
|
||||||
* This is only used by EAP-WSC and can be left %NULL if not available.
|
|
||||||
*/
|
|
||||||
const u8 *mac_addr;
|
|
||||||
/**
|
|
||||||
* uuid - Device UUID
|
|
||||||
*
|
|
||||||
* This is only used by EAP-WSC and can be left %NULL if not available.
|
|
||||||
*/
|
|
||||||
const u8 *uuid;
|
|
||||||
/**
|
/**
|
||||||
* wps - WPS context data
|
* wps - WPS context data
|
||||||
*
|
*
|
||||||
|
|
|
@ -333,8 +333,6 @@ struct eap_sm {
|
||||||
int num_rounds;
|
int num_rounds;
|
||||||
int force_disabled;
|
int force_disabled;
|
||||||
|
|
||||||
u8 mac_addr[ETH_ALEN];
|
|
||||||
u8 uuid[16];
|
|
||||||
struct wps_context *wps;
|
struct wps_context *wps;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,7 @@ static void * eap_wsc_init(struct eap_sm *sm)
|
||||||
cfg.authenticator = 0;
|
cfg.authenticator = 0;
|
||||||
cfg.wps = wps;
|
cfg.wps = wps;
|
||||||
cfg.registrar = registrar ? data->wps_ctx->registrar : NULL;
|
cfg.registrar = registrar ? data->wps_ctx->registrar : NULL;
|
||||||
cfg.enrollee_mac_addr = sm->mac_addr;
|
cfg.enrollee_mac_addr = registrar ? NULL : wps->dev.mac_addr;
|
||||||
|
|
||||||
phase1 = eap_get_config_phase1(sm);
|
phase1 = eap_get_config_phase1(sm);
|
||||||
if (phase1 == NULL) {
|
if (phase1 == NULL) {
|
||||||
|
@ -192,10 +192,7 @@ static void * eap_wsc_init(struct eap_sm *sm)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (registrar && wps)
|
cfg.uuid = registrar ? NULL : wps->uuid;
|
||||||
os_memcpy(wps->uuid, sm->uuid, UUID_LEN);
|
|
||||||
else
|
|
||||||
cfg.uuid = sm->uuid;
|
|
||||||
data->wps = wps_init(&cfg);
|
data->wps = wps_init(&cfg);
|
||||||
if (data->wps == NULL) {
|
if (data->wps == NULL) {
|
||||||
os_free(data);
|
os_free(data);
|
||||||
|
|
|
@ -1804,8 +1804,6 @@ struct eapol_sm *eapol_sm_init(struct eapol_ctx *ctx)
|
||||||
conf.pkcs11_engine_path = ctx->pkcs11_engine_path;
|
conf.pkcs11_engine_path = ctx->pkcs11_engine_path;
|
||||||
conf.pkcs11_module_path = ctx->pkcs11_module_path;
|
conf.pkcs11_module_path = ctx->pkcs11_module_path;
|
||||||
#endif /* EAP_TLS_OPENSSL */
|
#endif /* EAP_TLS_OPENSSL */
|
||||||
conf.mac_addr = ctx->mac_addr;
|
|
||||||
conf.uuid = ctx->uuid;
|
|
||||||
conf.wps = ctx->wps;
|
conf.wps = ctx->wps;
|
||||||
|
|
||||||
sm->eap = eap_peer_sm_init(sm, &eapol_cb, sm->ctx->msg_ctx, &conf);
|
sm->eap = eap_peer_sm_init(sm, &eapol_cb, sm->ctx->msg_ctx, &conf);
|
||||||
|
|
|
@ -199,19 +199,6 @@ struct eapol_ctx {
|
||||||
*/
|
*/
|
||||||
const char *pkcs11_module_path;
|
const char *pkcs11_module_path;
|
||||||
#endif /* EAP_TLS_OPENSSL */
|
#endif /* EAP_TLS_OPENSSL */
|
||||||
/**
|
|
||||||
* mac_addr - MAC address of the peer
|
|
||||||
*
|
|
||||||
* This is only used by EAP-WSC and can be left %NULL if not available.
|
|
||||||
*/
|
|
||||||
const u8 *mac_addr;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* uuid - Device UUID
|
|
||||||
*
|
|
||||||
* This is only used by EAP-WSC and can be left %NULL if not available.
|
|
||||||
*/
|
|
||||||
const u8 *uuid;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wps - WPS context data
|
* wps - WPS context data
|
||||||
|
|
|
@ -223,7 +223,6 @@ int rsn_preauth_init(struct wpa_sm *sm, const u8 *dst,
|
||||||
ctx->eapol_send_ctx = sm;
|
ctx->eapol_send_ctx = sm;
|
||||||
ctx->set_config_blob = sm->ctx->set_config_blob;
|
ctx->set_config_blob = sm->ctx->set_config_blob;
|
||||||
ctx->get_config_blob = sm->ctx->get_config_blob;
|
ctx->get_config_blob = sm->ctx->get_config_blob;
|
||||||
ctx->mac_addr = sm->own_addr;
|
|
||||||
|
|
||||||
sm->preauth_eapol = eapol_sm_init(ctx);
|
sm->preauth_eapol = eapol_sm_init(ctx);
|
||||||
if (sm->preauth_eapol == NULL) {
|
if (sm->preauth_eapol == NULL) {
|
||||||
|
|
|
@ -558,8 +558,6 @@ int wpa_supplicant_init_eapol(struct wpa_supplicant *wpa_s)
|
||||||
ctx->pkcs11_engine_path = wpa_s->conf->pkcs11_engine_path;
|
ctx->pkcs11_engine_path = wpa_s->conf->pkcs11_engine_path;
|
||||||
ctx->pkcs11_module_path = wpa_s->conf->pkcs11_module_path;
|
ctx->pkcs11_module_path = wpa_s->conf->pkcs11_module_path;
|
||||||
#endif /* EAP_TLS_OPENSSL */
|
#endif /* EAP_TLS_OPENSSL */
|
||||||
ctx->mac_addr = wpa_s->own_addr;
|
|
||||||
ctx->uuid = wpa_s->conf->uuid;
|
|
||||||
ctx->wps = wpa_s->wps;
|
ctx->wps = wpa_s->wps;
|
||||||
ctx->eap_param_needed = wpa_supplicant_eap_param_needed;
|
ctx->eap_param_needed = wpa_supplicant_eap_param_needed;
|
||||||
ctx->cb = wpa_supplicant_eapol_cb;
|
ctx->cb = wpa_supplicant_eapol_cb;
|
||||||
|
|
|
@ -197,6 +197,8 @@ int wpas_wps_init(struct wpa_supplicant *wpa_s)
|
||||||
wps->dev.categ = WPS_DEV_COMPUTER;
|
wps->dev.categ = WPS_DEV_COMPUTER;
|
||||||
wps->dev.oui = WPS_DEV_OUI_WFA;
|
wps->dev.oui = WPS_DEV_OUI_WFA;
|
||||||
wps->dev.sub_categ = WPS_DEV_COMPUTER_PC;
|
wps->dev.sub_categ = WPS_DEV_COMPUTER_PC;
|
||||||
|
os_memcpy(wps->dev.mac_addr, wpa_s->own_addr, ETH_ALEN);
|
||||||
|
os_memcpy(wps->uuid, wpa_s->conf->uuid, 16);
|
||||||
|
|
||||||
wpa_s->wps = wps;
|
wpa_s->wps = wps;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue