]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - src/eapol_supp/eapol_supp_sm.c
Added preliminary Wi-Fi Protected Setup (WPS) implementation
[thirdparty/hostap.git] / src / eapol_supp / eapol_supp_sm.c
index ea65d277fbdaeabfa393003124e538c8116a744d..9af1d6d295b120735fd5045a8071948753f3ab76 100644 (file)
@@ -1742,6 +1742,20 @@ static void eapol_sm_notify_pending(void *ctx)
 }
 
 
+#ifdef CONFIG_WPS
+static int eapol_sm_wps_cred(void *ctx, struct wps_credential *cred)
+{
+       struct eapol_sm *sm = ctx;
+       wpa_printf(MSG_DEBUG, "EAPOL: received new WPS credential");
+       if (sm->ctx->wps_cred)
+               return sm->ctx->wps_cred(sm->ctx->ctx, cred);
+       return 0;
+}
+#else /* CONFIG_WPS */
+#define eapol_sm_wps_cred NULL
+#endif /* CONFIG_WPS */
+
+
 #if defined(CONFIG_CTRL_IFACE) || !defined(CONFIG_NO_STDOUT_DEBUG)
 static void eapol_sm_eap_param_needed(void *ctx, const char *field,
                                      const char *txt)
@@ -1767,6 +1781,7 @@ static struct eapol_callbacks eapol_cb =
        eapol_sm_set_config_blob,
        eapol_sm_get_config_blob,
        eapol_sm_notify_pending,
+       eapol_sm_wps_cred,
        eapol_sm_eap_param_needed
 };
 
@@ -1804,6 +1819,7 @@ struct eapol_sm *eapol_sm_init(struct eapol_ctx *ctx)
        conf.pkcs11_engine_path = ctx->pkcs11_engine_path;
        conf.pkcs11_module_path = ctx->pkcs11_module_path;
 #endif /* EAP_TLS_OPENSSL */
+       conf.mac_addr = ctx->mac_addr;
 
        sm->eap = eap_peer_sm_init(sm, &eapol_cb, sm->ctx->msg_ctx, &conf);
        if (sm->eap == NULL) {