* EAP peer state machine functions (RFC 4137)
* Copyright (c) 2004-2007, Jouni Malinen <j@w1.fi>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
*/
#ifndef EAP_H
#define EAP_H
-#include "defs.h"
+#include "common/defs.h"
#include "eap_common/eap_defs.h"
#include "eap_peer/eap_methods.h"
struct eap_sm;
struct wpa_config_blob;
struct wpabuf;
-struct wps_credential;
struct eap_method_type {
int vendor;
void (*notify_pending)(void *ctx);
/**
- * wps_cred - Notify that new credential was received from WPS
+ * eap_param_needed - Notify that EAP parameter is needed
* @ctx: eapol_ctx from eap_peer_sm_init() call
- * Returns: 0 on success (credential stored), -1 on failure
- *
- * This callback is only needed when using WPS Enrollee to configure
- * new credentials. This can be left %NULL if no WPS functionality is
- * enabled.
+ * @field: Field indicator (e.g., WPA_CTRL_REQ_EAP_IDENTITY)
+ * @txt: User readable text describing the required parameter
*/
- int (*wps_cred)(void *ctx, struct wps_credential *cred);
+ void (*eap_param_needed)(void *ctx, enum wpa_ctrl_req_type field,
+ const char *txt);
/**
- * eap_param_needed - Notify that EAP parameter is needed
+ * notify_cert - Notification of a peer certificate
* @ctx: eapol_ctx from eap_peer_sm_init() call
- * @field: Field name (e.g., "IDENTITY")
- * @txt: User readable text describing the required parameter
+ * @depth: Depth in certificate chain (0 = server)
+ * @subject: Subject of the peer certificate
+ * @cert_hash: SHA-256 hash of the certificate
+ * @cert: Peer certificate
*/
- void (*eap_param_needed)(void *ctx, const char *field,
- const char *txt);
+ void (*notify_cert)(void *ctx, int depth, const char *subject,
+ const char *cert_hash, const struct wpabuf *cert);
+
+ /**
+ * notify_status - Notification of the current EAP state
+ * @ctx: eapol_ctx from eap_peer_sm_init() call
+ * @status: Step in the process of EAP authentication
+ * @parameter: Step-specific parameter, e.g., EAP method name
+ */
+ void (*notify_status)(void *ctx, const char *status,
+ const char *parameter);
};
/**
*/
const char *pkcs11_module_path;
/**
- * mac_addr - MAC address of the peer
+ * wps - WPS context data
*
* This is only used by EAP-WSC and can be left %NULL if not available.
*/
- const u8 *mac_addr;
+ struct wps_context *wps;
+
+ /**
+ * cert_in_cb - Include server certificates in callback
+ */
+ int cert_in_cb;
};
struct eap_sm * eap_peer_sm_init(void *eapol_ctx,
void eap_sm_abort(struct eap_sm *sm);
int eap_sm_get_status(struct eap_sm *sm, char *buf, size_t buflen,
int verbose);
+const char * eap_sm_get_method_name(struct eap_sm *sm);
struct wpabuf * eap_sm_buildIdentity(struct eap_sm *sm, int id, int encrypted);
void eap_sm_request_identity(struct eap_sm *sm);
void eap_sm_request_password(struct eap_sm *sm);