[PATCH] Provide TLS alerts to CLI/UI
Chris Hessing
chris.hessing
Tue Apr 2 12:25:00 PDT 2013
Here is a modified version of my patch updated per Jouni's comments and
harmonized with the existing DBUS implementation.
Signed-hostap: Chris Hessing <chris.hessing at cloudpath.net>
diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h
index ce1c3a6..c4e31f7 100644
--- a/src/common/wpa_ctrl.h
+++ b/src/common/wpa_ctrl.h
@@ -44,6 +44,8 @@ extern "C" {
#define WPA_EVENT_EAP_PEER_CERT "CTRL-EVENT-EAP-PEER-CERT "
/** EAP TLS certificate chain validation error */
#define WPA_EVENT_EAP_TLS_CERT_ERROR "CTRL-EVENT-EAP-TLS-CERT-ERROR "
+/** EAP status */
+#define WPA_EVENT_EAP_STATUS "CTRL-EVENT-EAP-STATUS "
/** EAP authentication completed successfully */
#define WPA_EVENT_EAP_SUCCESS "CTRL-EVENT-EAP-SUCCESS "
/** EAP authentication failed (EAP-Failure received) */
diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c
index 9251f62..ca6f7e7 100644
--- a/wpa_supplicant/notify.c
+++ b/wpa_supplicant/notify.c
@@ -627,4 +627,7 @@ void wpas_notify_eap_status(struct wpa_supplicant
*wpa_s, co
const char *parameter)
{
wpas_dbus_signal_eap_status(wpa_s, status, parameter);
+ wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_EAP_STATUS
+ "status='%s' parameter='%s'",
+ status, parameter);
}
On 3/30/2013 11:15 AM, Jouni Malinen wrote:
> On Wed, Mar 20, 2013 at 09:22:44AM -0600, Chris Hessing wrote:
>> diff --git a/src/eap_peer/eap.c b/src/eap_peer/eap.c
>> @@ -1332,12 +1332,21 @@ static void eap_peer_sm_tls_event(void *ctx,
>> enum tls_event ev,
>> hash_hex, data->peer_cert.cert);
>> break;
>> case TLS_ALERT:
>> - if (data->alert.is_local)
>> - eap_notify_status(sm, "local TLS alert",
>> - data->alert.description);
>> - else
>> - eap_notify_status(sm, "remote TLS alert",
>> + if (data->alert.is_local) {
>> + wpa_msg(sm->msg_ctx, MSG_INFO, WPA_EVENT_EAP_TLS_ALERT
>> + "type='local' alert='%s'",
>> + data->alert.description);
> That eap_notify_status() is already delivering this event to the core
> wpa_supplicant implementation and adding wpa_msg() there in
> wpas_notify_eap_status() would be more appropriate way of adding this
> event. That path is already used for providing this information through
> the D-Bus interface.
>
More information about the Hostap
mailing list