2008-09-18 Dan Williams <dcbw@redhat.com>
* libnm-util/nm-setting-wireless.c - (nm_setting_wireless_ap_security_compatible): only verify pairwise and group ciphers if the wireless-security setting explicitly specified them, effectively making the default be "all ciphers" (idea from Alexander Sack) git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4076 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2008-09-18 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
|
* libnm-util/nm-setting-wireless.c
|
||||||
|
- (nm_setting_wireless_ap_security_compatible): only verify pairwise and
|
||||||
|
group ciphers if the wireless-security setting explicitly specified
|
||||||
|
them, effectively making the default be "all ciphers" (idea from
|
||||||
|
Alexander Sack)
|
||||||
|
|
||||||
2008-09-15 Dan Williams <dcbw@redhat.com>
|
2008-09-15 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
Patch from Alexander Sack <asac@ubuntu.com>
|
Patch from Alexander Sack <asac@ubuntu.com>
|
||||||
|
@@ -174,7 +174,10 @@ nm_setting_wireless_ap_security_compatible (NMSettingWireless *s_wireless,
|
|||||||
|| !(ap_wpa & (NM_802_11_AP_SEC_GROUP_WEP40 | NM_802_11_AP_SEC_GROUP_WEP104)))
|
|| !(ap_wpa & (NM_802_11_AP_SEC_GROUP_WEP40 | NM_802_11_AP_SEC_GROUP_WEP104)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* Match at least one pairwise cipher with AP's capability */
|
/* Match at least one pairwise cipher with AP's capability if the
|
||||||
|
* wireless-security setting explicitly lists pairwise ciphers
|
||||||
|
*/
|
||||||
|
if (s_wireless_sec->pairwise) {
|
||||||
for (iter = s_wireless_sec->pairwise; iter; iter = g_slist_next (iter)) {
|
for (iter = s_wireless_sec->pairwise; iter; iter = g_slist_next (iter)) {
|
||||||
if ((found = match_cipher (iter->data, "wep40", ap_wpa, ap_wpa, NM_802_11_AP_SEC_PAIR_WEP40)))
|
if ((found = match_cipher (iter->data, "wep40", ap_wpa, ap_wpa, NM_802_11_AP_SEC_PAIR_WEP40)))
|
||||||
break;
|
break;
|
||||||
@@ -183,8 +186,12 @@ nm_setting_wireless_ap_security_compatible (NMSettingWireless *s_wireless,
|
|||||||
}
|
}
|
||||||
if (!found)
|
if (!found)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Match at least one group cipher with AP's capability */
|
/* Match at least one group cipher with AP's capability if the
|
||||||
|
* wireless-security setting explicitly lists group ciphers
|
||||||
|
*/
|
||||||
|
if (s_wireless_sec->group) {
|
||||||
for (iter = s_wireless_sec->group; iter; iter = g_slist_next (iter)) {
|
for (iter = s_wireless_sec->group; iter; iter = g_slist_next (iter)) {
|
||||||
if ((found = match_cipher (iter->data, "wep40", ap_wpa, ap_wpa, NM_802_11_AP_SEC_GROUP_WEP40)))
|
if ((found = match_cipher (iter->data, "wep40", ap_wpa, ap_wpa, NM_802_11_AP_SEC_GROUP_WEP40)))
|
||||||
break;
|
break;
|
||||||
@@ -194,6 +201,7 @@ nm_setting_wireless_ap_security_compatible (NMSettingWireless *s_wireless,
|
|||||||
if (!found)
|
if (!found)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,9 +214,6 @@ nm_setting_wireless_ap_security_compatible (NMSettingWireless *s_wireless,
|
|||||||
if (!(ap_flags & NM_802_11_AP_FLAGS_PRIVACY))
|
if (!(ap_flags & NM_802_11_AP_FLAGS_PRIVACY))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!s_wireless_sec->pairwise || !s_wireless_sec->group)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (!strcmp (s_wireless_sec->key_mgmt, "wpa-psk")) {
|
if (!strcmp (s_wireless_sec->key_mgmt, "wpa-psk")) {
|
||||||
if ( !(ap_wpa & NM_802_11_AP_SEC_KEY_MGMT_PSK)
|
if ( !(ap_wpa & NM_802_11_AP_SEC_KEY_MGMT_PSK)
|
||||||
&& !(ap_rsn & NM_802_11_AP_SEC_KEY_MGMT_PSK))
|
&& !(ap_rsn & NM_802_11_AP_SEC_KEY_MGMT_PSK))
|
||||||
@@ -223,7 +228,10 @@ nm_setting_wireless_ap_security_compatible (NMSettingWireless *s_wireless,
|
|||||||
// if the Connection only uses WPA we don't match a cipher against
|
// if the Connection only uses WPA we don't match a cipher against
|
||||||
// the AP's RSN IE instead
|
// the AP's RSN IE instead
|
||||||
|
|
||||||
/* Match at least one pairwise cipher with AP's capability */
|
/* Match at least one pairwise cipher with AP's capability if the
|
||||||
|
* wireless-security setting explicitly lists pairwise ciphers
|
||||||
|
*/
|
||||||
|
if (s_wireless_sec->pairwise) {
|
||||||
for (elt = s_wireless_sec->pairwise; elt; elt = g_slist_next (elt)) {
|
for (elt = s_wireless_sec->pairwise; elt; elt = g_slist_next (elt)) {
|
||||||
if ((found = match_cipher (elt->data, "tkip", ap_wpa, ap_rsn, NM_802_11_AP_SEC_PAIR_TKIP)))
|
if ((found = match_cipher (elt->data, "tkip", ap_wpa, ap_rsn, NM_802_11_AP_SEC_PAIR_TKIP)))
|
||||||
break;
|
break;
|
||||||
@@ -232,8 +240,12 @@ nm_setting_wireless_ap_security_compatible (NMSettingWireless *s_wireless,
|
|||||||
}
|
}
|
||||||
if (!found)
|
if (!found)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Match at least one group cipher with AP's capability */
|
/* Match at least one group cipher with AP's capability if the
|
||||||
|
* wireless-security setting explicitly lists group ciphers
|
||||||
|
*/
|
||||||
|
if (s_wireless_sec->group) {
|
||||||
for (elt = s_wireless_sec->group; elt; elt = g_slist_next (elt)) {
|
for (elt = s_wireless_sec->group; elt; elt = g_slist_next (elt)) {
|
||||||
if ((found = match_cipher (elt->data, "wep40", ap_wpa, ap_rsn, NM_802_11_AP_SEC_GROUP_WEP40)))
|
if ((found = match_cipher (elt->data, "wep40", ap_wpa, ap_rsn, NM_802_11_AP_SEC_GROUP_WEP40)))
|
||||||
break;
|
break;
|
||||||
@@ -246,6 +258,7 @@ nm_setting_wireless_ap_security_compatible (NMSettingWireless *s_wireless,
|
|||||||
}
|
}
|
||||||
if (!found)
|
if (!found)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user