Patchwork Provide TLS alerts to CLI/UI

login
register
mail settings
Submitter Chris Hessing
Date April 2, 2013, 7:25 p.m.
Message ID <515B308C.8020204@cloudpath.net>
Download mbox | patch
Permalink /patch/233141/
State Accepted
Commit c7a39ba4e17e2ce6e4710acf2e1aa029bb4cf2ca
Headers show

Comments

Chris Hessing - April 2, 2013, 7:25 p.m.
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@cloudpath.net>

  }


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.
>
Jouni Malinen - April 23, 2013, 1:47 p.m.
On Tue, Apr 02, 2013 at 01:25:00PM -0600, Chris Hessing wrote:
> Here is a modified version of my patch updated per Jouni's comments
> and harmonized with the existing DBUS implementation.

Thanks, applied.

Patch

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);