2 *************************************************************************
4 * 5F., No.36, Taiyuan St., Jhubei City,
8 * (c) Copyright 2002-2007, Ralink Technology, Inc.
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
15 * This program is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU General Public License for more details. *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program; if not, write to the *
22 * Free Software Foundation, Inc., *
23 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
25 *************************************************************************
34 -------- ---------- ----------------------------------------------
35 Name Date Modification logs
40 // Messages for Associate state machine
41 #define LEAP_MACHINE_BASE 30
43 #define LEAP_MSG_REQUEST_IDENTITY 31
44 #define LEAP_MSG_REQUEST_LEAP 32
45 #define LEAP_MSG_SUCCESS 33
46 #define LEAP_MSG_FAILED 34
47 #define LEAP_MSG_RESPONSE_LEAP 35
48 #define LEAP_MSG_EAPOLKEY 36
49 #define LEAP_MSG_UNKNOWN 37
51 //! assoc state-machine states
53 #define LEAP_WAIT_IDENTITY_REQUEST 1
54 #define LEAP_WAIT_CHANLLENGE_REQUEST 2
55 #define LEAP_WAIT_SUCCESS 3
56 #define LEAP_WAIT_CHANLLENGE_RESPONSE 4
57 #define LEAP_WAIT_EAPOLKEY 5
59 #define LEAP_REASON_INVALID_AUTH 0x01
60 #define LEAP_REASON_AUTH_TIMEOUT 0x02
61 #define LEAP_REASON_CHALLENGE_FROM_AP_FAILED 0x03
62 #define LEAP_REASON_CHALLENGE_TO_AP_FAILED 0x04
64 #define CISCO_AuthModeLEAP 0x80
65 #define CISCO_AuthModeLEAPNone 0x00
66 #define LEAP_AUTH_TIMEOUT 30000
67 #define LEAP_CHALLENGE_RESPONSE_LENGTH 24
68 #define LEAP_CHALLENGE_REQUEST_LENGTH 8
70 typedef struct _LEAP_EAPOL_HEADER_ {
74 } LEAP_EAPOL_HEADER, *PLEAP_EAPOL_HEADER;
76 typedef struct _LEAP_EAPOL_PACKET_ {
81 } LEAP_EAPOL_PACKET, *PLEAP_EAPOL_PACKET;
83 typedef struct _LEAP_EAP_CONTENTS_ {
87 } LEAP_EAP_CONTENTS, *PLEAP_EAP_CONTENTS;
90 typedef struct _EAPOL_KEY_HEADER_ {
97 } EAPOL_KEY_HEADER, *PEAPOL_KEY_HEADER;
99 BOOLEAN LeapMsgTypeSubst(
103 VOID LeapMachinePerformAction(
104 IN PRTMP_ADAPTER pAd,
106 IN MLME_QUEUE_ELEM *Elem);
108 VOID LeapMacHeaderInit(
109 IN PRTMP_ADAPTER pAd,
110 IN OUT PHEADER_802_11 pHdr80211,
114 VOID LeapStartAction(
115 IN PRTMP_ADAPTER pAd,
116 IN MLME_QUEUE_ELEM *Elem);
118 VOID LeapIdentityAction(
119 IN PRTMP_ADAPTER pAd,
120 IN MLME_QUEUE_ELEM *Elem);
122 VOID LeapPeerChallengeAction(
123 IN PRTMP_ADAPTER pAd,
124 IN MLME_QUEUE_ELEM *Elem);
131 VOID PeerChallengeResponse(
132 IN PUCHAR szChallenge,
134 OUT PUCHAR szResponse);
154 VOID LeapNetworkChallengeAction(
155 IN PRTMP_ADAPTER pAd,
156 IN MLME_QUEUE_ELEM *Elem);
158 VOID LeapNetworkChallengeResponse(
159 IN PRTMP_ADAPTER pAd,
160 IN MLME_QUEUE_ELEM *Elem);
166 VOID ProcessSessionKey(
167 OUT PUCHAR SessionKey,
169 IN PUCHAR ChallengeToRadius,
170 IN PUCHAR ChallengeResponseFromRadius,
171 IN PUCHAR ChallengeFromRadius,
172 IN PUCHAR ChallengeResponseToRadius);
174 VOID LeapEapolKeyAction(
175 IN PRTMP_ADAPTER pAd,
176 IN MLME_QUEUE_ELEM *Elem);
178 VOID RogueApTableInit(
179 IN ROGUEAP_TABLE *Tab);
181 ULONG RogueApTableSearch(
182 IN ROGUEAP_TABLE *Tab,
185 VOID RogueApEntrySet(
186 IN PRTMP_ADAPTER pAd,
187 OUT ROGUEAP_ENTRY *pRogueAp,
191 ULONG RogueApTableSetEntry(
192 IN PRTMP_ADAPTER pAd,
193 OUT ROGUEAP_TABLE *Tab,
197 VOID RogueApTableDeleteEntry(
198 IN OUT ROGUEAP_TABLE *Tab,
201 VOID LeapAuthTimeout(
202 IN PVOID SystemSpecific1,
203 IN PVOID FunctionContext,
204 IN PVOID SystemSpecific2,
205 IN PVOID SystemSpecific3);
207 VOID LeapSendRogueAPReport(
208 IN PRTMP_ADAPTER pAd);
210 BOOLEAN CCKMAssocRspSanity(
211 IN PRTMP_ADAPTER pAd,