diff -up NetworkManager-0.6.4/libnm-util/dbus-helpers.h.leap NetworkManager-0.6.4/libnm-util/dbus-helpers.h --- NetworkManager-0.6.4/libnm-util/dbus-helpers.h.leap 2006-03-22 14:52:06.000000000 -0500 +++ NetworkManager-0.6.4/libnm-util/dbus-helpers.h 2007-12-16 18:46:38.000000000 -0500 @@ -101,6 +101,21 @@ dbus_bool_t nmu_security_deserialize_wpa char **ca_cert_file, int *wpa_version); +dbus_bool_t nmu_security_serialize_leap (DBusMessageIter *iter, + const char *username, + const char *passwd, + const char *key_mgmt); + +dbus_bool_t nmu_security_serialize_leap_with_cipher (DBusMessageIter *iter, + const char *username, + const char *passwd, + const char *key_mgmt); + +dbus_bool_t nmu_security_deserialize_leap (DBusMessageIter *iter, + char **username, + char **passwd, + char **key_mgmt); + DBusMessage * nmu_create_dbus_error_message (DBusMessage *message, const char *exception_namespace, const char *exception, diff -up NetworkManager-0.6.4/libnm-util/dbus-helpers.c.leap NetworkManager-0.6.4/libnm-util/dbus-helpers.c --- NetworkManager-0.6.4/libnm-util/dbus-helpers.c.leap 2006-06-15 12:42:47.000000000 -0400 +++ NetworkManager-0.6.4/libnm-util/dbus-helpers.c 2007-12-16 18:46:38.000000000 -0500 @@ -475,6 +475,87 @@ nmu_security_deserialize_wpa_eap (DBusMe } +dbus_bool_t +nmu_security_serialize_leap (DBusMessageIter *iter, + const char *username, + const char *passwd, + const char *key_mgmt) +{ + const char *fake_username = ""; + const char *fake_passwd = ""; + + g_return_val_if_fail (iter != NULL, FALSE); + g_return_val_if_fail (key_mgmt != NULL, FALSE); + + /* Second arg: Username (STRING) */ + dbus_message_iter_append_basic (iter, DBUS_TYPE_STRING, username? &username : &fake_username); + + /* Third arg: Password (STRING) */ + dbus_message_iter_append_basic (iter, DBUS_TYPE_STRING, passwd? &passwd : &fake_passwd); + + /* Fourth arg: Key management (STRING) */ + dbus_message_iter_append_basic (iter, DBUS_TYPE_STRING, &key_mgmt); + + return TRUE; +} + +dbus_bool_t +nmu_security_serialize_leap_with_cipher (DBusMessageIter *iter, + const char *username, + const char *passwd, + const char *key_mgmt) +{ + g_return_val_if_fail (iter != NULL, FALSE); + + /* First arg: WE Cipher (INT32) */ + we_cipher_append_helper (iter, NM_AUTH_TYPE_LEAP); + + return nmu_security_serialize_leap (iter, username, passwd, key_mgmt); +} + +dbus_bool_t +nmu_security_deserialize_leap (DBusMessageIter *iter, + char **username, + char **passwd, + char **key_mgmt) +{ + char * dbus_username; + char * dbus_password; + char * dbus_key_mgmt; + + g_return_val_if_fail (iter != NULL, FALSE); + g_return_val_if_fail (username != NULL, FALSE); + g_return_val_if_fail (*username == NULL, FALSE); + g_return_val_if_fail (passwd != NULL, FALSE); + g_return_val_if_fail (*passwd == NULL, FALSE); + g_return_val_if_fail (key_mgmt != NULL, FALSE); + g_return_val_if_fail (*key_mgmt == NULL, FALSE); + + /* Second arg: Username (STRING) */ + g_return_val_if_fail (dbus_message_iter_get_arg_type (iter) == DBUS_TYPE_STRING, FALSE); + dbus_message_iter_get_basic (iter, &dbus_username); + g_return_val_if_fail (dbus_username != NULL, FALSE); + + /* Third arg: Password (STRING) */ + g_return_val_if_fail (dbus_message_iter_next (iter), FALSE); + g_return_val_if_fail (dbus_message_iter_get_arg_type (iter) == DBUS_TYPE_STRING, FALSE); + dbus_message_iter_get_basic (iter, &dbus_password); + g_return_val_if_fail (dbus_password != NULL, FALSE); + + /* Fourth arg: Password (STRING) */ + g_return_val_if_fail (dbus_message_iter_next (iter), FALSE); + g_return_val_if_fail (dbus_message_iter_get_arg_type (iter) == DBUS_TYPE_STRING, FALSE); + dbus_message_iter_get_basic (iter, &dbus_key_mgmt); + g_return_val_if_fail (dbus_key_mgmt != NULL, FALSE); + + *username = strlen (dbus_username) > 0 ? dbus_username : NULL; + *passwd = strlen (dbus_password) > 0 ? dbus_password : NULL; + *key_mgmt = strlen (dbus_key_mgmt) > 0 ? dbus_key_mgmt : NULL; + + return TRUE; +} + + /* * nmu_create_dbus_error_message * diff -up NetworkManager-0.6.4/po/POTFILES.in.leap NetworkManager-0.6.4/po/POTFILES.in --- NetworkManager-0.6.4/po/POTFILES.in.leap 2006-03-02 06:59:30.000000000 -0500 +++ NetworkManager-0.6.4/po/POTFILES.in 2007-12-16 18:46:38.000000000 -0500 @@ -27,3 +27,5 @@ src/nm-ap-security.c src/nm-netlink-monitor.c gnome/applet/applet-dbus-devices.c src/nm-ap-security-wpa-eap.c +src/nm-ap-security-leap.c + diff -up NetworkManager-0.6.4/src/Makefile.am.leap NetworkManager-0.6.4/src/Makefile.am --- NetworkManager-0.6.4/src/Makefile.am.leap 2006-05-24 11:07:39.000000000 -0400 +++ NetworkManager-0.6.4/src/Makefile.am 2007-12-16 18:46:38.000000000 -0500 @@ -62,6 +62,8 @@ NetworkManager_SOURCES = \ nm-ap-security-wpa-eap.h \ nm-ap-security-wpa-psk.c \ nm-ap-security-wpa-psk.h \ + nm-ap-security-leap.c \ + nm-ap-security-leap.h \ kernel-types.h \ wpa.c \ wpa.h \ diff -up /dev/null NetworkManager-0.6.4/src/nm-ap-security-leap.c --- /dev/null 2007-12-13 09:27:29.857440981 -0500 +++ NetworkManager-0.6.4/src/nm-ap-security-leap.c 2007-12-16 18:46:38.000000000 -0500 @@ -0,0 +1,225 @@ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * (C) Copyright 2006 Thiago Jung Bauermann <thiago.bauermann@gmail.com> + */ + +/* This file is heavily based on nm-ap-security-wpa-eap.c */ + +#include <glib.h> +#include <glib/gi18n.h> +#include <dbus/dbus.h> +#include <iwlib.h> + +#include "nm-ap-security.h" +#include "nm-ap-security-leap.h" +#include "nm-ap-security-private.h" +#include "dbus-helpers.h" +#include "nm-device-802-11-wireless.h" +#include "NetworkManagerUtils.h" + +#define NM_AP_SECURITY_LEAP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_AP_SECURITY_LEAP, NMAPSecurityLEAPPrivate)) + +struct _NMAPSecurityLEAPPrivate +{ + char * username; + char * key_mgmt; +}; + + +NMAPSecurityLEAP * +nm_ap_security_leap_new_deserialize (DBusMessageIter *iter) +{ + NMAPSecurityLEAP * security = NULL; + char * username = NULL; + char * password = NULL; + char * key_mgmt = NULL; + + g_return_val_if_fail (iter != NULL, NULL); + + if (!nmu_security_deserialize_leap (iter, &username, &password, &key_mgmt)) + goto out; + + /* Success, build up our security object */ + security = g_object_new (NM_TYPE_AP_SECURITY_LEAP, NULL); + nm_ap_security_set_we_cipher (NM_AP_SECURITY (security), NM_AUTH_TYPE_LEAP); + if (password) + nm_ap_security_set_key (NM_AP_SECURITY (security), password, strlen(password)); + if (username) + security->priv->username = g_strdup (username); + if (key_mgmt) + security->priv->key_mgmt = g_strdup (key_mgmt); + + nm_ap_security_set_description (NM_AP_SECURITY (security), _("LEAP")); + +out: + return security; +} + + +NMAPSecurityLEAP * +nm_ap_security_leap_new_from_ap (NMAccessPoint *ap) +{ + NMAPSecurityLEAP * security = NULL; + + g_return_val_if_fail (ap != NULL, NULL); + + security = g_object_new (NM_TYPE_AP_SECURITY_LEAP, NULL); + nm_ap_security_set_we_cipher (NM_AP_SECURITY (security), NM_AUTH_TYPE_LEAP); + nm_ap_security_set_description (NM_AP_SECURITY (security), _("LEAP")); + + return security; +} + + +static int +real_serialize (NMAPSecurity *instance, DBusMessageIter *iter) +{ + NMAPSecurityLEAP * self = NM_AP_SECURITY_LEAP (instance); + + if (!nmu_security_serialize_leap (iter, self->priv->username, + nm_ap_security_get_key(instance), self->priv->key_mgmt)) + return -1; + return 0; +} + +static gboolean +real_write_supplicant_config (NMAPSecurity *instance, + struct wpa_ctrl *ctrl, + int nwid, + gboolean user_created) +{ + NMAPSecurityLEAP * self = NM_AP_SECURITY_LEAP (instance); + gboolean success = FALSE; + char * msg; + const char * password = nm_ap_security_get_key(instance); + + g_return_val_if_fail (nm_ap_security_get_we_cipher (instance) == NM_AUTH_TYPE_LEAP, FALSE); + + if (!strcmp (self->priv->key_mgmt, "WPA-EAP")) { + if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL, "SET_NETWORK %i proto WPA", nwid)) + goto out; + } + + if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL, "SET_NETWORK %i key_mgmt %s", + nwid, self->priv->key_mgmt)) + goto out; + + if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL, "SET_NETWORK %i eap LEAP", nwid)) + goto out; + + if (self->priv->username && strlen (self->priv->username) > 0) + if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL, "SET_NETWORK %i identity \"%s\"", + nwid, self->priv->username)) + goto out; + + if (password && strlen (password) > 0) + { + msg = g_strdup_printf ("SET_NETWORK %i password <password>", nwid); + if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, msg, "SET_NETWORK %i password \"%s\"", + nwid, password)) + { + g_free (msg); + goto out; + } + g_free (msg); + } + + success = TRUE; + +out: + return success; +} + +static guint32 +real_get_default_capabilities (NMAPSecurity *instance) +{ + guint32 caps = NM_802_11_CAP_NONE; + + caps |= NM_802_11_CAP_KEY_MGMT_802_1X; + + return caps; +} + +static gboolean +real_get_authentication_required (NMAPSecurity *instance) +{ + return TRUE; +} + +static NMAPSecurity * +real_copy_constructor (NMAPSecurity *instance) +{ + NMAPSecurityLEAP * dst = g_object_new (NM_TYPE_AP_SECURITY_LEAP, NULL); + NMAPSecurityLEAP * self = NM_AP_SECURITY_LEAP (instance); + + dst->priv->username = self->priv->username; + dst->priv->key_mgmt = self->priv->key_mgmt; + + nm_ap_security_copy_properties (NM_AP_SECURITY (self), NM_AP_SECURITY (dst)); + + return NM_AP_SECURITY (dst); +} + + +static void +nm_ap_security_leap_init (NMAPSecurityLEAP * self) +{ + self->priv = NM_AP_SECURITY_LEAP_GET_PRIVATE (self); + self->priv->username = NULL; + self->priv->key_mgmt = NULL; +} + + +static void +nm_ap_security_leap_class_init (NMAPSecurityLEAPClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + NMAPSecurityClass *par_class = NM_AP_SECURITY_CLASS (klass); + + par_class->copy_constructor_func = real_copy_constructor; + par_class->serialize_func = real_serialize; + par_class->write_supplicant_config_func = real_write_supplicant_config; + par_class->get_default_capabilities_func = real_get_default_capabilities; + par_class->get_authentication_required_func = real_get_authentication_required; + + g_type_class_add_private (object_class, sizeof (NMAPSecurityLEAPPrivate)); +} + + +GType +nm_ap_security_leap_get_type (void) +{ + static GType type = 0; + if (type == 0) { + static const GTypeInfo info = { + sizeof (NMAPSecurityLEAPClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) nm_ap_security_leap_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (NMAPSecurityLEAP), + 0, /* n_preallocs */ + (GInstanceInitFunc) nm_ap_security_leap_init, + NULL /* value_table */ + }; + type = g_type_register_static (NM_TYPE_AP_SECURITY, + "NMAPSecurityLEAP", + &info, 0); + } + return type; +} diff -up NetworkManager-0.6.4/src/nm-device.c.leap NetworkManager-0.6.4/src/nm-device.c --- NetworkManager-0.6.4/src/nm-device.c.leap 2006-07-10 13:22:32.000000000 -0400 +++ NetworkManager-0.6.4/src/nm-device.c 2007-12-16 23:02:41.000000000 -0500 @@ -807,6 +807,12 @@ real_act_stage3_ip_config_start (NMDevic data = nm_act_request_get_data (req); g_assert (data); + /* Sometimes the device gets downed by wpa_supplicant; in any case, make + * sure it's up before anything tries to use it. + */ + if (!nm_device_is_up (self)) + nm_device_bring_up (self); + /* DHCP devices try DHCP, non-DHCP default to SUCCESS */ if (nm_device_get_use_dhcp (self)) { @@ -822,6 +828,12 @@ real_act_stage3_ip_config_start (NMDevic */ ret = NM_ACT_STAGE_RETURN_POSTPONE; } + + /* Sometimes the device gets downed by dhcdbd/dhclient; in any case, make + * sure it's up before anything tries to use it. + */ + if (!nm_device_is_up (self)) + nm_device_bring_up (self); out: return ret; diff -up NetworkManager-0.6.4/src/NetworkManagerAP.c.leap NetworkManager-0.6.4/src/NetworkManagerAP.c --- NetworkManager-0.6.4/src/NetworkManagerAP.c.leap 2006-08-04 11:43:46.000000000 -0400 +++ NetworkManager-0.6.4/src/NetworkManagerAP.c 2007-12-16 18:46:38.000000000 -0500 @@ -600,6 +600,10 @@ static guint32 add_capabilities_from_cip caps |= NM_802_11_CAP_KEY_MGMT_802_1X; caps &= ~NM_802_11_CAP_PROTO_NONE; } + if (cipher == NM_AUTH_TYPE_LEAP) + { + caps &= ~NM_802_11_CAP_PROTO_NONE; + } return caps; } diff -up NetworkManager-0.6.4/src/nm-ap-security.c.leap NetworkManager-0.6.4/src/nm-ap-security.c --- NetworkManager-0.6.4/src/nm-ap-security.c.leap 2006-08-13 23:26:07.000000000 -0400 +++ NetworkManager-0.6.4/src/nm-ap-security.c 2007-12-16 18:46:38.000000000 -0500 @@ -29,6 +29,7 @@ #include "nm-ap-security-wep.h" #include "nm-ap-security-wpa-psk.h" #include "nm-ap-security-wpa-eap.h" +#include "nm-ap-security-leap.h" #include "nm-device-802-11-wireless.h" #include "wpa_ctrl.h" #include "nm-utils.h" @@ -96,6 +97,10 @@ nm_ap_security_new_deserialize (DBusMess security = NM_AP_SECURITY (nm_ap_security_wpa_eap_new_deserialize (iter)); break; + case NM_AUTH_TYPE_LEAP: + security = NM_AP_SECURITY (nm_ap_security_leap_new_deserialize (iter)); + break; + default: nm_warning ("Unmatched cipher %d", we_cipher); break; @@ -115,6 +120,7 @@ out: #define WPA_EAP (NM_802_11_CAP_PROTO_WPA | NM_802_11_CAP_KEY_MGMT_802_1X) #define WEP_WEP104 (NM_802_11_CAP_PROTO_WEP | NM_802_11_CAP_CIPHER_WEP104) #define WEP_WEP40 (NM_802_11_CAP_PROTO_WEP | NM_802_11_CAP_CIPHER_WEP40) +#define LEAP (NM_802_11_CAP_KEY_MGMT_802_1X) NMAPSecurity * nm_ap_security_new_from_ap (NMAccessPoint *ap) { @@ -135,6 +141,8 @@ nm_ap_security_new_from_ap (NMAccessPoin security = NM_AP_SECURITY (nm_ap_security_wep_new_from_ap (ap, IW_AUTH_CIPHER_WEP104)); else if ((caps & WEP_WEP40) == WEP_WEP40) security = NM_AP_SECURITY (nm_ap_security_wep_new_from_ap (ap, IW_AUTH_CIPHER_WEP40)); + else if ((caps & LEAP) == LEAP) + security = NM_AP_SECURITY (nm_ap_security_leap_new_from_ap (ap)); else if (!nm_ap_get_encrypted (ap)) security = nm_ap_security_new (IW_AUTH_CIPHER_NONE); @@ -189,7 +197,8 @@ nm_ap_security_set_we_cipher (NMAPSecuri || (we_cipher == IW_AUTH_CIPHER_WEP104) || (we_cipher == IW_AUTH_CIPHER_TKIP) || (we_cipher == IW_AUTH_CIPHER_CCMP) - || (we_cipher == NM_AUTH_TYPE_WPA_EAP)); + || (we_cipher == NM_AUTH_TYPE_WPA_EAP) + || (we_cipher == NM_AUTH_TYPE_LEAP)); self->priv->we_cipher = we_cipher; } diff -up /dev/null NetworkManager-0.6.4/src/nm-ap-security-leap.h --- /dev/null 2007-12-13 09:27:29.857440981 -0500 +++ NetworkManager-0.6.4/src/nm-ap-security-leap.h 2007-12-16 18:46:38.000000000 -0500 @@ -0,0 +1,61 @@ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * (C) Copyright 2006 Thiago Jung Bauermann <thiago.bauermann@gmail.com> + */ + +/* This file is heavily based on nm-ap-security-wpa-eap.h */ + +#ifndef NM_AP_SECURITY_LEAP_H +#define NM_AP_SECURITY_LEAP_H + +#include <glib-object.h> +#include <dbus/dbus.h> +#include "nm-ap-security.h" + +#define NM_TYPE_AP_SECURITY_LEAP (nm_ap_security_leap_get_type ()) +#define NM_AP_SECURITY_LEAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_AP_SECURITY_LEAP, NMAPSecurityLEAP)) +#define NM_AP_SECURITY_LEAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_AP_SECURITY_LEAP, NMAPSecurityLEAPClass)) +#define NM_IS_AP_SECURITY_LEAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_AP_SECURITY_LEAP)) +#define NM_IS_AP_SECURITY_LEAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_AP_SECURITY_LEAP)) +#define NM_AP_SECURITY_LEAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_AP_SECURITY_LEAP, NMAPSecurityLEAPClass)) + +typedef struct _NMAPSecurityLEAP NMAPSecurityLEAP; +typedef struct _NMAPSecurityLEAPClass NMAPSecurityLEAPClass; +typedef struct _NMAPSecurityLEAPPrivate NMAPSecurityLEAPPrivate; + +struct _NMAPSecurityLEAP +{ + NMAPSecurity parent; + + /*< private >*/ + NMAPSecurityLEAPPrivate *priv; +}; + +struct _NMAPSecurityLEAPClass +{ + NMAPSecurityClass parent; +}; + + +GType nm_ap_security_leap_get_type (void); + +NMAPSecurityLEAP * nm_ap_security_leap_new_deserialize (DBusMessageIter *iter); + +struct NMAccessPoint; +NMAPSecurityLEAP * nm_ap_security_leap_new_from_ap (struct NMAccessPoint *ap); + +#endif /* NM_AP_SECURITY_LEAP_H */ diff -up NetworkManager-0.6.4/include/NetworkManager.h.leap NetworkManager-0.6.4/include/NetworkManager.h --- NetworkManager-0.6.4/include/NetworkManager.h.leap 2006-02-25 21:16:52.000000000 -0500 +++ NetworkManager-0.6.4/include/NetworkManager.h 2007-12-16 18:46:38.000000000 -0500 @@ -120,6 +120,7 @@ typedef enum NMDeviceType #define NM_AUTH_TYPE_WPA_PSK_CCMP 0x00000008 #define NM_AUTH_TYPE_WEP104 0x00000010 #define NM_AUTH_TYPE_WPA_EAP 0x00000020 +#define NM_AUTH_TYPE_LEAP 0x00000040 /* * EAP Methods diff -up NetworkManager-0.6.4/gnome/applet/nm-gconf-wso.c.leap NetworkManager-0.6.4/gnome/applet/nm-gconf-wso.c --- NetworkManager-0.6.4/gnome/applet/nm-gconf-wso.c.leap 2006-03-27 10:14:05.000000000 -0500 +++ NetworkManager-0.6.4/gnome/applet/nm-gconf-wso.c 2007-12-16 18:46:38.000000000 -0500 @@ -31,6 +31,7 @@ #include "nm-gconf-wso-wep.h" #include "nm-gconf-wso-wpa-eap.h" #include "nm-gconf-wso-wpa-psk.h" +#include "nm-gconf-wso-leap.h" #include "gconf-helpers.h" #include "wireless-security-option.h" @@ -95,6 +96,10 @@ nm_gconf_wso_new_deserialize_dbus (DBusM security = NM_GCONF_WSO (nm_gconf_wso_wpa_eap_new_deserialize_dbus (iter, we_cipher)); break; + case NM_AUTH_TYPE_LEAP: + security = NM_GCONF_WSO (nm_gconf_wso_leap_new_deserialize_dbus (iter, we_cipher)); + break; + default: break; } @@ -141,6 +146,10 @@ nm_gconf_wso_new_deserialize_gconf (GCon security = NM_GCONF_WSO (nm_gconf_wso_wpa_eap_new_deserialize_gconf (client, network, we_cipher)); break; + case NM_AUTH_TYPE_LEAP: + security = NM_GCONF_WSO (nm_gconf_wso_leap_new_deserialize_gconf (client, network, we_cipher)); + break; + default: break; } @@ -187,6 +196,7 @@ nm_gconf_wso_set_we_cipher (NMGConfWSO * g_return_if_fail ( (we_cipher == NM_AUTH_TYPE_WPA_PSK_AUTO) || (we_cipher == NM_AUTH_TYPE_WPA_EAP) + || (we_cipher == NM_AUTH_TYPE_LEAP) || (we_cipher == IW_AUTH_CIPHER_NONE) || (we_cipher == IW_AUTH_CIPHER_WEP40) || (we_cipher == IW_AUTH_CIPHER_WEP104) diff -up /dev/null NetworkManager-0.6.4/gnome/applet/nm-gconf-wso-leap.c --- /dev/null 2007-12-13 09:27:29.857440981 -0500 +++ NetworkManager-0.6.4/gnome/applet/nm-gconf-wso-leap.c 2007-12-16 18:46:38.000000000 -0500 @@ -0,0 +1,178 @@ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * (C) Copyright 2006 Thiago Jung Bauermann <thiago.bauermann@gmail.com> + */ + +/* This file is heavily based on nm-gconf-wso-wpa-eap.c */ + +#include <glib.h> +#include <glib/gi18n.h> +#include <dbus/dbus.h> +#include <iwlib.h> + +#include "applet.h" +#include "nm-gconf-wso.h" +#include "nm-gconf-wso-leap.h" +#include "nm-gconf-wso-private.h" +#include "dbus-helpers.h" +#include "gconf-helpers.h" + +#define LEAP_PREFIX "leap_" + +#define NM_GCONF_WSO_LEAP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_GCONF_WSO_LEAP, NMGConfWSOLEAPPrivate)) + +struct _NMGConfWSOLEAPPrivate +{ + const char * username; + const char * key_mgmt; +}; + + +NMGConfWSOLEAP * +nm_gconf_wso_leap_new_deserialize_dbus (DBusMessageIter *iter, int we_cipher) +{ + NMGConfWSOLEAP * security = NULL; + char * username = NULL; + char * password = NULL; + char * key_mgmt = NULL; + + g_return_val_if_fail (we_cipher == NM_AUTH_TYPE_LEAP, NULL); + g_return_val_if_fail (iter != NULL, NULL); + + if (!nmu_security_deserialize_leap (iter, &username, &password, &key_mgmt)) + goto out; + + /* Success, build up our security object */ + security = g_object_new (NM_TYPE_GCONF_WSO_LEAP, NULL); + nm_gconf_wso_set_we_cipher (NM_GCONF_WSO (security), we_cipher); + if (password) + nm_gconf_wso_set_key (NM_GCONF_WSO (security), password, strlen(password)); + if (username) + security->priv->username = g_strdup (username); + if (key_mgmt) + security->priv->key_mgmt = g_strdup (key_mgmt); + +out: + return security; +} + + +NMGConfWSOLEAP * +nm_gconf_wso_leap_new_deserialize_gconf (GConfClient *client, const char *network, int we_cipher) +{ + NMGConfWSOLEAP * security = NULL; + char * username = NULL; + char * key_mgmt = NULL; + + g_return_val_if_fail (client != NULL, NULL); + g_return_val_if_fail (network != NULL, NULL); + g_return_val_if_fail ((we_cipher == NM_AUTH_TYPE_LEAP), NULL); + + nm_gconf_get_string_helper (client, + GCONF_PATH_WIRELESS_NETWORKS, + LEAP_PREFIX"username", + network, + &username); + + nm_gconf_get_string_helper (client, + GCONF_PATH_WIRELESS_NETWORKS, + LEAP_PREFIX"key_mgmt", + network, + &key_mgmt); + + /* Success, build up our security object */ + security = g_object_new (NM_TYPE_GCONF_WSO_LEAP, NULL); + nm_gconf_wso_set_we_cipher (NM_GCONF_WSO (security), we_cipher); + security->priv->username = username; + security->priv->key_mgmt = key_mgmt; + + return security; +} + + +static gboolean +real_serialize_dbus (NMGConfWSO *instance, DBusMessageIter *iter) +{ + NMGConfWSOLEAP * self = NM_GCONF_WSO_LEAP (instance); + + if (!nmu_security_serialize_leap (iter, self->priv->username, + nm_gconf_wso_get_key(instance), self->priv->key_mgmt)) + return FALSE; + return TRUE; +} + +static gboolean +real_serialize_gconf (NMGConfWSO *instance, GConfClient *client, const char *network) +{ + NMGConfWSOLEAP * self = NM_GCONF_WSO_LEAP (instance); + char * key; + + key = g_strdup_printf ("%s/%s/%susername", GCONF_PATH_WIRELESS_NETWORKS, network, LEAP_PREFIX); + gconf_client_set_string (client, key, self->priv->username, NULL); + g_free (key); + + key = g_strdup_printf ("%s/%s/%skey_mgmt", GCONF_PATH_WIRELESS_NETWORKS, network, LEAP_PREFIX); + gconf_client_set_string (client, key, self->priv->key_mgmt, NULL); + g_free (key); + + return TRUE; +} + + +static void +nm_gconf_wso_leap_init (NMGConfWSOLEAP *self) +{ + self->priv = NM_GCONF_WSO_LEAP_GET_PRIVATE (self); +} + + +static void +nm_gconf_wso_leap_class_init (NMGConfWSOLEAPClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + NMGConfWSOClass *par_class = NM_GCONF_WSO_CLASS (klass); + + par_class->serialize_dbus_func = real_serialize_dbus; + par_class->serialize_gconf_func = real_serialize_gconf; + + g_type_class_add_private (object_class, sizeof (NMGConfWSOLEAPPrivate)); +} + + +GType +nm_gconf_wso_leap_get_type (void) +{ + static GType type = 0; + if (type == 0) { + static const GTypeInfo info = { + sizeof (NMGConfWSOLEAPClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) nm_gconf_wso_leap_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (NMGConfWSOLEAP), + 0, /* n_preallocs */ + (GInstanceInitFunc) nm_gconf_wso_leap_init, + NULL /* value_table */ + }; + type = g_type_register_static (NM_TYPE_GCONF_WSO, + "NMGConfWSOLEAP", + &info, 0); + } + return type; +} diff -up NetworkManager-0.6.4/gnome/applet/Makefile.am.leap NetworkManager-0.6.4/gnome/applet/Makefile.am --- NetworkManager-0.6.4/gnome/applet/Makefile.am.leap 2006-05-24 11:07:38.000000000 -0400 +++ NetworkManager-0.6.4/gnome/applet/Makefile.am 2007-12-16 18:46:38.000000000 -0500 @@ -82,6 +82,8 @@ nm_applet_SOURCES = \ wso-wpa-eap.h \ wso-wpa-psk.c \ wso-wpa-psk.h \ + wso-leap.c \ + wso-leap.h \ nm-gconf-wso.c \ nm-gconf-wso.h \ nm-gconf-wso-private.h \ @@ -91,6 +93,8 @@ nm_applet_SOURCES = \ nm-gconf-wso-wpa-eap.h \ nm-gconf-wso-wpa-psk.c \ nm-gconf-wso-wpa-psk.h \ + nm-gconf-wso-leap.c \ + nm-gconf-wso-leap.h \ gconf-helpers.c \ gconf-helpers.h \ $(NULL) diff -up /dev/null NetworkManager-0.6.4/gnome/applet/wso-leap.c --- /dev/null 2007-12-13 09:27:29.857440981 -0500 +++ NetworkManager-0.6.4/gnome/applet/wso-leap.c 2007-12-16 18:46:38.000000000 -0500 @@ -0,0 +1,169 @@ +/* NetworkManager Wireless Applet -- Display wireless access points and allow user control + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * (C) Copyright 2006 Thiago Jung Bauermann <thiago.bauermann@gmail.com> + */ + +/* This file is heavily based on wso-wpa-eap.c */ + +#include <glib.h> +#include <gtk/gtk.h> +#include <glade/glade.h> +#include <dbus/dbus.h> +#include <iwlib.h> + +#include "wireless-security-option.h" +#include "wso-leap.h" +#include "wso-private.h" +#include "dbus-helpers.h" +#include "NetworkManager.h" + + +struct OptData +{ + const char * username; + const char * passwd; + const char * key_mgmt; +}; + + +static void +data_free_func (WirelessSecurityOption *opt) +{ + g_return_if_fail (opt != NULL); + g_return_if_fail (opt->data != NULL); + + if (opt->data->key_mgmt) { + g_free((char *) opt->data->key_mgmt); + } + + memset (opt->data, 0, sizeof (opt->data)); + g_free (opt->data); +} + + +static gboolean +append_dbus_params_func (WirelessSecurityOption *opt, + const char *ssid, + DBusMessage *message) +{ + GtkWidget * entry; + GtkTreeModel * combo_model; + GtkTreeIter iter; + DBusMessageIter dbus_iter; + + g_return_val_if_fail (opt != NULL, FALSE); + g_return_val_if_fail (opt->data != NULL, FALSE); + + entry = glade_xml_get_widget (opt->uixml, "leap_username_entry"); + opt->data->username = gtk_entry_get_text (GTK_ENTRY (entry)); + + entry = glade_xml_get_widget (opt->uixml, "leap_password_entry"); + opt->data->passwd = gtk_entry_get_text (GTK_ENTRY (entry)); + + entry = glade_xml_get_widget (opt->uixml, "leap_key_mgmt_combobox"); + combo_model = gtk_combo_box_get_model(GTK_COMBO_BOX(entry)); + gtk_combo_box_get_active_iter(GTK_COMBO_BOX(entry), &iter); + gtk_tree_model_get(combo_model, &iter, 1, &opt->data->key_mgmt, -1); + + dbus_message_iter_init_append (message, &dbus_iter); + + nmu_security_serialize_leap_with_cipher (&dbus_iter, + opt->data->username, + opt->data->passwd, + opt->data->key_mgmt); + + return TRUE; +} + +static GtkWidget * +widget_create_func (WirelessSecurityOption *opt, + GtkSignalFunc validate_cb, + gpointer user_data) +{ + GtkWidget * entry; + GtkWidget * widget; + GtkWidget * key_mgmt; + GtkListStore * list_store; + GtkTreeIter iter; + + g_return_val_if_fail (opt != NULL, NULL); + g_return_val_if_fail (opt->data != NULL, NULL); + g_return_val_if_fail (validate_cb != NULL, NULL); + + widget = wso_widget_helper (opt); + + entry = glade_xml_get_widget (opt->uixml, "leap_username_entry"); + g_signal_connect (G_OBJECT (entry), "changed", validate_cb, user_data); + + entry = glade_xml_get_widget (opt->uixml, "leap_password_entry"); + g_signal_connect (G_OBJECT (entry), "changed", validate_cb, user_data); + + /* set-up key_mgmt combo box */ + + key_mgmt = glade_xml_get_widget (opt->uixml, "leap_key_mgmt_combobox"); + + /* create tree model containing combo box items */ + list_store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); + gtk_list_store_append(list_store, &iter); + gtk_list_store_set(list_store, &iter, 0, "IEEE 802.1X", 1, "IEEE8021X", -1); + gtk_list_store_append(list_store, &iter); + gtk_list_store_set(list_store, &iter, 0, "WPA-EAP", 1, "WPA-EAP", -1); + + gtk_combo_box_set_model(GTK_COMBO_BOX(key_mgmt), GTK_TREE_MODEL(list_store)); + + /* set default choice to be IEEE 802.1X */ + gtk_combo_box_set_active(GTK_COMBO_BOX(key_mgmt), 0); + + return widget; +} + +static gboolean +validate_input_func (WirelessSecurityOption *opt, + const char *ssid, + IEEE_802_11_Cipher **out_cipher) +{ + return TRUE; +} + + +WirelessSecurityOption * +wso_leap_new (const char *glade_file, + int capabilities) +{ + WirelessSecurityOption * opt = NULL; + + g_return_val_if_fail (glade_file != NULL, NULL); + + opt = g_malloc0 (sizeof (WirelessSecurityOption)); + opt->name = g_strdup("LEAP"); + opt->widget_name = "leap_notebook"; + opt->data_free_func = data_free_func; + opt->validate_input_func = validate_input_func; + opt->widget_create_func = widget_create_func; + opt->append_dbus_params_func = append_dbus_params_func; + + if (!(opt->uixml = glade_xml_new (glade_file, opt->widget_name, NULL))) + { + wso_free (opt); + return NULL; + } + + /* Option-specific data */ + opt->data = g_malloc0 (sizeof (OptData)); + + return opt; +} diff -up /dev/null NetworkManager-0.6.4/gnome/applet/wso-leap.h --- /dev/null 2007-12-13 09:27:29.857440981 -0500 +++ NetworkManager-0.6.4/gnome/applet/wso-leap.h 2007-12-16 18:46:38.000000000 -0500 @@ -0,0 +1,27 @@ +/* NetworkManager Wireless Applet -- Display wireless access points and allow user control + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * (C) Copyright 2006 Thiago Jung Bauermann <thiago.bauermann@gmail.com> + */ + +/* This file is heavily based on wso-wpa-eap.h */ + +#ifndef WSO_LEAP_H +#define WSO_LEAP_H + +WirelessSecurityOption * wso_leap_new (const char *glade_file, int capabilities); + +#endif /* WSO_LEAP_H */ diff -up /dev/null NetworkManager-0.6.4/gnome/applet/nm-gconf-wso-leap.h --- /dev/null 2007-12-13 09:27:29.857440981 -0500 +++ NetworkManager-0.6.4/gnome/applet/nm-gconf-wso-leap.h 2007-12-16 18:46:38.000000000 -0500 @@ -0,0 +1,60 @@ +/* NetworkManager -- Network link manager + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * (C) Copyright 2006 Thiago Jung Bauermann <thiago.bauermann@gmail.com> + */ + +/* This file is heavily based on nm-gconf-wso-wpa-eap.h */ + +#ifndef NM_GCONF_WSO_LEAP_H +#define NM_GCONF_WSO_LEAP_H + +#include <glib-object.h> +#include <dbus/dbus.h> +#include <gconf/gconf-client.h> + +#define NM_TYPE_GCONF_WSO_LEAP (nm_gconf_wso_leap_get_type ()) +#define NM_GCONF_WSO_LEAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_GCONF_WSO_LEAP, NMGConfWSOLEAP)) +#define NM_GCONF_WSO_LEAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_GCONF_WSO_LEAP, NMGConfWSOLEAPClass)) +#define NM_IS_GCONF_WSO_LEAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_GCONF_WSO_LEAP)) +#define NM_IS_GCONF_WSO_LEAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_GCONF_WSO_LEAP)) +#define NM_GCONF_WSO_LEAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_GCONF_WSO_LEAP, NMGConfWSOLEAPClass)) + +typedef struct _NMGConfWSOLEAP NMGConfWSOLEAP; +typedef struct _NMGConfWSOLEAPClass NMGConfWSOLEAPClass; +typedef struct _NMGConfWSOLEAPPrivate NMGConfWSOLEAPPrivate; + +struct _NMGConfWSOLEAP +{ + NMGConfWSO parent; + + /*< private >*/ + NMGConfWSOLEAPPrivate *priv; +}; + +struct _NMGConfWSOLEAPClass +{ + NMGConfWSOClass parent; +}; + + +GType nm_gconf_wso_leap_get_type (void); + +NMGConfWSOLEAP * nm_gconf_wso_leap_new_deserialize_dbus (DBusMessageIter *iter, int we_cipher); + +NMGConfWSOLEAP * nm_gconf_wso_leap_new_deserialize_gconf (GConfClient *client, const char *network, int we_cipher); + +#endif /* NM_GCONF_WSO_LEAP_H */ diff -up NetworkManager-0.6.4/gnome/applet/applet.glade.leap NetworkManager-0.6.4/gnome/applet/applet.glade --- NetworkManager-0.6.4/gnome/applet/applet.glade.leap 2006-05-28 23:35:15.000000000 -0400 +++ NetworkManager-0.6.4/gnome/applet/applet.glade 2007-12-16 18:46:38.000000000 -0500 @@ -2151,6 +2151,241 @@ Shared Key</property> </child> </widget> +<widget class="GtkWindow" id="leap_subwindow"> + <property name="visible">True</property> + <property name="title">leap_subwindow</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + + <child> + <widget class="GtkNotebook" id="leap_notebook"> + <property name="visible">True</property> + <property name="show_tabs">False</property> + <property name="show_border">False</property> + <property name="tab_pos">GTK_POS_TOP</property> + <property name="scrollable">False</property> + <property name="enable_popup">False</property> + + <child> + <widget class="GtkTable" id="table5"> + <property name="border_width">6</property> + <property name="visible">True</property> + <property name="n_rows">3</property> + <property name="n_columns">2</property> + <property name="homogeneous">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + + <child> + <widget class="GtkEntry" id="leap_username_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="leap_password_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">False</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="leap_username"> + <property name="visible">True</property> + <property name="label" translatable="yes">User Name:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="leap_password"> + <property name="visible">True</property> + <property name="label" translatable="yes">Password:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">1</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="leap_key_mgmt"> + <property name="visible">True</property> + <property name="label" translatable="yes">Key management:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkComboBox" id="leap_key_mgmt_combobox"> + <property name="visible">True</property> + <property name="items" translatable="yes"></property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="GtkLabel"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <placeholder/> + </child> + + <child> + <widget class="GtkLabel" id="GtkLabel"> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + </widget> + </child> +</widget> + <widget class="GtkWindow" id="wpa_psk_subwindow"> <property name="visible">True</property> <property name="title">wpa_psk_subwindow</property> diff -up NetworkManager-0.6.4/gnome/applet/wireless-security-manager.c.leap NetworkManager-0.6.4/gnome/applet/wireless-security-manager.c --- NetworkManager-0.6.4/gnome/applet/wireless-security-manager.c.leap 2006-02-25 21:16:52.000000000 -0500 +++ NetworkManager-0.6.4/gnome/applet/wireless-security-manager.c 2007-12-16 18:46:38.000000000 -0500 @@ -36,6 +36,7 @@ #include "wso-wep-passphrase.h" #include "wso-wpa-eap.h" #include "wso-wpa-psk.h" +#include "wso-leap.h" struct WirelessSecurityManager { @@ -116,6 +117,9 @@ gboolean wsm_set_capabilities (WirelessS } } + if ((opt = wso_leap_new (wsm->glade_file, capabilities))) + wsm->options = g_slist_append (wsm->options, opt); + if (!wsm->options) { nm_warning ("capabilities='%x' and did not match any protocals, not even none!", capabilities);