# HG changeset patch # User Joseph Jezak # Node ID b2495350912ef633281995990ead315364cf2dff # Parent a4cbba212036532e5670473be56d0458bd1fe7ee Added some parts of shared key authentication. diff -r a4cbba212036 -r b2495350912e ieee80211softmac_auth.c --- a/ieee80211softmac_auth.c Wed Nov 30 14:15:25 2005 +++ b/ieee80211softmac_auth.c Wed Nov 30 14:15:36 2005 @@ -67,7 +67,7 @@ } if(!(auth->net->flags & IEEE80211_AUTHENTICATED)) { auth->net->flags &= ~(IEEE80211_AUTHENTICATED | IEEE80211_AUTHENTICATING); - printkl(KERN_WARNING PFX "Authentication failed with %02x:%02x:%02x:%02x:%02x:%02x\n", + printkl(KERN_WARNING PFX "Authentication timed out with %02x:%02x:%02x:%02x:%02x:%02x\n", auth->net->bssid[0], auth->net->bssid[1], auth->net->bssid[2], auth->net->bssid[3], auth->net->bssid[4], auth->net->bssid[5]); } @@ -125,7 +125,41 @@ goto free_aq; break; case WLAN_AUTH_SHARED_KEY: - /* FIXME TODO */ + /* Figure out where we are in the process */ + switch(auth->transaction) { + case IEEE80211SOFTMAC_AUTH_SHARED_CHALLENGE: + /* Save the challenge */ + + /* Send our response */ + + break; + case IEEE80211SOFTMAC_AUTH_SHARED_PASS: + /* Check the status code of the response */ + switch(auth->status) { + case WLAN_STATUS_SUCCESS: + /* Update the status to Authenticated (LOCK?) */ + aq->net->flags &= ~IEEE80211_AUTHENTICATING; + aq->net->flags |= IEEE80211_AUTHENTICATED; + printkl(KERN_NOTICE PFX "Shared Key Authentication completed with %02x:%02x:%02x:%02x:%02x:%02x\n", + aq->net->bssid[0], aq->net->bssid[1], aq->net->bssid[2], + aq->net->bssid[3], aq->net->bssid[4], aq->net->bssid[5]); + break; + default: + printkl(KERN_NOTICE PFX "Shared Key Authentication with %02x:%02x:%02x:%02x:%02x:%02x failed, error code: %i\n", + aq->net->bssid[0], aq->net->bssid[1], aq->net->bssid[2], + aq->net->bssid[3], aq->net->bssid[4], aq->net->bssid[5], + auth->status); + aq->net->flags &= ~IEEE80211_AUTHENTICATED; + aq->net->flags |= ~IEEE80211_AUTHENTICATING; + /* Count the error? */ + break; + } + goto free_aq; + break; + default: + printkl(KERN_WARNING PFX "Unhandled Authentication Step: %i", auth->transaction); + break; + } goto free_aq; break; default: diff -r a4cbba212036 -r b2495350912e ieee80211softmac_io.c --- a/ieee80211softmac_io.c Wed Nov 30 14:15:25 2005 +++ b/ieee80211softmac_io.c Wed Nov 30 14:15:36 2005 @@ -79,7 +79,7 @@ else { *dst++ = r->count; memcpy(dst, r->rates, r->count); - dst = dst + r->count; + dst += r->count; } return dst; } @@ -192,7 +192,7 @@ * fill in their own IEs */ ); pkt = ieee80211softmac_alloc_mgt(pkt_size); - if (pkt == NULL) + if (unlikely(pkt == NULL)) return -ENOMEM; p.assoc = (struct ieee80211_assoc_request *)pkt; ieee80211softmac_hdr_3addr(mac, &(p.assoc->header), type, net->bssid, net->bssid); @@ -229,7 +229,7 @@ 2 + 2 + IEEE80211SOFTMAC_MAX_RATES_LEN ); pkt = ieee80211softmac_alloc_mgt(pkt_size); - if (pkt == NULL) + if (unlikely(pkt == NULL)) return -ENOMEM; p.reassoc = (struct ieee80211_reassoc_request *)pkt; ieee80211softmac_hdr_3addr(mac, &(p.reassoc->header), type, net->bssid, net->bssid); @@ -271,7 +271,7 @@ ); /* Allocate Packet */ pkt = ieee80211softmac_alloc_mgt(pkt_size); - if(pkt == NULL) + if (unlikely(pkt == NULL)) return -ENOMEM; p.auth = (struct ieee80211_auth *)pkt; ieee80211softmac_hdr_3addr(mac, &(p.auth->header), type, net->bssid, net->bssid); @@ -314,7 +314,7 @@ pkt_size = 2; /* Reason Code */ /* Allocate Packet */ pkt = ieee80211softmac_alloc_mgt(pkt_size); - if(pkt == NULL) + if (unlikely(pkt == NULL)) return -ENOMEM; p.disassoc = (struct ieee80211_disassoc *)pkt; ieee80211softmac_hdr_3addr(mac, &(p.disassoc->header), type, net->bssid, net->bssid); @@ -336,7 +336,7 @@ ); /* Allocate Packet */ pkt = ieee80211softmac_alloc_mgt(pkt_size); - if(pkt == NULL) + if (unlikely(pkt == NULL)) return -ENOMEM; p.probe_req = (struct ieee80211_probe_request *)pkt; ieee80211softmac_hdr_3addr(mac, &(p.probe_req->header), type, NULL, NULL); @@ -367,7 +367,7 @@ ); /* Allocate Packet */ pkt = ieee80211softmac_alloc_mgt(pkt_size); - if(pkt == NULL) + if (unlikely(pkt == NULL)) return -ENOMEM; p.probe_resp = (struct ieee80211_probe_response *)pkt; data = (u8 *)p.probe_resp->info_element;