Re: [PATCH] LEAP support in NetworkManager
- From: "Thiago Bauermann" <thiago bauermann gmail com>
- To: "Jason Martens" <me jasonmartens com>
- Cc: networkmanager-list gnome org
- Subject: Re: [PATCH] LEAP support in NetworkManager
- Date: Fri, 13 Oct 2006 01:04:50 -0300
2006/9/8, Thiago Bauermann <
thiago bauermann gmail com>:
2006/9/8, Jason Martens <me jasonmartens com>:
Jason Martens wrote:
> Yes, I was still able to connect after removing the "auth_alg=OPEN LEAP"
> line.
>
Have these changes made it into CVS yet? If so, I'll re-compile and try
them out. :)
Sorry pal. Still didn't get around to do it, but I believe I will in the next few days...
Mmmm... was more than a few days. But here it is, finally.
This patch adds Pairwise and Group options to the LEAP configuration dialog, which should address your wpa supplicant configuration.
--
[]'s
Thiago Jung Bauermann
diff -u -r1.14 applet.glade
--- NetworkManager/gnome/applet/applet.glade 13 Jul 2006 17:03:29 -0000 1.14
+++ NetworkManager/gnome/applet/applet.glade 13 Oct 2006 03:45:49 -0000
@@ -2012,7 +2012,7 @@
<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_rows">5</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
@@ -2154,6 +2154,96 @@
<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>
+
+ <child>
+ <widget class="GtkLabel" id="pairwise">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Pairwise:</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">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="group">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Group:</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">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkComboBox" id="leap_group_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">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkComboBox" id="leap_pairwise_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">3</property>
+ <property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
diff -u -r1.1 nm-gconf-wso-leap.c
--- NetworkManager/gnome/applet/nm-gconf-wso-leap.c 13 Jul 2006 17:03:30 -0000 1.1
+++ NetworkManager/gnome/applet/nm-gconf-wso-leap.c 13 Oct 2006 03:45:49 -0000
@@ -39,6 +39,8 @@
{
const char * username;
const char * key_mgmt;
+ const char * pairwise;
+ const char * group;
};
@@ -49,11 +51,13 @@
char * username = NULL;
char * password = NULL;
char * key_mgmt = NULL;
+ char * pairwise = NULL;
+ char * group = 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))
+ if (!nmu_security_deserialize_leap (iter, &username, &password, &key_mgmt, &pairwise, &group))
goto out;
/* Success, build up our security object */
@@ -65,6 +69,10 @@
security->priv->username = g_strdup (username);
if (key_mgmt)
security->priv->key_mgmt = g_strdup (key_mgmt);
+ if (pairwise)
+ security->priv->pairwise = g_strdup (pairwise);
+ if (group)
+ security->priv->group = g_strdup (group);
out:
return security;
@@ -77,6 +85,8 @@
NMGConfWSOLEAP * security = NULL;
char * username = NULL;
char * key_mgmt = NULL;
+ char * pairwise = NULL;
+ char * group = NULL;
g_return_val_if_fail (client != NULL, NULL);
g_return_val_if_fail (network != NULL, NULL);
@@ -94,11 +104,25 @@
network,
&key_mgmt);
+ nm_gconf_get_string_helper (client,
+ GCONF_PATH_WIRELESS_NETWORKS,
+ LEAP_PREFIX"pairwise",
+ network,
+ &pairwise);
+
+ nm_gconf_get_string_helper (client,
+ GCONF_PATH_WIRELESS_NETWORKS,
+ LEAP_PREFIX"group",
+ network,
+ &group);
+
/* 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;
+ security->priv->pairwise = pairwise;
+ security->priv->group = group;
return security;
}
@@ -110,7 +134,7 @@
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))
+ nm_gconf_wso_get_key(instance), self->priv->key_mgmt, self->priv->pairwise, self->priv->group))
return FALSE;
return TRUE;
}
@@ -127,6 +151,14 @@
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);
+
+ key = g_strdup_printf ("%s/%s/%spairwise", GCONF_PATH_WIRELESS_NETWORKS, network, LEAP_PREFIX);
+ gconf_client_set_string (client, key, self->priv->pairwise, NULL);
+ g_free (key);
+
+ key = g_strdup_printf ("%s/%s/%sgroup", GCONF_PATH_WIRELESS_NETWORKS, network, LEAP_PREFIX);
+ gconf_client_set_string (client, key, self->priv->group, NULL);
g_free (key);
return TRUE;
diff -u -r1.1 wso-leap.c
--- NetworkManager/gnome/applet/wso-leap.c 13 Jul 2006 17:03:30 -0000 1.1
+++ NetworkManager/gnome/applet/wso-leap.c 13 Oct 2006 03:45:50 -0000
@@ -37,6 +37,8 @@
const char * username;
const char * passwd;
const char * key_mgmt;
+ const char * pairwise;
+ const char * group;
};
@@ -50,6 +52,14 @@
g_free((char *) opt->data->key_mgmt);
}
+ if (opt->data->pairwise) {
+ g_free((char *) opt->data->pairwise);
+ }
+
+ if (opt->data->group) {
+ g_free((char *) opt->data->group);
+ }
+
memset (opt->data, 0, sizeof (opt->data));
g_free (opt->data);
}
@@ -79,12 +89,24 @@
gtk_combo_box_get_active_iter(GTK_COMBO_BOX(entry), &iter);
gtk_tree_model_get(combo_model, &iter, 1, &opt->data->key_mgmt, -1);
+ entry = glade_xml_get_widget (opt->uixml, "leap_pairwise_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->pairwise, -1);
+
+ entry = glade_xml_get_widget (opt->uixml, "leap_group_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->group, -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);
+ opt->data->key_mgmt,
+ opt->data->pairwise,
+ opt->data->group);
return TRUE;
}
@@ -97,6 +119,8 @@
GtkWidget * entry;
GtkWidget * widget;
GtkWidget * key_mgmt;
+ GtkWidget * pairwise;
+ GtkWidget * group;
GtkListStore * list_store;
GtkTreeIter iter;
@@ -127,6 +151,48 @@
/* set default choice to be IEEE 802.1X */
gtk_combo_box_set_active(GTK_COMBO_BOX(key_mgmt), 0);
+
+ /* set-up pairwise combo box */
+
+ pairwise = glade_xml_get_widget (opt->uixml, "leap_pairwise_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, "Default", 1, "", -1);
+ gtk_list_store_append(list_store, &iter);
+ gtk_list_store_set(list_store, &iter, 0, "CCMP", 1, "CCMP", -1);
+ gtk_list_store_append(list_store, &iter);
+ gtk_list_store_set(list_store, &iter, 0, "TKIP", 1, "TKIP", -1);
+ gtk_list_store_append(list_store, &iter);
+ gtk_list_store_set(list_store, &iter, 0, "None", 1, "NONE", -1);
+
+ gtk_combo_box_set_model(GTK_COMBO_BOX(pairwise), GTK_TREE_MODEL(list_store));
+
+ /* set default choice to be Default */
+ gtk_combo_box_set_active(GTK_COMBO_BOX(pairwise), 0);
+
+ /* set-up group combo box */
+
+ group = glade_xml_get_widget (opt->uixml, "leap_group_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, "Default", 1, "", -1);
+ gtk_list_store_append(list_store, &iter);
+ gtk_list_store_set(list_store, &iter, 0, "CCMP", 1, "CCMP", -1);
+ gtk_list_store_append(list_store, &iter);
+ gtk_list_store_set(list_store, &iter, 0, "TKIP", 1, "TKIP", -1);
+ gtk_list_store_append(list_store, &iter);
+ gtk_list_store_set(list_store, &iter, 0, "WEP104", 1, "WEP104", -1);
+ gtk_list_store_append(list_store, &iter);
+ gtk_list_store_set(list_store, &iter, 0, "WEP40", 1, "WEP40", -1);
+
+ gtk_combo_box_set_model(GTK_COMBO_BOX(group), GTK_TREE_MODEL(list_store));
+
+ /* set default choice to be Default */
+ gtk_combo_box_set_active(GTK_COMBO_BOX(group), 0);
return widget;
}
diff -u -r1.20 dbus-helpers.c
--- NetworkManager/libnm-util/dbus-helpers.c 13 Jul 2006 17:03:31 -0000 1.20
+++ NetworkManager/libnm-util/dbus-helpers.c 13 Oct 2006 03:45:50 -0000
@@ -478,10 +478,14 @@
nmu_security_serialize_leap (DBusMessageIter *iter,
const char *username,
const char *passwd,
- const char *key_mgmt)
+ const char *key_mgmt,
+ const char *pairwise,
+ const char *group)
{
const char *fake_username = "";
const char *fake_passwd = "";
+ const char *fake_pairwise = "";
+ const char *fake_group = "";
g_return_val_if_fail (iter != NULL, FALSE);
g_return_val_if_fail (key_mgmt != NULL, FALSE);
@@ -495,6 +499,12 @@
/* Fourth arg: Key management (STRING) */
dbus_message_iter_append_basic (iter, DBUS_TYPE_STRING, &key_mgmt);
+ /* Fifth arg: Pairwise cipher (STRING) */
+ dbus_message_iter_append_basic (iter, DBUS_TYPE_STRING, pairwise? &pairwise : &fake_pairwise);
+
+ /* Sixth arg: Group cipher (STRING) */
+ dbus_message_iter_append_basic (iter, DBUS_TYPE_STRING, group? &group : &fake_group);
+
return TRUE;
}
@@ -502,25 +512,31 @@
nmu_security_serialize_leap_with_cipher (DBusMessageIter *iter,
const char *username,
const char *passwd,
- const char *key_mgmt)
+ const char *key_mgmt,
+ const char *pairwise,
+ const char *group)
{
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);
+ return nmu_security_serialize_leap (iter, username, passwd, key_mgmt, pairwise, group);
}
dbus_bool_t
nmu_security_deserialize_leap (DBusMessageIter *iter,
char **username,
char **passwd,
- char **key_mgmt)
+ char **key_mgmt,
+ char **pairwise,
+ char **group)
{
char * dbus_username;
char * dbus_password;
char * dbus_key_mgmt;
+ char * dbus_pairwise;
+ char * dbus_group;
g_return_val_if_fail (iter != NULL, FALSE);
g_return_val_if_fail (username != NULL, FALSE);
@@ -529,6 +545,10 @@
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);
+ g_return_val_if_fail (pairwise != NULL, FALSE);
+ g_return_val_if_fail (*pairwise == NULL, FALSE);
+ g_return_val_if_fail (group != NULL, FALSE);
+ g_return_val_if_fail (*group == NULL, FALSE);
/* Second arg: Username (STRING) */
g_return_val_if_fail (dbus_message_iter_get_arg_type (iter) == DBUS_TYPE_STRING, FALSE);
@@ -547,9 +567,23 @@
dbus_message_iter_get_basic (iter, &dbus_key_mgmt);
g_return_val_if_fail (dbus_key_mgmt != NULL, FALSE);
+ /* Fifth arg: Pairwise cipher (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_pairwise);
+ g_return_val_if_fail (dbus_pairwise != NULL, FALSE);
+
+ /* Sixth arg: Group cipher (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_group);
+ g_return_val_if_fail (dbus_group != 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;
+ *pairwise = strlen (dbus_pairwise) > 0 ? dbus_pairwise : NULL;
+ *group = strlen (dbus_group) > 0 ? dbus_group : NULL;
return TRUE;
}
diff -u -r1.10 dbus-helpers.h
--- NetworkManager/libnm-util/dbus-helpers.h 13 Jul 2006 17:03:31 -0000 1.10
+++ NetworkManager/libnm-util/dbus-helpers.h 13 Oct 2006 03:45:50 -0000
@@ -103,17 +103,23 @@
dbus_bool_t nmu_security_serialize_leap (DBusMessageIter *iter,
const char *username,
const char *passwd,
- const char *key_mgmt);
+ const char *key_mgmt,
+ const char *pairwise,
+ const char *group);
dbus_bool_t nmu_security_serialize_leap_with_cipher (DBusMessageIter *iter,
const char *username,
const char *passwd,
- const char *key_mgmt);
+ const char *key_mgmt,
+ const char *pairwise,
+ const char *group);
dbus_bool_t nmu_security_deserialize_leap (DBusMessageIter *iter,
char **username,
char **passwd,
- char **key_mgmt);
+ char **key_mgmt,
+ char **group,
+ char **pairwise);
DBusMessage * nmu_create_dbus_error_message (DBusMessage *message,
const char *exception_namespace,
diff -u -r1.2 nm-ap-security-leap.c
--- NetworkManager/src/nm-ap-security-leap.c 14 Aug 2006 03:11:03 -0000 1.2
+++ NetworkManager/src/nm-ap-security-leap.c 13 Oct 2006 03:45:50 -0000
@@ -37,6 +37,8 @@
{
char * username;
char * key_mgmt;
+ char * pairwise;
+ char * group;
};
@@ -47,10 +49,12 @@
char * username = NULL;
char * password = NULL;
char * key_mgmt = NULL;
+ char * pairwise = NULL;
+ char * group = NULL;
g_return_val_if_fail (iter != NULL, NULL);
- if (!nmu_security_deserialize_leap (iter, &username, &password, &key_mgmt))
+ if (!nmu_security_deserialize_leap (iter, &username, &password, &key_mgmt, &pairwise, &group))
goto out;
/* Success, build up our security object */
@@ -62,6 +66,10 @@
security->priv->username = g_strdup (username);
if (key_mgmt)
security->priv->key_mgmt = g_strdup (key_mgmt);
+ if (pairwise)
+ security->priv->pairwise = g_strdup (pairwise);
+ if (group)
+ security->priv->group = g_strdup (group);
nm_ap_security_set_description (NM_AP_SECURITY (security), _("LEAP"));
@@ -91,7 +99,7 @@
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))
+ nm_ap_security_get_key(instance), self->priv->key_mgmt, self->priv->pairwise, self->priv->group))
return -1;
return 0;
}
@@ -124,6 +132,16 @@
nwid, self->priv->username))
goto out;
+ if (self->priv->pairwise && strlen (self->priv->pairwise) > 0)
+ if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL, "SET_NETWORK %i pairwise %s",
+ nwid, self->priv->pairwise))
+ goto out;
+
+ if (self->priv->group && strlen (self->priv->group) > 0)
+ if (!nm_utils_supplicant_request_with_check (ctrl, "OK", __func__, NULL, "SET_NETWORK %i group %s",
+ nwid, self->priv->group))
+ goto out;
+
if (password && strlen (password) > 0)
{
msg = g_strdup_printf ("SET_NETWORK %i password <password>", nwid);
@@ -167,6 +185,8 @@
dst->priv->username = self->priv->username;
dst->priv->key_mgmt = self->priv->key_mgmt;
+ dst->priv->pairwise = self->priv->pairwise;
+ dst->priv->group = self->priv->group;
nm_ap_security_copy_properties (NM_AP_SECURITY (self), NM_AP_SECURITY (dst));
@@ -180,6 +200,8 @@
self->priv = NM_AP_SECURITY_LEAP_GET_PRIVATE (self);
self->priv->username = NULL;
self->priv->key_mgmt = NULL;
+ self->priv->pairwise = NULL;
+ self->priv->group = NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]