2008-10-20 Dan Williams <dcbw@redhat.com>

* libnm-util/nm-setting-wireless-security.c
		- (verify): accept 'none' as a pairwise cipher with Ad-Hoc WPA connections



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4198 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2008-10-20 21:39:56 +00:00
parent 049a5fa7ef
commit 07541a1eb8
2 changed files with 37 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2008-10-20 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting-wireless-security.c
- (verify): accept 'none' as a pairwise cipher with Ad-Hoc WPA connections
2008-10-20 Dan Williams <dcbw@redhat.com>
* src/supplicant-manager/nm-supplicant-config.c

View file

@ -339,12 +339,38 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
return FALSE;
}
if (self->pairwise && !nm_utils_string_slist_validate (self->pairwise, valid_pairwise)) {
g_set_error (error,
NM_SETTING_WIRELESS_SECURITY_ERROR,
NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY,
NM_SETTING_WIRELESS_SECURITY_PAIRWISE);
return FALSE;
if (self->pairwise) {
const char *wpa_none[] = { "wpa-none", NULL };
/* For ad-hoc connections, pairwise must be "none" */
if (nm_utils_string_in_list (self->key_mgmt, wpa_none)) {
GSList *iter;
gboolean found = FALSE;
for (iter = self->pairwise; iter; iter = g_slist_next (iter)) {
if (!strcmp ((char *) iter->data, "none")) {
found = TRUE;
break;
}
}
/* pairwise cipher list didn't contain "none", which is invalid
* for WPA adhoc connections.
*/
if (!found) {
g_set_error (error,
NM_SETTING_WIRELESS_SECURITY_ERROR,
NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY,
NM_SETTING_WIRELESS_SECURITY_PAIRWISE);
return FALSE;
}
} else if (!nm_utils_string_slist_validate (self->pairwise, valid_pairwise)) {
g_set_error (error,
NM_SETTING_WIRELESS_SECURITY_ERROR,
NM_SETTING_WIRELESS_SECURITY_ERROR_INVALID_PROPERTY,
NM_SETTING_WIRELESS_SECURITY_PAIRWISE);
return FALSE;
}
}
if (self->group && !nm_utils_string_slist_validate (self->group, valid_groups)) {