summaryrefslogtreecommitdiff
path: root/libnm-core/nm-setting-wireless-security.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-core/nm-setting-wireless-security.c')
-rw-r--r--libnm-core/nm-setting-wireless-security.c43
1 files changed, 8 insertions, 35 deletions
diff --git a/libnm-core/nm-setting-wireless-security.c b/libnm-core/nm-setting-wireless-security.c
index efb4860be1..a3eb8a7ff3 100644
--- a/libnm-core/nm-setting-wireless-security.c
+++ b/libnm-core/nm-setting-wireless-security.c
@@ -849,9 +849,8 @@ need_secrets (NMSetting *setting)
goto no_secrets;
}
- /* WPA-PSK infrastructure and adhoc */
- if ( (strcmp (priv->key_mgmt, "wpa-none") == 0)
- || (strcmp (priv->key_mgmt, "wpa-psk") == 0)) {
+ /* WPA-PSK infrastructure */
+ if (strcmp (priv->key_mgmt, "wpa-psk") == 0) {
if (!nm_utils_wpa_psk_valid (priv->psk)) {
g_ptr_array_add (secrets, NM_SETTING_WIRELESS_SECURITY_PSK);
return secrets;
@@ -899,7 +898,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
{
NMSettingWirelessSecurity *self = NM_SETTING_WIRELESS_SECURITY (setting);
NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (self);
- const char *valid_key_mgmt[] = { "none", "ieee8021x", "wpa-none", "wpa-psk", "wpa-eap", "sae", NULL };
+ const char *valid_key_mgmt[] = { "none", "ieee8021x", "wpa-psk", "wpa-eap", "sae", NULL };
const char *valid_auth_algs[] = { "open", "shared", "leap", NULL };
const char *valid_protos[] = { "wpa", "rsn", NULL };
const char *valid_pairwise[] = { "tkip", "ccmp", NULL };
@@ -1024,33 +1023,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
}
if (priv->pairwise) {
- const char *wpa_none[] = { "wpa-none", NULL };
-
- /* For ad-hoc connections, pairwise must be "none" */
- if (g_strv_contains (wpa_none, priv->key_mgmt)) {
- GSList *iter;
- gboolean found = FALSE;
-
- for (iter = priv->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_CONNECTION_ERROR,
- NM_CONNECTION_ERROR_INVALID_PROPERTY,
- _("'%s' connections require '%s' in this property"),
- NM_SETTING_WIRELESS_MODE_ADHOC, "none");
- g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_PAIRWISE);
- return FALSE;
- }
- } else if (!_nm_utils_string_slist_validate (priv->pairwise, valid_pairwise)) {
+ if (!_nm_utils_string_slist_validate (priv->pairwise, valid_pairwise)) {
g_set_error_literal (error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY,
@@ -1468,10 +1441,10 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *klass)
/**
* NMSettingWirelessSecurity:key-mgmt:
*
- * Key management used for the connection. One of "none" (WEP), "ieee8021x"
- * (Dynamic WEP), "wpa-none" (Ad-Hoc WPA-PSK), "wpa-psk" (infrastructure
- * WPA-PSK), "sae" (SAE) or "wpa-eap" (WPA-Enterprise).
- * This property must be set for any Wi-Fi connection that uses security.
+ * Key management used for the connection. One of "none" (WEP),
+ * "ieee8021x" (Dynamic WEP), "wpa-psk" (infrastructure WPA-PSK), "sae"
+ * (SAE) or "wpa-eap" (WPA-Enterprise). This property must be set for
+ * any Wi-Fi connection that uses security.
**/
/* ---ifcfg-rh---
* property: key-mgmt