Bugzilla – Attachment 142439 Details for
Bug 216063
Add phase2 auth support to [k]networkmanager
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Add phase2 support to NM (gnome nm-applet)
nm-applet-wpa_phase2.patch (text/plain), 16.73 KB, created by
Stefan Brüns
on 2007-05-27 13:51:49 UTC
(
hide
)
Description:
Add phase2 support to NM (gnome nm-applet)
Filename:
MIME Type:
Creator:
Stefan Brüns
Created:
2007-05-27 13:51:49 UTC
Size:
16.73 KB
patch
obsolete
>--- branches/network-manager-applet-0-6/src/nm-gconf-wso-wpa-eap.c 2007/02/02 15:48:42 3 >+++ branches/network-manager-applet-0-6/src/nm-gconf-wso-wpa-eap.c 2007/02/03 19:29:52 7 >@@ -40,6 +40,7 @@ > { > int eap_method; > int key_type; >+ int phase2_type; > int wpa_version; > int key_mgmt; > const char * identity; >@@ -80,8 +81,9 @@ > if (private_key_passwd && strlen (private_key_passwd) > 0) > nm_gconf_wso_set_key (NM_GCONF_WSO (security), private_key_passwd, strlen (private_key_passwd)); > security->priv->wpa_version = wpa_version; >- security->priv->eap_method = eap_method; > security->priv->key_type = key_type; >+ security->priv->eap_method = NM_EAP_TO_EAP_METHOD (eap_method); >+ security->priv->phase2_type = NM_EAP_TO_PHASE2_METHOD (eap_method); > security->priv->key_mgmt = IW_AUTH_KEY_MGMT_802_1X; > security->priv->identity = g_strdup (identity); > security->priv->passwd = g_strdup (passwd); >@@ -108,6 +110,7 @@ > int wpa_version = 0; > int eap_method = 0; > int key_type = 0; >+ int phase2_type = 0; > int key_mgmt = 0; > > g_return_val_if_fail (client != NULL, NULL); >@@ -128,6 +131,12 @@ > > nm_gconf_get_int_helper (client, > GCONF_PATH_WIRELESS_NETWORKS, >+ WPA_EAP_PREFIX"phase2_type", >+ network, >+ &phase2_type); >+ >+ nm_gconf_get_int_helper (client, >+ GCONF_PATH_WIRELESS_NETWORKS, > WPA_EAP_PREFIX"wpa_version", > network, > &wpa_version); >@@ -180,6 +189,7 @@ > security->priv->wpa_version = wpa_version; > security->priv->eap_method = eap_method; > security->priv->key_type = key_type; >+ security->priv->phase2_type = phase2_type; > security->priv->key_mgmt = IW_AUTH_KEY_MGMT_802_1X; > security->priv->identity = g_strdup (identity); > security->priv->passwd = g_strdup (passwd); >@@ -205,7 +215,7 @@ > NMGConfWSOWPA_EAP * self = NM_GCONF_WSO_WPA_EAP (instance); > > if (!nmu_security_serialize_wpa_eap (iter, >- self->priv->eap_method, >+ self->priv->eap_method | self->priv->phase2_type, > self->priv->key_type, > self->priv->identity ? : "", > self->priv->passwd ? : "", >@@ -233,6 +243,10 @@ > gconf_client_set_int (client, key, self->priv->key_type, NULL); > g_free (key); > >+ key = g_strdup_printf ("%s/%s/%sphase2_type", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX); >+ gconf_client_set_int (client, key, self->priv->phase2_type, NULL); >+ g_free (key); >+ > key = g_strdup_printf ("%s/%s/%swpa_version", GCONF_PATH_WIRELESS_NETWORKS, network, WPA_EAP_PREFIX); > gconf_client_set_int (client, key, self->priv->wpa_version, NULL); > g_free (key); >--- branches/network-manager-applet-0-6/src/wireless-security-option.c 2007/02/02 15:48:42 3 >+++ branches/network-manager-applet-0-6/src/wireless-security-option.c 2007/02/03 19:29:52 7 >@@ -237,3 +237,44 @@ > *num_added = num; > return GTK_TREE_MODEL (model); > } >+ >+GtkTreeModel * >+wso_wpa_create_phase2_type_model (int capabilities, gboolean wpa_eap, int *num_added) >+{ >+ GtkListStore * model; >+ GtkTreeIter iter; >+ const char * name; >+ >+ g_return_val_if_fail (num_added != NULL, NULL); >+ >+ model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT); >+ >+ name = _("None (Default)"); >+ gtk_list_store_append (model, &iter); >+ gtk_list_store_set (model, &iter, WPA_KEY_TYPE_NAME_COL, name, >+ WPA_KEY_TYPE_CIPHER_COL, NM_PHASE2_AUTH_NONE, -1); >+ >+ name = _("PAP"); >+ gtk_list_store_append (model, &iter); >+ gtk_list_store_set (model, &iter, WPA_KEY_TYPE_NAME_COL, name, >+ WPA_KEY_TYPE_CIPHER_COL, NM_PHASE2_AUTH_PAP, -1); >+ >+ name = _("MSCHAP"); >+ gtk_list_store_append (model, &iter); >+ gtk_list_store_set (model, &iter, WPA_KEY_TYPE_NAME_COL, name, >+ WPA_KEY_TYPE_CIPHER_COL, NM_PHASE2_AUTH_MSCHAP, -1); >+ >+ name = _("MSCHAPV2"); >+ gtk_list_store_append (model, &iter); >+ gtk_list_store_set (model, &iter, WPA_KEY_TYPE_NAME_COL, name, >+ WPA_KEY_TYPE_CIPHER_COL, NM_PHASE2_AUTH_MSCHAPV2, -1); >+ >+ name = _("GTC"); >+ gtk_list_store_append (model, &iter); >+ gtk_list_store_set (model, &iter, WPA_KEY_TYPE_NAME_COL, name, >+ WPA_KEY_TYPE_CIPHER_COL, NM_PHASE2_AUTH_GTC, -1); >+ >+ *num_added = 4; >+ return GTK_TREE_MODEL (model); >+} >+ >--- branches/network-manager-applet-0-6/src/wso-wpa-eap.c 2007/02/02 15:48:42 3 >+++ branches/network-manager-applet-0-6/src/wso-wpa-eap.c 2007/02/03 19:29:52 7 >@@ -41,6 +41,7 @@ > { > int eap_method; > int key_type; >+ int phase2_type; > const char * identity; > const char * passwd; > const char * anon_identity; >@@ -176,6 +177,11 @@ > gtk_combo_box_get_active_iter (GTK_COMBO_BOX (entry), &tree_iter); > gtk_tree_model_get (model, &tree_iter, WPA_KEY_TYPE_CIPHER_COL, &opt->data->key_type, -1); > >+ entry = glade_xml_get_widget (opt->uixml, "wpa_eap_phase2_type_combo"); >+ model = gtk_combo_box_get_model (GTK_COMBO_BOX (entry)); >+ gtk_combo_box_get_active_iter (GTK_COMBO_BOX (entry), &tree_iter); >+ gtk_tree_model_get (model, &tree_iter, WPA_KEY_TYPE_CIPHER_COL, &opt->data->phase2_type, -1); >+ > entry = glade_xml_get_widget (opt->uixml, "wpa_eap_identity_entry"); > opt->data->identity = gtk_entry_get_text (GTK_ENTRY (entry)) ? : ""; > >@@ -200,7 +206,7 @@ > dbus_message_iter_init_append (message, &dbus_iter); > > nmu_security_serialize_wpa_eap_with_cipher (&dbus_iter, >- opt->data->eap_method, >+ opt->data->eap_method | opt->data->phase2_type, > opt->data->key_type, > opt->data->identity, > opt->data->passwd, >@@ -224,6 +230,7 @@ > OptData * data = NULL; > GtkWidget * eap_method_combo; > GtkWidget * key_type_combo; >+ GtkWidget * phase2_type_combo; > GtkListStore * model; > GtkTreeModel * tree_model; > GtkTreeIter iter; >@@ -285,10 +292,18 @@ > if (num_added == 1) > gtk_widget_set_sensitive (key_type_combo, FALSE); > >+ phase2_type_combo = glade_xml_get_widget (opt->uixml, "wpa_eap_phase2_type_combo"); >+ tree_model = wso_wpa_create_phase2_type_model (capabilities, TRUE, &num_added); >+ gtk_combo_box_set_model (GTK_COMBO_BOX (phase2_type_combo), tree_model); >+ gtk_tree_model_get_iter_first (tree_model, &iter); >+ gtk_combo_box_set_active_iter (GTK_COMBO_BOX (phase2_type_combo), &iter); >+ > /* FIXME: Why do we need this here but not in the same place in wso-wpa-psk.c ? */ > renderer = gtk_cell_renderer_text_new (); > gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (key_type_combo), renderer, TRUE); > gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (key_type_combo), renderer, "text", 0, NULL); >+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (phase2_type_combo), renderer, TRUE); >+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (phase2_type_combo), renderer, "text", 0, NULL); > > /* Option-specific data */ > opt->data = data = g_malloc0 (sizeof (OptData)); >--- branches/network-manager-applet-0-6/src/applet.glade 2007/02/02 15:48:42 3 >+++ branches/network-manager-applet-0-6/src/applet.glade 2007/02/03 19:29:52 7 >@@ -2462,7 +2462,7 @@ > <widget class="GtkTable" id="wpa_eap_table"> > <property name="border_width">8</property> > <property name="visible">True</property> >- <property name="n_rows">10</property> >+ <property name="n_rows">11</property> > <property name="n_columns">2</property> > <property name="homogeneous">False</property> > <property name="row_spacing">6</property> >@@ -2489,8 +2489,8 @@ > <packing> > <property name="left_attach">0</property> > <property name="right_attach">1</property> >- <property name="top_attach">6</property> >- <property name="bottom_attach">7</property> >+ <property name="top_attach">7</property> >+ <property name="bottom_attach">8</property> > <property name="x_options">fill</property> > <property name="y_options"></property> > </packing> >@@ -2517,8 +2517,8 @@ > <packing> > <property name="left_attach">0</property> > <property name="right_attach">1</property> >- <property name="top_attach">7</property> >- <property name="bottom_attach">8</property> >+ <property name="top_attach">8</property> >+ <property name="bottom_attach">9</property> > <property name="x_options">fill</property> > <property name="y_options"></property> > </packing> >@@ -2537,8 +2537,8 @@ > <packing> > <property name="left_attach">1</property> > <property name="right_attach">2</property> >- <property name="top_attach">6</property> >- <property name="bottom_attach">7</property> >+ <property name="top_attach">7</property> >+ <property name="bottom_attach">8</property> > <property name="x_options">fill</property> > <property name="y_options">fill</property> > </packing> >@@ -2557,8 +2557,8 @@ > <packing> > <property name="left_attach">1</property> > <property name="right_attach">2</property> >- <property name="top_attach">7</property> >- <property name="bottom_attach">8</property> >+ <property name="top_attach">8</property> >+ <property name="bottom_attach">9</property> > <property name="x_options">fill</property> > <property name="y_options">fill</property> > </packing> >@@ -2585,8 +2585,8 @@ > <packing> > <property name="left_attach">0</property> > <property name="right_attach">1</property> >- <property name="top_attach">8</property> >- <property name="bottom_attach">9</property> >+ <property name="top_attach">9</property> >+ <property name="bottom_attach">10</property> > <property name="x_options">fill</property> > <property name="y_options"></property> > </packing> >@@ -2606,8 +2606,8 @@ > <packing> > <property name="left_attach">1</property> > <property name="right_attach">2</property> >- <property name="top_attach">8</property> >- <property name="bottom_attach">9</property> >+ <property name="top_attach">9</property> >+ <property name="bottom_attach">10</property> > <property name="y_options"></property> > </packing> > </child> >@@ -2633,8 +2633,8 @@ > <packing> > <property name="left_attach">0</property> > <property name="right_attach">1</property> >- <property name="top_attach">5</property> >- <property name="bottom_attach">6</property> >+ <property name="top_attach">6</property> >+ <property name="bottom_attach">7</property> > <property name="x_options">fill</property> > <property name="y_options"></property> > </packing> >@@ -2653,8 +2653,8 @@ > <packing> > <property name="left_attach">1</property> > <property name="right_attach">2</property> >- <property name="top_attach">5</property> >- <property name="bottom_attach">6</property> >+ <property name="top_attach">6</property> >+ <property name="bottom_attach">7</property> > <property name="x_options">fill</property> > <property name="y_options">fill</property> > </packing> >@@ -2681,8 +2681,8 @@ > <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="top_attach">3</property> >+ <property name="bottom_attach">4</property> > <property name="x_options">fill</property> > <property name="y_options"></property> > </packing> >@@ -2709,8 +2709,8 @@ > <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="top_attach">4</property> >+ <property name="bottom_attach">5</property> > <property name="x_options">fill</property> > <property name="y_options"></property> > </packing> >@@ -2737,8 +2737,8 @@ > <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="top_attach">5</property> >+ <property name="bottom_attach">6</property> > <property name="x_options">fill</property> > <property name="y_options"></property> > </packing> >@@ -2758,8 +2758,8 @@ > <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="top_attach">3</property> >+ <property name="bottom_attach">4</property> > <property name="y_options"></property> > </packing> > </child> >@@ -2778,8 +2778,8 @@ > <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="top_attach">4</property> >+ <property name="bottom_attach">5</property> > <property name="y_options"></property> > </packing> > </child> >@@ -2798,8 +2798,8 @@ > <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="top_attach">5</property> >+ <property name="bottom_attach">6</property> > <property name="y_options"></property> > </packing> > </child> >@@ -2869,8 +2869,8 @@ > <packing> > <property name="left_attach">0</property> > <property name="right_attach">1</property> >- <property name="top_attach">9</property> >- <property name="bottom_attach">10</property> >+ <property name="top_attach">10</property> >+ <property name="bottom_attach">11</property> > <property name="x_options">fill</property> > <property name="y_options"></property> > </packing> >@@ -2891,8 +2891,8 @@ > <packing> > <property name="left_attach">1</property> > <property name="right_attach">2</property> >- <property name="top_attach">9</property> >- <property name="bottom_attach">10</property> >+ <property name="top_attach">10</property> >+ <property name="bottom_attach">11</property> > <property name="x_options">fill</property> > <property name="y_options"></property> > </packing> >@@ -2941,6 +2941,50 @@ > <property name="y_options">fill</property> > </packing> > </child> >+ >+ <child> >+ <widget class="GtkComboBox" id="wpa_eap_phase2_type_combo"> >+ <property name="visible">True</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> >+ >+ <child> >+ <widget class="GtkLabel" id="wpa_eap_phase2_type_label"> >+ <property name="visible">True</property> >+ <property name="label" translatable="yes">Phase2 Type:</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> > </widget> > <packing> > <property name="tab_expand">False</property> >--- branches/network-manager-applet-0-6/src/applet.c 2007/02/02 15:48:42 3 >+++ branches/network-manager-applet-0-6/src/applet.c 2007/03/07 20:30:29 51 >@@ -2559,6 +2559,9 @@ > */ > nma_compat_convert_oldformat_entries (applet->gconf_client); > >+ /* Load pixmaps and create applet widgets */ >+ nma_setup_widgets (applet); >+ > /* D-Bus init stuff */ > dbus_g_thread_init (); > applet->nmi_methods = nmi_dbus_nmi_methods_setup (); >@@ -2566,9 +2569,6 @@ > if (!applet->connection) > nma_start_dbus_connection_watch (applet); > >- /* Load pixmaps and create applet widgets */ >- nma_setup_widgets (applet); >- > g_signal_connect (applet, "destroy", G_CALLBACK (nma_destroy), NULL); > g_signal_connect (applet, "style-set", G_CALLBACK (nma_theme_change_cb), NULL); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 216063
:
142438
| 142439 |
142440
|
142539