cfg80211: Set WEP ciphers
With iwconfig there is no way to properly set the ciphers when trying to connect to a WEP SSID. Although mac80211 based drivers dont need it, several fullmac drivers do. This patch basically sets the WEP ciphers whenever they're not set at all. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
b6f0b63908
commit
bcba8eae12
@@ -658,14 +658,28 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev,
|
|||||||
|
|
||||||
if (connkeys && connkeys->def >= 0) {
|
if (connkeys && connkeys->def >= 0) {
|
||||||
int idx;
|
int idx;
|
||||||
|
u32 cipher;
|
||||||
|
|
||||||
idx = connkeys->def;
|
idx = connkeys->def;
|
||||||
|
cipher = connkeys->params[idx].cipher;
|
||||||
/* If given a WEP key we may need it for shared key auth */
|
/* If given a WEP key we may need it for shared key auth */
|
||||||
if (connkeys->params[idx].cipher == WLAN_CIPHER_SUITE_WEP40 ||
|
if (cipher == WLAN_CIPHER_SUITE_WEP40 ||
|
||||||
connkeys->params[idx].cipher == WLAN_CIPHER_SUITE_WEP104) {
|
cipher == WLAN_CIPHER_SUITE_WEP104) {
|
||||||
connect->key_idx = idx;
|
connect->key_idx = idx;
|
||||||
connect->key = connkeys->params[idx].key;
|
connect->key = connkeys->params[idx].key;
|
||||||
connect->key_len = connkeys->params[idx].key_len;
|
connect->key_len = connkeys->params[idx].key_len;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If ciphers are not set (e.g. when going through
|
||||||
|
* iwconfig), we have to set them appropriately here.
|
||||||
|
*/
|
||||||
|
if (connect->crypto.cipher_group == 0)
|
||||||
|
connect->crypto.cipher_group = cipher;
|
||||||
|
|
||||||
|
if (connect->crypto.n_ciphers_pairwise == 0) {
|
||||||
|
connect->crypto.n_ciphers_pairwise = 1;
|
||||||
|
connect->crypto.ciphers_pairwise[0] = cipher;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user