diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2009-08-06 15:04:41 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-14 09:12:47 -0400 |
commit | bcba8eae12fce23686b84a56d19f5fc78bf182ae (patch) | |
tree | f576449002a6f82d914c2af43563717a47651b59 /net/wireless/sme.c | |
parent | b6f0b639089fb160b10984ac56e07e7043dabad7 (diff) |
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>
Diffstat (limited to 'net/wireless/sme.c')
-rw-r--r-- | net/wireless/sme.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 0b776b769c0f..340934f714b2 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c | |||
@@ -658,14 +658,28 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev, | |||
658 | 658 | ||
659 | if (connkeys && connkeys->def >= 0) { | 659 | if (connkeys && connkeys->def >= 0) { |
660 | int idx; | 660 | int idx; |
661 | u32 cipher; | ||
661 | 662 | ||
662 | idx = connkeys->def; | 663 | idx = connkeys->def; |
664 | cipher = connkeys->params[idx].cipher; | ||
663 | /* If given a WEP key we may need it for shared key auth */ | 665 | /* If given a WEP key we may need it for shared key auth */ |
664 | if (connkeys->params[idx].cipher == WLAN_CIPHER_SUITE_WEP40 || | 666 | if (cipher == WLAN_CIPHER_SUITE_WEP40 || |
665 | connkeys->params[idx].cipher == WLAN_CIPHER_SUITE_WEP104) { | 667 | cipher == WLAN_CIPHER_SUITE_WEP104) { |
666 | connect->key_idx = idx; | 668 | connect->key_idx = idx; |
667 | connect->key = connkeys->params[idx].key; | 669 | connect->key = connkeys->params[idx].key; |
668 | connect->key_len = connkeys->params[idx].key_len; | 670 | connect->key_len = connkeys->params[idx].key_len; |
671 | |||
672 | /* | ||
673 | * If ciphers are not set (e.g. when going through | ||
674 | * iwconfig), we have to set them appropriately here. | ||
675 | */ | ||
676 | if (connect->crypto.cipher_group == 0) | ||
677 | connect->crypto.cipher_group = cipher; | ||
678 | |||
679 | if (connect->crypto.n_ciphers_pairwise == 0) { | ||
680 | connect->crypto.n_ciphers_pairwise = 1; | ||
681 | connect->crypto.ciphers_pairwise[0] = cipher; | ||
682 | } | ||
669 | } | 683 | } |
670 | } | 684 | } |
671 | 685 | ||