mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-03 23:00:28 +01:00
2007-10-14 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting.c - (setting_wireless_security_need_secrets): handle LEAP secrets git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2974 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
52fd366c05
commit
799c141b35
2 changed files with 30 additions and 1 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2007-10-14 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* libnm-util/nm-setting.c
|
||||
- (setting_wireless_security_need_secrets): handle LEAP secrets
|
||||
|
||||
2007-10-13 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* libnm-util/nm-setting.h
|
||||
|
|
|
|||
|
|
@ -982,6 +982,19 @@ setting_wireless_security_destroy (NMSetting *setting)
|
|||
g_slice_free (NMSettingWirelessSecurity, self);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
string_list_contains (GSList *list, const char *string)
|
||||
{
|
||||
GSList *iter;
|
||||
|
||||
g_return_val_if_fail (string != NULL, FALSE);
|
||||
|
||||
for (iter = list; iter; iter = g_slist_next (iter))
|
||||
if (!strcmp (iter->data, string))
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
setting_wireless_security_update_secrets (NMSetting *setting,
|
||||
GHashTable *secrets)
|
||||
|
|
@ -1068,7 +1081,6 @@ setting_wireless_security_need_secrets (NMSetting *setting)
|
|||
g_assert (self->key_mgmt);
|
||||
|
||||
/* Static WEP */
|
||||
// FIXME: check key length too
|
||||
if (strcmp (self->key_mgmt, "none") == 0) {
|
||||
if (!verify_wep_key (self->wep_key0)) {
|
||||
g_ptr_array_add (secrets, "wep-key0");
|
||||
|
|
@ -1089,6 +1101,7 @@ setting_wireless_security_need_secrets (NMSetting *setting)
|
|||
goto no_secrets;
|
||||
}
|
||||
|
||||
/* WPA-PSK infrastructure and adhoc */
|
||||
if ( (strcmp (self->key_mgmt, "wpa-none") == 0)
|
||||
|| (strcmp (self->key_mgmt, "wpa-psk") == 0)) {
|
||||
if (!verify_wpa_psk (self->psk)) {
|
||||
|
|
@ -1098,6 +1111,17 @@ setting_wireless_security_need_secrets (NMSetting *setting)
|
|||
goto no_secrets;
|
||||
}
|
||||
|
||||
/* LEAP */
|
||||
if ( (strcmp (self->key_mgmt, "ieee8021x") == 0)
|
||||
&& (strcmp (self->auth_alg, "leap") == 0)
|
||||
&& (string_list_contains (self->eap, "leap"))) {
|
||||
if (!self->password || !strlen (self->password)) {
|
||||
g_ptr_array_add (secrets, "password");
|
||||
return secrets;
|
||||
}
|
||||
goto no_secrets;
|
||||
}
|
||||
|
||||
if (strcmp (self->key_mgmt, "wpa-eap") == 0) {
|
||||
// FIXME: implement
|
||||
goto no_secrets;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue