network: Remove EAP constructor parameters that were never changed
This commit is contained in:
parent
7d9d4d4289
commit
4bc58cac44
18 changed files with 86 additions and 290 deletions
|
@ -73,7 +73,7 @@ finish_setup (CEPage8021xSecurity *self, gpointer unused, GError *error, gpointe
|
|||
|
||||
self->group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||
|
||||
self->security = ws_wpa_eap_new (self->connection, TRUE, FALSE);
|
||||
self->security = ws_wpa_eap_new (self->connection);
|
||||
if (!self->security) {
|
||||
g_warning ("Could not load 802.1x user interface.");
|
||||
return;
|
||||
|
|
|
@ -312,7 +312,7 @@ finish_setup (CEPageSecurity *self)
|
|||
if (nm_utils_security_valid (NMU_SEC_DYNAMIC_WEP, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
|
||||
WirelessSecurityDynamicWEP *ws_dynamic_wep;
|
||||
|
||||
ws_dynamic_wep = ws_dynamic_wep_new (self->connection, TRUE, FALSE);
|
||||
ws_dynamic_wep = ws_dynamic_wep_new (self->connection);
|
||||
if (ws_dynamic_wep) {
|
||||
add_security_item (self, WIRELESS_SECURITY (ws_dynamic_wep), sec_model,
|
||||
&iter, _("Dynamic WEP (802.1x)"), FALSE);
|
||||
|
@ -340,7 +340,7 @@ finish_setup (CEPageSecurity *self)
|
|||
nm_utils_security_valid (NMU_SEC_WPA2_ENTERPRISE, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
|
||||
WirelessSecurityWPAEAP *ws_wpa_eap;
|
||||
|
||||
ws_wpa_eap = ws_wpa_eap_new (self->connection, TRUE, FALSE);
|
||||
ws_wpa_eap = ws_wpa_eap_new (self->connection);
|
||||
if (ws_wpa_eap) {
|
||||
add_security_item (self, WIRELESS_SECURITY (ws_wpa_eap), sec_model,
|
||||
&iter, _("WPA & WPA2 Enterprise"), FALSE);
|
||||
|
|
|
@ -47,8 +47,6 @@ struct _EAPMethodFAST {
|
|||
|
||||
EAPMethodSimple *em_gtc;
|
||||
EAPMethodSimple *em_mschap_v2;
|
||||
|
||||
gboolean is_editor;
|
||||
};
|
||||
|
||||
static void eap_method_iface_init (EAPMethodInterface *);
|
||||
|
@ -303,21 +301,17 @@ eap_method_iface_init (EAPMethodInterface *iface)
|
|||
}
|
||||
|
||||
EAPMethodFAST *
|
||||
eap_method_fast_new (NMConnection *connection,
|
||||
gboolean is_editor,
|
||||
gboolean secrets_only)
|
||||
eap_method_fast_new (NMConnection *connection)
|
||||
{
|
||||
EAPMethodFAST *self;
|
||||
GtkFileFilter *filter;
|
||||
NMSetting8021x *s_8021x = NULL;
|
||||
const char *filename;
|
||||
gboolean provisioning_enabled = TRUE;
|
||||
EAPMethodSimpleFlags simple_flags;
|
||||
const gchar *phase2_auth = NULL;
|
||||
GtkTreeIter iter;
|
||||
|
||||
self = g_object_new (eap_method_fast_get_type (), NULL);
|
||||
self->is_editor = is_editor;
|
||||
|
||||
if (connection)
|
||||
s_8021x = nm_connection_get_setting_802_1x (connection);
|
||||
|
@ -368,21 +362,15 @@ eap_method_fast_new (NMConnection *connection,
|
|||
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (self->pac_file_button), filename);
|
||||
}
|
||||
|
||||
simple_flags = EAP_METHOD_SIMPLE_FLAG_PHASE2;
|
||||
if (self->is_editor)
|
||||
simple_flags |= EAP_METHOD_SIMPLE_FLAG_IS_EDITOR;
|
||||
if (secrets_only)
|
||||
simple_flags |= EAP_METHOD_SIMPLE_FLAG_SECRETS_ONLY;
|
||||
|
||||
self->em_gtc = eap_method_simple_new (connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_GTC,
|
||||
simple_flags);
|
||||
TRUE, FALSE);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_gtc));
|
||||
g_signal_connect_object (self->em_gtc, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_mschap_v2 = eap_method_simple_new (connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_MSCHAP_V2,
|
||||
simple_flags);
|
||||
TRUE, FALSE);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_mschap_v2));
|
||||
g_signal_connect_object (self->em_mschap_v2, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
|
@ -407,17 +395,6 @@ eap_method_fast_new (NMConnection *connection,
|
|||
g_signal_connect_swapped (self->inner_auth_combo, "changed", G_CALLBACK (inner_auth_combo_changed_cb), self);
|
||||
inner_auth_combo_changed_cb (self);
|
||||
|
||||
if (secrets_only) {
|
||||
gtk_widget_hide (GTK_WIDGET (self->anon_identity_label));
|
||||
gtk_widget_hide (GTK_WIDGET (self->anon_identity_entry));
|
||||
gtk_widget_hide (GTK_WIDGET (self->pac_provision_check));
|
||||
gtk_widget_hide (GTK_WIDGET (self->pac_provision_combo));
|
||||
gtk_widget_hide (GTK_WIDGET (self->pac_file_label));
|
||||
gtk_widget_hide (GTK_WIDGET (self->pac_file_button));
|
||||
gtk_widget_hide (GTK_WIDGET (self->inner_auth_label));
|
||||
gtk_widget_hide (GTK_WIDGET (self->inner_auth_combo));
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,8 +29,6 @@ G_BEGIN_DECLS
|
|||
|
||||
G_DECLARE_FINAL_TYPE (EAPMethodFAST, eap_method_fast, EAP, METHOD_FAST, GtkGrid)
|
||||
|
||||
EAPMethodFAST *eap_method_fast_new (NMConnection *connection,
|
||||
gboolean is_editor,
|
||||
gboolean secrets_only);
|
||||
EAPMethodFAST *eap_method_fast_new (NMConnection *connection);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -36,8 +36,6 @@ struct _EAPMethodLEAP {
|
|||
GtkCheckButton *show_password_check;
|
||||
GtkEntry *username_entry;
|
||||
GtkLabel *username_label;
|
||||
|
||||
gboolean editing_connection;
|
||||
};
|
||||
|
||||
static void eap_method_iface_init (EAPMethodInterface *);
|
||||
|
@ -110,9 +108,8 @@ fill_connection (EAPMethod *parent, NMConnection *connection, NMSettingSecretFla
|
|||
secret_flags, NULL);
|
||||
|
||||
/* Update secret flags and popup when editing the connection */
|
||||
if (self->editing_connection)
|
||||
nma_utils_update_password_storage (GTK_WIDGET (self->password_entry), secret_flags,
|
||||
NM_SETTING (s_8021x), NM_SETTING_802_1X_PASSWORD);
|
||||
nma_utils_update_password_storage (GTK_WIDGET (self->password_entry), secret_flags,
|
||||
NM_SETTING (s_8021x), NM_SETTING_802_1X_PASSWORD);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -238,27 +235,22 @@ eap_method_iface_init (EAPMethodInterface *iface)
|
|||
}
|
||||
|
||||
EAPMethodLEAP *
|
||||
eap_method_leap_new (NMConnection *connection,
|
||||
gboolean secrets_only)
|
||||
eap_method_leap_new (NMConnection *connection)
|
||||
{
|
||||
EAPMethodLEAP *self;
|
||||
NMSetting8021x *s_8021x = NULL;
|
||||
|
||||
self = g_object_new (eap_method_leap_get_type (), NULL);
|
||||
self->editing_connection = secrets_only ? FALSE : TRUE;
|
||||
|
||||
g_signal_connect_swapped (self->username_entry, "changed", G_CALLBACK (changed_cb), self);
|
||||
|
||||
if (secrets_only)
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (self->username_entry), FALSE);
|
||||
|
||||
g_signal_connect_swapped (self->password_entry, "changed", G_CALLBACK (changed_cb), self);
|
||||
|
||||
/* Create password-storage popup menu for password entry under entry's secondary icon */
|
||||
if (connection)
|
||||
s_8021x = nm_connection_get_setting_802_1x (connection);
|
||||
nma_utils_setup_password_storage (GTK_WIDGET (self->password_entry), 0, (NMSetting *) s_8021x, NM_SETTING_802_1X_PASSWORD,
|
||||
FALSE, secrets_only);
|
||||
FALSE, FALSE);
|
||||
|
||||
g_signal_connect_swapped (self->show_password_check, "toggled", G_CALLBACK (show_toggled_cb), self);
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ G_BEGIN_DECLS
|
|||
|
||||
G_DECLARE_FINAL_TYPE (EAPMethodLEAP, eap_method_leap, EAP, METHOD_LEAP, GtkGrid)
|
||||
|
||||
EAPMethodLEAP *eap_method_leap_new (NMConnection *connection,
|
||||
gboolean secrets_only);
|
||||
EAPMethodLEAP *eap_method_leap_new (NMConnection *connection);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -49,8 +49,6 @@ struct _EAPMethodPEAP {
|
|||
EAPMethodSimple *em_gtc;
|
||||
EAPMethodSimple *em_md5;
|
||||
EAPMethodSimple *em_mschap_v2;
|
||||
|
||||
gboolean is_editor;
|
||||
};
|
||||
|
||||
static void eap_method_iface_init (EAPMethodInterface *);
|
||||
|
@ -309,20 +307,16 @@ eap_method_iface_init (EAPMethodInterface *iface)
|
|||
}
|
||||
|
||||
EAPMethodPEAP *
|
||||
eap_method_peap_new (NMConnection *connection,
|
||||
gboolean is_editor,
|
||||
gboolean secrets_only)
|
||||
eap_method_peap_new (NMConnection *connection)
|
||||
{
|
||||
EAPMethodPEAP *self;
|
||||
GtkFileFilter *filter;
|
||||
NMSetting8021x *s_8021x = NULL;
|
||||
const char *filename;
|
||||
EAPMethodSimpleFlags simple_flags;
|
||||
const gchar *phase2_auth = NULL;
|
||||
GtkTreeIter iter;
|
||||
|
||||
self = g_object_new (eap_method_peap_get_type (), NULL);
|
||||
self->is_editor = is_editor;
|
||||
|
||||
if (connection)
|
||||
s_8021x = nm_connection_get_setting_802_1x (connection);
|
||||
|
@ -346,27 +340,21 @@ eap_method_peap_new (NMConnection *connection,
|
|||
!filename && eap_method_ca_cert_ignore_get (EAP_METHOD (self), connection));
|
||||
}
|
||||
|
||||
simple_flags = EAP_METHOD_SIMPLE_FLAG_PHASE2;
|
||||
if (self->is_editor)
|
||||
simple_flags |= EAP_METHOD_SIMPLE_FLAG_IS_EDITOR;
|
||||
if (secrets_only)
|
||||
simple_flags |= EAP_METHOD_SIMPLE_FLAG_SECRETS_ONLY;
|
||||
|
||||
self->em_mschap_v2 = eap_method_simple_new (connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_MSCHAP_V2,
|
||||
simple_flags);
|
||||
TRUE, FALSE);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_mschap_v2));
|
||||
g_signal_connect_object (self->em_mschap_v2, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_md5 = eap_method_simple_new (connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_MD5,
|
||||
simple_flags);
|
||||
TRUE, FALSE);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_md5));
|
||||
g_signal_connect_object (self->em_md5, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_gtc = eap_method_simple_new (connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_GTC,
|
||||
simple_flags);
|
||||
TRUE, FALSE);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_gtc));
|
||||
g_signal_connect_object (self->em_gtc, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
|
@ -410,18 +398,6 @@ eap_method_peap_new (NMConnection *connection,
|
|||
gtk_entry_set_text (self->anon_identity_entry, nm_setting_802_1x_get_anonymous_identity (s_8021x));
|
||||
g_signal_connect_swapped (self->anon_identity_entry, "changed", G_CALLBACK (changed_cb), self);
|
||||
|
||||
if (secrets_only) {
|
||||
gtk_widget_hide (GTK_WIDGET (self->anon_identity_label));
|
||||
gtk_widget_hide (GTK_WIDGET (self->anon_identity_entry));
|
||||
gtk_widget_hide (GTK_WIDGET (self->ca_cert_label));
|
||||
gtk_widget_hide (GTK_WIDGET (self->ca_cert_button));
|
||||
gtk_widget_hide (GTK_WIDGET (self->ca_cert_not_required_check));
|
||||
gtk_widget_hide (GTK_WIDGET (self->inner_auth_label));
|
||||
gtk_widget_hide (GTK_WIDGET (self->inner_auth_combo));
|
||||
gtk_widget_hide (GTK_WIDGET (self->version_label));
|
||||
gtk_widget_hide (GTK_WIDGET (self->version_combo));
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,8 +29,6 @@ G_BEGIN_DECLS
|
|||
|
||||
G_DECLARE_FINAL_TYPE (EAPMethodPEAP, eap_method_peap, EAP, METHOD_PEAP, GtkGrid)
|
||||
|
||||
EAPMethodPEAP *eap_method_peap_new (NMConnection *connection,
|
||||
gboolean is_editor,
|
||||
gboolean secrets_only);
|
||||
EAPMethodPEAP *eap_method_peap_new (NMConnection *connection);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -38,7 +38,8 @@ struct _EAPMethodSimple {
|
|||
GtkLabel *username_label;
|
||||
|
||||
EAPMethodSimpleType type;
|
||||
EAPMethodSimpleFlags flags;
|
||||
gboolean phase2;
|
||||
gboolean autheap_allowed;
|
||||
|
||||
guint idle_func_id;
|
||||
};
|
||||
|
@ -147,7 +148,7 @@ fill_connection (EAPMethod *method, NMConnection *connection, NMSettingSecretFla
|
|||
* supports being an inner EAP method, then set PHASE2_AUTHEAP.
|
||||
* Otherwise the inner/phase2 method goes into PHASE2_AUTH.
|
||||
*/
|
||||
if ((self->flags & EAP_METHOD_SIMPLE_FLAG_AUTHEAP_ALLOWED) && eap_type->autheap_allowed) {
|
||||
if (self->autheap_allowed && eap_type->autheap_allowed) {
|
||||
g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTHEAP, eap_type->name, NULL);
|
||||
g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, NULL, NULL);
|
||||
} else {
|
||||
|
@ -169,14 +170,12 @@ fill_connection (EAPMethod *method, NMConnection *connection, NMSettingSecretFla
|
|||
* back to NM in response to a GetSecrets() call, we don't save it if the
|
||||
* user checked "Always Ask".
|
||||
*/
|
||||
if (!(self->flags & EAP_METHOD_SIMPLE_FLAG_IS_EDITOR) || not_saved == FALSE)
|
||||
if (not_saved == FALSE)
|
||||
g_object_set (s_8021x, NM_SETTING_802_1X_PASSWORD, gtk_entry_get_text (self->password_entry), NULL);
|
||||
|
||||
/* Update secret flags and popup when editing the connection */
|
||||
if (!(self->flags & EAP_METHOD_SIMPLE_FLAG_SECRETS_ONLY)) {
|
||||
nma_utils_update_password_storage (GTK_WIDGET (self->password_entry), flags,
|
||||
NM_SETTING (s_8021x), NM_SETTING_802_1X_PASSWORD);
|
||||
}
|
||||
nma_utils_update_password_storage (GTK_WIDGET (self->password_entry), flags,
|
||||
NM_SETTING (s_8021x), NM_SETTING_802_1X_PASSWORD);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -206,7 +205,7 @@ static const gboolean
|
|||
get_phase2 (EAPMethod *method)
|
||||
{
|
||||
EAPMethodSimple *self = EAP_METHOD_SIMPLE (method);
|
||||
return self->flags & EAP_METHOD_SIMPLE_FLAG_PHASE2;
|
||||
return self->phase2;
|
||||
}
|
||||
|
||||
static const gchar *
|
||||
|
@ -263,18 +262,16 @@ static void
|
|||
password_storage_changed (EAPMethodSimple *self)
|
||||
{
|
||||
gboolean always_ask;
|
||||
gboolean secrets_only = self->flags & EAP_METHOD_SIMPLE_FLAG_SECRETS_ONLY;
|
||||
|
||||
always_ask = always_ask_selected (self->password_entry);
|
||||
|
||||
if (always_ask && !secrets_only) {
|
||||
if (always_ask) {
|
||||
/* we always clear this button and do not restore it
|
||||
* (because we want to hide the password). */
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->show_password_check), FALSE);
|
||||
}
|
||||
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (self->show_password_check),
|
||||
!always_ask || secrets_only);
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (self->show_password_check), !always_ask);
|
||||
|
||||
if (!self->idle_func_id)
|
||||
self->idle_func_id = g_idle_add ((GSourceFunc) stuff_changed, self);
|
||||
|
@ -345,30 +342,26 @@ eap_method_iface_init (EAPMethodInterface *iface)
|
|||
}
|
||||
|
||||
EAPMethodSimple *
|
||||
eap_method_simple_new (NMConnection *connection,
|
||||
EAPMethodSimpleType type,
|
||||
EAPMethodSimpleFlags flags)
|
||||
eap_method_simple_new (NMConnection *connection, EAPMethodSimpleType type, gboolean phase2, gboolean autheap_allowed)
|
||||
{
|
||||
EAPMethodSimple *self;
|
||||
NMSetting8021x *s_8021x = NULL;
|
||||
|
||||
self = g_object_new (eap_method_simple_get_type (), NULL);
|
||||
self->flags = flags;
|
||||
self->type = type;
|
||||
self->phase2 = phase2;
|
||||
self->autheap_allowed = autheap_allowed;
|
||||
g_assert (type < EAP_METHOD_SIMPLE_TYPE_LAST);
|
||||
|
||||
g_signal_connect_swapped (self->username_entry, "changed", G_CALLBACK (changed_cb), self);
|
||||
|
||||
if (self->flags & EAP_METHOD_SIMPLE_FLAG_SECRETS_ONLY)
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (self->username_entry), FALSE);
|
||||
|
||||
g_signal_connect_swapped (self->password_entry, "changed", G_CALLBACK (changed_cb), self);
|
||||
|
||||
/* Create password-storage popup menu for password entry under entry's secondary icon */
|
||||
if (connection)
|
||||
s_8021x = nm_connection_get_setting_802_1x (connection);
|
||||
nma_utils_setup_password_storage (GTK_WIDGET (self->password_entry), 0, (NMSetting *) s_8021x, NM_SETTING_802_1X_PASSWORD,
|
||||
FALSE, flags & EAP_METHOD_SIMPLE_FLAG_SECRETS_ONLY);
|
||||
FALSE, FALSE);
|
||||
|
||||
g_signal_connect_swapped (self->password_entry, "notify::secondary-icon-name", G_CALLBACK (password_storage_changed), self);
|
||||
|
||||
|
|
|
@ -44,20 +44,9 @@ typedef enum {
|
|||
EAP_METHOD_SIMPLE_TYPE_LAST
|
||||
} EAPMethodSimpleType;
|
||||
|
||||
typedef enum {
|
||||
EAP_METHOD_SIMPLE_FLAG_NONE = 0x00,
|
||||
/* Indicates the EAP method is an inner/phase2 method */
|
||||
EAP_METHOD_SIMPLE_FLAG_PHASE2 = 0x01,
|
||||
/* Set by TTLS to indicate that inner/phase2 EAP is allowed */
|
||||
EAP_METHOD_SIMPLE_FLAG_AUTHEAP_ALLOWED = 0x02,
|
||||
/* Set from nm-connection-editor or the GNOME network panel */
|
||||
EAP_METHOD_SIMPLE_FLAG_IS_EDITOR = 0x04,
|
||||
/* Set to indicate that this request is only for secrets */
|
||||
EAP_METHOD_SIMPLE_FLAG_SECRETS_ONLY = 0x08
|
||||
} EAPMethodSimpleFlags;
|
||||
|
||||
EAPMethodSimple *eap_method_simple_new (NMConnection *connection,
|
||||
EAPMethodSimpleType type,
|
||||
EAPMethodSimpleFlags flags);
|
||||
gboolean phase2,
|
||||
gboolean autheap_allowed);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -44,9 +44,7 @@ struct _EAPMethodTLS {
|
|||
GtkFileChooserButton *user_cert_button;
|
||||
GtkLabel *user_cert_label;
|
||||
|
||||
gboolean phase2;
|
||||
const gchar *password_flags_name;
|
||||
gboolean editing_connection;
|
||||
gchar *username;
|
||||
gchar *password;
|
||||
gboolean show_password;
|
||||
|
@ -175,14 +173,13 @@ fill_connection (EAPMethod *method, NMConnection *connection, NMSettingSecretFla
|
|||
g_autofree gchar *pk_filename = NULL;
|
||||
const char *password = NULL;
|
||||
gboolean ca_cert_error = FALSE;
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(GError) error2 = NULL;
|
||||
|
||||
s_8021x = nm_connection_get_setting_802_1x (connection);
|
||||
g_assert (s_8021x);
|
||||
|
||||
if (self->phase2)
|
||||
g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, "tls", NULL);
|
||||
else
|
||||
nm_setting_802_1x_add_eap_method (s_8021x, "tls");
|
||||
nm_setting_802_1x_add_eap_method (s_8021x, "tls");
|
||||
|
||||
g_object_set (s_8021x, NM_SETTING_802_1X_IDENTITY, gtk_entry_get_text (self->identity_entry), NULL);
|
||||
|
||||
|
@ -192,30 +189,22 @@ fill_connection (EAPMethod *method, NMConnection *connection, NMSettingSecretFla
|
|||
pk_filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (self->private_key_button));
|
||||
g_assert (pk_filename);
|
||||
|
||||
if (self->phase2) {
|
||||
g_autoptr(GError) error = NULL;
|
||||
if (!nm_setting_802_1x_set_phase2_private_key (s_8021x, pk_filename, password, NM_SETTING_802_1X_CK_SCHEME_PATH, &format, &error))
|
||||
g_warning ("Couldn't read phase2 private key '%s': %s", pk_filename, error ? error->message : "(unknown)");
|
||||
} else {
|
||||
g_autoptr(GError) error = NULL;
|
||||
if (!nm_setting_802_1x_set_private_key (s_8021x, pk_filename, password, NM_SETTING_802_1X_CK_SCHEME_PATH, &format, &error))
|
||||
g_warning ("Couldn't read private key '%s': %s", pk_filename, error ? error->message : "(unknown)");
|
||||
}
|
||||
if (!nm_setting_802_1x_set_private_key (s_8021x, pk_filename, password, NM_SETTING_802_1X_CK_SCHEME_PATH, &format, &error))
|
||||
g_warning ("Couldn't read private key '%s': %s", pk_filename, error ? error->message : "(unknown)");
|
||||
|
||||
/* Save 802.1X password flags to the connection */
|
||||
secret_flags = nma_utils_menu_to_secret_flags (GTK_WIDGET (self->private_key_password_entry));
|
||||
nm_setting_set_secret_flags (NM_SETTING (s_8021x), self->password_flags_name,
|
||||
nm_setting_set_secret_flags (NM_SETTING (s_8021x), NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD,
|
||||
secret_flags, NULL);
|
||||
|
||||
/* Update secret flags and popup when editing the connection */
|
||||
if (self->editing_connection) {
|
||||
nma_utils_update_password_storage (GTK_WIDGET (self->private_key_password_entry), secret_flags,
|
||||
NM_SETTING (s_8021x), self->password_flags_name);
|
||||
}
|
||||
nma_utils_update_password_storage (GTK_WIDGET (self->private_key_password_entry), secret_flags,
|
||||
NM_SETTING (s_8021x), NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD);
|
||||
|
||||
/* TLS client certificate */
|
||||
if (format != NM_SETTING_802_1X_CK_FORMAT_PKCS12) {
|
||||
g_autofree gchar *cc_filename = NULL;
|
||||
g_autoptr(GError) error = NULL;
|
||||
|
||||
/* If the key is pkcs#12 nm_setting_802_1x_set_private_key() already
|
||||
* set the client certificate for us.
|
||||
|
@ -224,33 +213,17 @@ fill_connection (EAPMethod *method, NMConnection *connection, NMSettingSecretFla
|
|||
g_assert (cc_filename);
|
||||
|
||||
format = NM_SETTING_802_1X_CK_FORMAT_UNKNOWN;
|
||||
if (self->phase2) {
|
||||
g_autoptr(GError) error = NULL;
|
||||
if (!nm_setting_802_1x_set_phase2_client_cert (s_8021x, cc_filename, NM_SETTING_802_1X_CK_SCHEME_PATH, &format, &error))
|
||||
g_warning ("Couldn't read phase2 client certificate '%s': %s", cc_filename, error ? error->message : "(unknown)");
|
||||
} else {
|
||||
g_autoptr(GError) error = NULL;
|
||||
if (!nm_setting_802_1x_set_client_cert (s_8021x, cc_filename, NM_SETTING_802_1X_CK_SCHEME_PATH, &format, &error))
|
||||
g_warning ("Couldn't read client certificate '%s': %s", cc_filename, error ? error->message : "(unknown)");
|
||||
}
|
||||
if (!nm_setting_802_1x_set_client_cert (s_8021x, cc_filename, NM_SETTING_802_1X_CK_SCHEME_PATH, &format, &error))
|
||||
g_warning ("Couldn't read client certificate '%s': %s", cc_filename, error ? error->message : "(unknown)");
|
||||
}
|
||||
|
||||
/* TLS CA certificate */
|
||||
ca_filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (self->ca_cert_button));
|
||||
|
||||
format = NM_SETTING_802_1X_CK_FORMAT_UNKNOWN;
|
||||
if (self->phase2) {
|
||||
g_autoptr(GError) error = NULL;
|
||||
if (!nm_setting_802_1x_set_phase2_ca_cert (s_8021x, ca_filename, NM_SETTING_802_1X_CK_SCHEME_PATH, &format, &error)) {
|
||||
g_warning ("Couldn't read phase2 CA certificate '%s': %s", ca_filename, error ? error->message : "(unknown)");
|
||||
ca_cert_error = TRUE;
|
||||
}
|
||||
} else {
|
||||
g_autoptr(GError) error = NULL;
|
||||
if (!nm_setting_802_1x_set_ca_cert (s_8021x, ca_filename, NM_SETTING_802_1X_CK_SCHEME_PATH, &format, &error)) {
|
||||
g_warning ("Couldn't read CA certificate '%s': %s", ca_filename, error ? error->message : "(unknown)");
|
||||
ca_cert_error = TRUE;
|
||||
}
|
||||
if (!nm_setting_802_1x_set_ca_cert (s_8021x, ca_filename, NM_SETTING_802_1X_CK_SCHEME_PATH, &format, &error2)) {
|
||||
g_warning ("Couldn't read CA certificate '%s': %s", ca_filename, error2 ? error2->message : "(unknown)");
|
||||
ca_cert_error = TRUE;
|
||||
}
|
||||
eap_method_ca_cert_ignore_set (method, connection, ca_filename, ca_cert_error);
|
||||
}
|
||||
|
@ -381,30 +354,17 @@ update_secrets (EAPMethod *method, NMConnection *connection)
|
|||
{
|
||||
EAPMethodTLS *self = EAP_METHOD_TLS (method);
|
||||
NMSetting8021x *s_8021x;
|
||||
HelperSecretFunc password_func;
|
||||
SchemeFunc scheme_func;
|
||||
PathFunc path_func;
|
||||
const char *filename;
|
||||
|
||||
if (self->phase2) {
|
||||
password_func = (HelperSecretFunc) nm_setting_802_1x_get_phase2_private_key_password;
|
||||
scheme_func = nm_setting_802_1x_get_phase2_private_key_scheme;
|
||||
path_func = nm_setting_802_1x_get_phase2_private_key_path;
|
||||
} else {
|
||||
password_func = (HelperSecretFunc) nm_setting_802_1x_get_private_key_password;
|
||||
scheme_func = nm_setting_802_1x_get_private_key_scheme;
|
||||
path_func = nm_setting_802_1x_get_private_key_path;
|
||||
}
|
||||
|
||||
helper_fill_secret_entry (connection,
|
||||
self->private_key_password_entry,
|
||||
NM_TYPE_SETTING_802_1X,
|
||||
password_func);
|
||||
(HelperSecretFunc) nm_setting_802_1x_get_private_key_password);
|
||||
|
||||
/* Set the private key filepicker button path if we have a private key */
|
||||
s_8021x = nm_connection_get_setting_802_1x (connection);
|
||||
if (s_8021x && (scheme_func (s_8021x) == NM_SETTING_802_1X_CK_SCHEME_PATH)) {
|
||||
filename = path_func (s_8021x);
|
||||
if (s_8021x && (nm_setting_802_1x_get_private_key_scheme (s_8021x) == NM_SETTING_802_1X_CK_SCHEME_PATH)) {
|
||||
filename = nm_setting_802_1x_get_private_key_path (s_8021x);
|
||||
if (filename)
|
||||
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (self->private_key_button), filename);
|
||||
}
|
||||
|
@ -420,15 +380,7 @@ get_default_field (EAPMethod *method)
|
|||
static const gchar *
|
||||
get_password_flags_name (EAPMethod *method)
|
||||
{
|
||||
EAPMethodTLS *self = EAP_METHOD_TLS (method);
|
||||
return self->password_flags_name;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
get_phase2 (EAPMethod *method)
|
||||
{
|
||||
EAPMethodTLS *self = EAP_METHOD_TLS (method);
|
||||
return self->phase2;
|
||||
return NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD;
|
||||
}
|
||||
|
||||
static const gchar *
|
||||
|
@ -516,7 +468,6 @@ eap_method_iface_init (EAPMethodInterface *iface)
|
|||
iface->update_secrets = update_secrets;
|
||||
iface->get_default_field = get_default_field;
|
||||
iface->get_password_flags_name = get_password_flags_name;
|
||||
iface->get_phase2 = get_phase2;
|
||||
iface->get_username = get_username;
|
||||
iface->set_username = set_username;
|
||||
iface->get_password = get_password;
|
||||
|
@ -526,20 +477,13 @@ eap_method_iface_init (EAPMethodInterface *iface)
|
|||
}
|
||||
|
||||
EAPMethodTLS *
|
||||
eap_method_tls_new (NMConnection *connection,
|
||||
gboolean phase2,
|
||||
gboolean secrets_only)
|
||||
eap_method_tls_new (NMConnection *connection)
|
||||
{
|
||||
EAPMethodTLS *self;
|
||||
NMSetting8021x *s_8021x = NULL;
|
||||
gboolean ca_not_required = FALSE;
|
||||
|
||||
self = g_object_new (eap_method_tls_get_type (), NULL);
|
||||
self->phase2 = phase2;
|
||||
self->password_flags_name = phase2 ?
|
||||
NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD :
|
||||
NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD;
|
||||
self->editing_connection = secrets_only ? FALSE : TRUE;
|
||||
|
||||
if (connection)
|
||||
s_8021x = nm_connection_get_setting_802_1x (connection);
|
||||
|
@ -554,22 +498,22 @@ eap_method_tls_new (NMConnection *connection,
|
|||
self->user_cert_button,
|
||||
_("Choose your personal certificate"),
|
||||
s_8021x,
|
||||
phase2 ? nm_setting_802_1x_get_phase2_client_cert_scheme : nm_setting_802_1x_get_client_cert_scheme,
|
||||
phase2 ? nm_setting_802_1x_get_phase2_client_cert_path : nm_setting_802_1x_get_client_cert_path,
|
||||
nm_setting_802_1x_get_client_cert_scheme,
|
||||
nm_setting_802_1x_get_client_cert_path,
|
||||
FALSE, TRUE);
|
||||
setup_filepicker (self,
|
||||
self->ca_cert_button,
|
||||
_("Choose a Certificate Authority certificate"),
|
||||
s_8021x,
|
||||
phase2 ? nm_setting_802_1x_get_phase2_ca_cert_scheme : nm_setting_802_1x_get_ca_cert_scheme,
|
||||
phase2 ? nm_setting_802_1x_get_phase2_ca_cert_path : nm_setting_802_1x_get_ca_cert_path,
|
||||
nm_setting_802_1x_get_ca_cert_scheme,
|
||||
nm_setting_802_1x_get_ca_cert_path,
|
||||
FALSE, FALSE);
|
||||
setup_filepicker (self,
|
||||
self->private_key_button,
|
||||
_("Choose your private key"),
|
||||
s_8021x,
|
||||
phase2 ? nm_setting_802_1x_get_phase2_private_key_scheme : nm_setting_802_1x_get_private_key_scheme,
|
||||
phase2 ? nm_setting_802_1x_get_phase2_private_key_path : nm_setting_802_1x_get_private_key_path,
|
||||
nm_setting_802_1x_get_private_key_scheme,
|
||||
nm_setting_802_1x_get_private_key_path,
|
||||
TRUE, FALSE);
|
||||
|
||||
if (connection && eap_method_ca_cert_ignore_get (EAP_METHOD (self), connection))
|
||||
|
@ -583,22 +527,11 @@ eap_method_tls_new (NMConnection *connection,
|
|||
g_signal_connect_swapped (self->private_key_password_entry, "changed", G_CALLBACK (changed_cb), self);
|
||||
|
||||
/* Create password-storage popup menu for password entry under entry's secondary icon */
|
||||
nma_utils_setup_password_storage (GTK_WIDGET (self->private_key_password_entry), 0, (NMSetting *) s_8021x, self->password_flags_name,
|
||||
FALSE, secrets_only);
|
||||
nma_utils_setup_password_storage (GTK_WIDGET (self->private_key_password_entry), 0, (NMSetting *) s_8021x, NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD,
|
||||
FALSE, FALSE);
|
||||
|
||||
g_signal_connect_swapped (self->show_password_check, "toggled", G_CALLBACK (show_toggled_cb), self);
|
||||
|
||||
if (secrets_only) {
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (self->identity_entry), FALSE);
|
||||
gtk_widget_hide (GTK_WIDGET (self->user_cert_label));
|
||||
gtk_widget_hide (GTK_WIDGET (self->user_cert_button));
|
||||
gtk_widget_hide (GTK_WIDGET (self->private_key_label));
|
||||
gtk_widget_hide (GTK_WIDGET (self->private_key_button));
|
||||
gtk_widget_hide (GTK_WIDGET (self->ca_cert_label));
|
||||
gtk_widget_hide (GTK_WIDGET (self->ca_cert_button));
|
||||
gtk_widget_hide (GTK_WIDGET (self->ca_cert_not_required_check));
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,8 +29,6 @@ G_BEGIN_DECLS
|
|||
|
||||
G_DECLARE_FINAL_TYPE (EAPMethodTLS, eap_method_tls, EAP, METHOD_TLS, GtkGrid)
|
||||
|
||||
EAPMethodTLS *eap_method_tls_new (NMConnection *connection,
|
||||
gboolean phase2,
|
||||
gboolean secrets_only);
|
||||
EAPMethodTLS *eap_method_tls_new (NMConnection *connection);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -52,8 +52,6 @@ struct _EAPMethodTTLS {
|
|||
EAPMethodSimple *em_mschap_v2;
|
||||
EAPMethodSimple *em_pap;
|
||||
EAPMethodSimple *em_plain_mschap_v2;
|
||||
|
||||
gboolean is_editor;
|
||||
};
|
||||
|
||||
static void eap_method_iface_init (EAPMethodInterface *);
|
||||
|
@ -317,20 +315,16 @@ eap_method_iface_init (EAPMethodInterface *iface)
|
|||
}
|
||||
|
||||
EAPMethodTTLS *
|
||||
eap_method_ttls_new (NMConnection *connection,
|
||||
gboolean is_editor,
|
||||
gboolean secrets_only)
|
||||
eap_method_ttls_new (NMConnection *connection)
|
||||
{
|
||||
EAPMethodTTLS *self;
|
||||
GtkFileFilter *filter;
|
||||
NMSetting8021x *s_8021x = NULL;
|
||||
const char *filename;
|
||||
EAPMethodSimpleFlags simple_flags;
|
||||
const char *phase2_auth = NULL;
|
||||
GtkTreeIter iter;
|
||||
|
||||
self = g_object_new (eap_method_ttls_get_type (), NULL);
|
||||
self->is_editor = is_editor;
|
||||
|
||||
if (connection)
|
||||
s_8021x = nm_connection_get_setting_802_1x (connection);
|
||||
|
@ -361,51 +355,45 @@ eap_method_ttls_new (NMConnection *connection,
|
|||
gtk_entry_set_text (self->domain_match_entry, nm_setting_802_1x_get_domain_suffix_match (s_8021x));
|
||||
g_signal_connect_swapped (self->domain_match_entry, "changed", G_CALLBACK (changed_cb), self);
|
||||
|
||||
simple_flags = EAP_METHOD_SIMPLE_FLAG_PHASE2 | EAP_METHOD_SIMPLE_FLAG_AUTHEAP_ALLOWED;
|
||||
if (self->is_editor)
|
||||
simple_flags |= EAP_METHOD_SIMPLE_FLAG_IS_EDITOR;
|
||||
if (secrets_only)
|
||||
simple_flags |= EAP_METHOD_SIMPLE_FLAG_SECRETS_ONLY;
|
||||
|
||||
self->em_pap = eap_method_simple_new (connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_PAP,
|
||||
simple_flags);
|
||||
TRUE, TRUE);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_pap));
|
||||
g_signal_connect_object (self->em_pap, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_mschap = eap_method_simple_new (connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_MSCHAP,
|
||||
simple_flags);
|
||||
TRUE, TRUE);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_mschap));
|
||||
g_signal_connect_object (self->em_mschap, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_mschap_v2 = eap_method_simple_new (connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_MSCHAP_V2,
|
||||
simple_flags);
|
||||
TRUE, TRUE);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_mschap_v2));
|
||||
g_signal_connect_object (self->em_mschap_v2, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_plain_mschap_v2 = eap_method_simple_new (connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_PLAIN_MSCHAP_V2,
|
||||
simple_flags);
|
||||
TRUE, TRUE);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_plain_mschap_v2));
|
||||
g_signal_connect_object (self->em_plain_mschap_v2, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_chap = eap_method_simple_new (connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_CHAP,
|
||||
simple_flags);
|
||||
TRUE, TRUE);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_chap));
|
||||
g_signal_connect_object (self->em_chap, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_md5 = eap_method_simple_new (connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_MD5,
|
||||
simple_flags);
|
||||
TRUE, TRUE);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_md5));
|
||||
g_signal_connect_object (self->em_md5, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
self->em_gtc = eap_method_simple_new (connection,
|
||||
EAP_METHOD_SIMPLE_TYPE_GTC,
|
||||
simple_flags);
|
||||
TRUE, TRUE);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_gtc));
|
||||
g_signal_connect_object (self->em_gtc, "changed", G_CALLBACK (eap_method_emit_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
|
@ -433,18 +421,6 @@ eap_method_ttls_new (NMConnection *connection,
|
|||
g_signal_connect_swapped (self->inner_auth_combo, "changed", G_CALLBACK (inner_auth_combo_changed_cb), self);
|
||||
inner_auth_combo_changed_cb (self);
|
||||
|
||||
if (secrets_only) {
|
||||
gtk_widget_hide (GTK_WIDGET (self->anon_identity_label));
|
||||
gtk_widget_hide (GTK_WIDGET (self->anon_identity_entry));
|
||||
gtk_widget_hide (GTK_WIDGET (self->domain_match_label));
|
||||
gtk_widget_hide (GTK_WIDGET (self->domain_match_entry));
|
||||
gtk_widget_hide (GTK_WIDGET (self->ca_cert_label));
|
||||
gtk_widget_hide (GTK_WIDGET (self->ca_cert_button));
|
||||
gtk_widget_hide (GTK_WIDGET (self->ca_cert_not_required_check));
|
||||
gtk_widget_hide (GTK_WIDGET (self->inner_auth_label));
|
||||
gtk_widget_hide (GTK_WIDGET (self->inner_auth_combo));
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,8 +29,6 @@ G_BEGIN_DECLS
|
|||
|
||||
G_DECLARE_FINAL_TYPE (EAPMethodTTLS, eap_method_ttls, EAP, METHOD_TTLS, GtkGrid)
|
||||
|
||||
EAPMethodTTLS *eap_method_ttls_new (NMConnection *connection,
|
||||
gboolean is_editor,
|
||||
gboolean secrets_only);
|
||||
EAPMethodTTLS *eap_method_ttls_new (NMConnection *connection);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -197,13 +197,10 @@ wireless_security_iface_init (WirelessSecurityInterface *iface)
|
|||
}
|
||||
|
||||
WirelessSecurityDynamicWEP *
|
||||
ws_dynamic_wep_new (NMConnection *connection,
|
||||
gboolean is_editor,
|
||||
gboolean secrets_only)
|
||||
ws_dynamic_wep_new (NMConnection *connection)
|
||||
{
|
||||
WirelessSecurityDynamicWEP *self;
|
||||
const gchar *default_method = NULL;
|
||||
EAPMethodSimpleFlags simple_flags = EAP_METHOD_SIMPLE_FLAG_NONE;
|
||||
GtkTreeIter iter;
|
||||
|
||||
self = g_object_new (ws_dynamic_wep_get_type (), NULL);
|
||||
|
@ -219,27 +216,22 @@ ws_dynamic_wep_new (NMConnection *connection,
|
|||
if (default_method == NULL)
|
||||
default_method = "tls";
|
||||
|
||||
if (is_editor)
|
||||
simple_flags |= EAP_METHOD_SIMPLE_FLAG_IS_EDITOR;
|
||||
if (secrets_only)
|
||||
simple_flags |= EAP_METHOD_SIMPLE_FLAG_SECRETS_ONLY;
|
||||
|
||||
self->em_tls = eap_method_tls_new (connection, FALSE, secrets_only);
|
||||
self->em_tls = eap_method_tls_new (connection);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_tls));
|
||||
g_signal_connect_object (self->em_tls, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_leap = eap_method_leap_new (connection, secrets_only);
|
||||
self->em_leap = eap_method_leap_new (connection);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_leap));
|
||||
g_signal_connect_object (self->em_leap, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_pwd = eap_method_simple_new (connection, EAP_METHOD_SIMPLE_TYPE_PWD, simple_flags);
|
||||
self->em_pwd = eap_method_simple_new (connection, EAP_METHOD_SIMPLE_TYPE_PWD, FALSE, FALSE);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_pwd));
|
||||
g_signal_connect_object (self->em_pwd, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_fast = eap_method_fast_new (connection, is_editor, secrets_only);
|
||||
self->em_fast = eap_method_fast_new (connection);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_fast));
|
||||
g_signal_connect_object (self->em_fast, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_ttls = eap_method_ttls_new (connection, is_editor, secrets_only);
|
||||
self->em_ttls = eap_method_ttls_new (connection);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_ttls));
|
||||
g_signal_connect_object (self->em_ttls, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_peap = eap_method_peap_new (connection, is_editor, secrets_only);
|
||||
self->em_peap = eap_method_peap_new (connection);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_peap));
|
||||
g_signal_connect_object (self->em_peap, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
|
@ -252,11 +244,6 @@ ws_dynamic_wep_new (NMConnection *connection,
|
|||
} while (gtk_tree_model_iter_next (GTK_TREE_MODEL (self->auth_model), &iter));
|
||||
}
|
||||
|
||||
if (secrets_only) {
|
||||
gtk_widget_hide (GTK_WIDGET (self->auth_combo));
|
||||
gtk_widget_hide (GTK_WIDGET (self->auth_label));
|
||||
}
|
||||
|
||||
if (connection) {
|
||||
NMSetting8021x *setting;
|
||||
|
||||
|
|
|
@ -29,8 +29,6 @@ G_BEGIN_DECLS
|
|||
|
||||
G_DECLARE_FINAL_TYPE (WirelessSecurityDynamicWEP, ws_dynamic_wep, WS, DYNAMIC_WEP, GtkGrid)
|
||||
|
||||
WirelessSecurityDynamicWEP *ws_dynamic_wep_new (NMConnection *connection,
|
||||
gboolean is_editor,
|
||||
gboolean secrets_only);
|
||||
WirelessSecurityDynamicWEP *ws_dynamic_wep_new (NMConnection *connection);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -212,14 +212,11 @@ wireless_security_iface_init (WirelessSecurityInterface *iface)
|
|||
}
|
||||
|
||||
WirelessSecurityWPAEAP *
|
||||
ws_wpa_eap_new (NMConnection *connection,
|
||||
gboolean is_editor,
|
||||
gboolean secrets_only)
|
||||
ws_wpa_eap_new (NMConnection *connection)
|
||||
{
|
||||
WirelessSecurityWPAEAP *self;
|
||||
const gchar *remove_method, *default_method = NULL;
|
||||
gboolean wired = FALSE;
|
||||
EAPMethodSimpleFlags simple_flags = EAP_METHOD_SIMPLE_FLAG_NONE;
|
||||
GtkTreeIter iter;
|
||||
|
||||
self = g_object_new (ws_wpa_eap_get_type (), NULL);
|
||||
|
@ -252,30 +249,25 @@ ws_wpa_eap_new (NMConnection *connection,
|
|||
default_method = "tls";
|
||||
}
|
||||
|
||||
if (is_editor)
|
||||
simple_flags |= EAP_METHOD_SIMPLE_FLAG_IS_EDITOR;
|
||||
if (secrets_only)
|
||||
simple_flags |= EAP_METHOD_SIMPLE_FLAG_SECRETS_ONLY;
|
||||
|
||||
self->em_md5 = eap_method_simple_new (connection, EAP_METHOD_SIMPLE_TYPE_MD5, simple_flags);
|
||||
self->em_md5 = eap_method_simple_new (connection, EAP_METHOD_SIMPLE_TYPE_MD5, FALSE, FALSE);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_md5));
|
||||
g_signal_connect_object (self->em_md5, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_tls = eap_method_tls_new (connection, FALSE, secrets_only);
|
||||
self->em_tls = eap_method_tls_new (connection);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_tls));
|
||||
g_signal_connect_object (self->em_tls, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_leap = eap_method_leap_new (connection, secrets_only);
|
||||
self->em_leap = eap_method_leap_new (connection);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_leap));
|
||||
g_signal_connect_object (self->em_leap, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_pwd = eap_method_simple_new (connection, EAP_METHOD_SIMPLE_TYPE_PWD, simple_flags);
|
||||
self->em_pwd = eap_method_simple_new (connection, EAP_METHOD_SIMPLE_TYPE_PWD, FALSE, FALSE);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_pwd));
|
||||
g_signal_connect_object (self->em_pwd, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_fast = eap_method_fast_new (connection, is_editor, secrets_only);
|
||||
self->em_fast = eap_method_fast_new (connection);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_fast));
|
||||
g_signal_connect_object (self->em_fast, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_ttls = eap_method_ttls_new (connection, is_editor, secrets_only);
|
||||
self->em_ttls = eap_method_ttls_new (connection);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_ttls));
|
||||
g_signal_connect_object (self->em_ttls, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
self->em_peap = eap_method_peap_new (connection, is_editor, secrets_only);
|
||||
self->em_peap = eap_method_peap_new (connection);
|
||||
gtk_widget_show (GTK_WIDGET (self->em_peap));
|
||||
g_signal_connect_object (self->em_peap, "changed", G_CALLBACK (wireless_security_notify_changed), self, G_CONNECT_SWAPPED);
|
||||
|
||||
|
@ -298,12 +290,6 @@ ws_wpa_eap_new (NMConnection *connection,
|
|||
} while (gtk_tree_model_iter_next (GTK_TREE_MODEL (self->auth_model), &iter));
|
||||
}
|
||||
|
||||
if (secrets_only) {
|
||||
gtk_widget_hide (GTK_WIDGET (self->auth_combo));
|
||||
gtk_widget_hide (GTK_WIDGET (self->auth_label));
|
||||
}
|
||||
|
||||
|
||||
if (connection) {
|
||||
NMSetting8021x *setting;
|
||||
|
||||
|
|
|
@ -29,9 +29,7 @@ G_BEGIN_DECLS
|
|||
|
||||
G_DECLARE_FINAL_TYPE (WirelessSecurityWPAEAP, ws_wpa_eap, WS, WPA_EAP, GtkGrid)
|
||||
|
||||
WirelessSecurityWPAEAP *ws_wpa_eap_new (NMConnection *connection,
|
||||
gboolean is_editor,
|
||||
gboolean secrets_only);
|
||||
WirelessSecurityWPAEAP *ws_wpa_eap_new (NMConnection *connection);
|
||||
|
||||
void ws_wpa_eap_fill_connection (WirelessSecurityWPAEAP *sec,
|
||||
NMConnection *connection);
|
||||
|
|
Loading…
Add table
Reference in a new issue