diff options
author | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-08-27 22:59:59 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-08-27 22:59:59 -0400 |
commit | 8ce7a9c159c8c4eb480f0a65c6af753dbf9a1a70 (patch) | |
tree | be59573c0af3617d0cd8a7d61f0ed119e58b1156 /net/ieee80211/softmac/ieee80211softmac_auth.c | |
parent | d2afb3ae04e36dbc6e9eb2d8bd54406ff7b6b3bd (diff) | |
parent | 01da5fd83d6b2c5e36b77539f6cbdd8f49849225 (diff) |
Merge ../linux-2.6
Diffstat (limited to 'net/ieee80211/softmac/ieee80211softmac_auth.c')
-rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_auth.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/net/ieee80211/softmac/ieee80211softmac_auth.c b/net/ieee80211/softmac/ieee80211softmac_auth.c index ebc33ca6e692..4cef39e171d0 100644 --- a/net/ieee80211/softmac/ieee80211softmac_auth.c +++ b/net/ieee80211/softmac/ieee80211softmac_auth.c | |||
@@ -116,6 +116,16 @@ ieee80211softmac_auth_queue(void *data) | |||
116 | kfree(auth); | 116 | kfree(auth); |
117 | } | 117 | } |
118 | 118 | ||
119 | /* Sends a response to an auth challenge (for shared key auth). */ | ||
120 | static void | ||
121 | ieee80211softmac_auth_challenge_response(void *_aq) | ||
122 | { | ||
123 | struct ieee80211softmac_auth_queue_item *aq = _aq; | ||
124 | |||
125 | /* Send our response */ | ||
126 | ieee80211softmac_send_mgt_frame(aq->mac, aq->net, IEEE80211_STYPE_AUTH, aq->state); | ||
127 | } | ||
128 | |||
119 | /* Handle the auth response from the AP | 129 | /* Handle the auth response from the AP |
120 | * This should be registered with ieee80211 as handle_auth | 130 | * This should be registered with ieee80211 as handle_auth |
121 | */ | 131 | */ |
@@ -197,24 +207,30 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) | |||
197 | case IEEE80211SOFTMAC_AUTH_SHARED_CHALLENGE: | 207 | case IEEE80211SOFTMAC_AUTH_SHARED_CHALLENGE: |
198 | /* Check to make sure we have a challenge IE */ | 208 | /* Check to make sure we have a challenge IE */ |
199 | data = (u8 *)auth->info_element; | 209 | data = (u8 *)auth->info_element; |
200 | if(*data++ != MFIE_TYPE_CHALLENGE){ | 210 | if (*data++ != MFIE_TYPE_CHALLENGE) { |
201 | printkl(KERN_NOTICE PFX "Shared Key Authentication failed due to a missing challenge.\n"); | 211 | printkl(KERN_NOTICE PFX "Shared Key Authentication failed due to a missing challenge.\n"); |
202 | break; | 212 | break; |
203 | } | 213 | } |
204 | /* Save the challenge */ | 214 | /* Save the challenge */ |
205 | spin_lock_irqsave(&mac->lock, flags); | 215 | spin_lock_irqsave(&mac->lock, flags); |
206 | net->challenge_len = *data++; | 216 | net->challenge_len = *data++; |
207 | if(net->challenge_len > WLAN_AUTH_CHALLENGE_LEN) | 217 | if (net->challenge_len > WLAN_AUTH_CHALLENGE_LEN) |
208 | net->challenge_len = WLAN_AUTH_CHALLENGE_LEN; | 218 | net->challenge_len = WLAN_AUTH_CHALLENGE_LEN; |
209 | if(net->challenge != NULL) | 219 | if (net->challenge != NULL) |
210 | kfree(net->challenge); | 220 | kfree(net->challenge); |
211 | net->challenge = kmalloc(net->challenge_len, GFP_ATOMIC); | 221 | net->challenge = kmalloc(net->challenge_len, GFP_ATOMIC); |
212 | memcpy(net->challenge, data, net->challenge_len); | 222 | memcpy(net->challenge, data, net->challenge_len); |
213 | aq->state = IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE; | 223 | aq->state = IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE; |
214 | spin_unlock_irqrestore(&mac->lock, flags); | ||
215 | 224 | ||
216 | /* Send our response */ | 225 | /* We reuse the work struct from the auth request here. |
217 | ieee80211softmac_send_mgt_frame(mac, aq->net, IEEE80211_STYPE_AUTH, aq->state); | 226 | * It is safe to do so as each one is per-request, and |
227 | * at this point (dealing with authentication response) | ||
228 | * we have obviously already sent the initial auth | ||
229 | * request. */ | ||
230 | cancel_delayed_work(&aq->work); | ||
231 | INIT_WORK(&aq->work, &ieee80211softmac_auth_challenge_response, (void *)aq); | ||
232 | schedule_work(&aq->work); | ||
233 | spin_unlock_irqrestore(&mac->lock, flags); | ||
218 | return 0; | 234 | return 0; |
219 | case IEEE80211SOFTMAC_AUTH_SHARED_PASS: | 235 | case IEEE80211SOFTMAC_AUTH_SHARED_PASS: |
220 | kfree(net->challenge); | 236 | kfree(net->challenge); |