|
1 /* |
|
2 * Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: EAP and WLAN authentication protocols. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 #if !defined(_EAPOL_H_) |
|
23 #define _EAPOL_H_ |
|
24 |
|
25 // INCLUDES |
|
26 #include <umacoidmsg.h> // For TMacAddress |
|
27 #include <wlanmgmtpacket.h> // For MWlanMgmtPacket |
|
28 #include <EapType.h> // For TIndexType |
|
29 |
|
30 // DATA TYPES |
|
31 enum TWPACipherSuite { |
|
32 ENoCipherSuite, // Unsupported |
|
33 EWEP40, // TBC: Unsupported |
|
34 EWEP104, |
|
35 ETKIP, |
|
36 ECCMP, // Unsupported |
|
37 EWRAP // Unsupported |
|
38 }; |
|
39 |
|
40 enum TMICFailureType { |
|
41 EGroupKey, |
|
42 EPairwiseKey |
|
43 }; |
|
44 |
|
45 // FORWARD DECLARATIONS |
|
46 class eapol_am_core_symbian_c; |
|
47 class MEapolToWlmIf; |
|
48 |
|
49 // CLASS DECLARATION |
|
50 |
|
51 /** |
|
52 * Class for WLM interface. These are the functions that WLM can call in EAPOL DLL. |
|
53 * WLM could use eapol_am_core_symbian_c directly but |
|
54 * that way we would need to export dozens of headers from eapol. This way we need to |
|
55 * export only a few. |
|
56 */ |
|
57 class CEapol |
|
58 : public CBase, public MWlanMgmtPacket // From WLM |
|
59 { |
|
60 public: |
|
61 /** |
|
62 * Static constructor. |
|
63 * @param aPartner Pointer to creator of this class |
|
64 * @param aIsClient Specifies whether this EAPOL instance will |
|
65 * act as a client or server |
|
66 * @return Pointer to instantiated class |
|
67 */ |
|
68 IMPORT_C static CEapol* NewL( |
|
69 MEapolToWlmIf* const aPartner, |
|
70 const TBool aIsClient = ETrue, |
|
71 const TUint aServerIndex = 0); |
|
72 |
|
73 /** |
|
74 * Destructor. |
|
75 */ |
|
76 virtual ~CEapol(); |
|
77 |
|
78 /** |
|
79 * Starts the authentication process. After this is called EAPOL |
|
80 * reads IAP configuration and starts associations. |
|
81 * @param aIndexType IAP index type |
|
82 * @param aIndex IAP index |
|
83 * @param aSSID SSID of the network |
|
84 * @param aWPAOverrideEnabled State whether WPA override is active (used with Easy WLAN) |
|
85 * @param aWPAPSK WPA PSK override (used with Easy WLAN) |
|
86 * @param aWPAPSKLength WPA PSK override length |
|
87 * @return TInt result |
|
88 */ |
|
89 IMPORT_C TInt Start( // Non-Leaving functions OK for WLM? |
|
90 const TIndexType aIndexType, |
|
91 const TUint aIndex, |
|
92 const TSSID& aSSID, |
|
93 const TBool aWPAOverrideEnabled, |
|
94 const TUint8* aWPAPSK, |
|
95 const TUint aWPAPSKLength |
|
96 ); |
|
97 /** |
|
98 * Called by WLM when association has been done (or failed). |
|
99 * After this is called EAPOL starts sending EAPOL-starts. |
|
100 * @param aResult Result code indicating whether association was successful |
|
101 * @param aLocalAddress Local MAC address |
|
102 * @param aRemoteAddress Remote MAC address |
|
103 * @param aReceivedWPAIE WPA IE received from the AP if available (NULL otherwise). |
|
104 * @param aReceivedWPAIELength Received WPA IE length. |
|
105 * @param aSentWPAIE WPA IE sent to the AP if available (NULL otherwise). |
|
106 * @param aSentWPAIELength Sent WPA IE length. |
|
107 * @param aGroupKeyCipherSuite If security mode is WPA then this is the used |
|
108 * group key cipher suite. |
|
109 * @param aPairwiseKeyCipherSuite If security mode is WPA then this is the used |
|
110 * pairwise key cipher suite. |
|
111 * @return TInt result |
|
112 */ |
|
113 IMPORT_C TInt CompleteAssociation( |
|
114 const TInt aResult, |
|
115 const TMacAddress& aLocalAddress, |
|
116 const TMacAddress& aRemoteAddress, |
|
117 const TUint8* const aReceivedWPAIE, // WLM must give only the WPA IE to EAPOL |
|
118 const TUint aReceivedWPAIELength, |
|
119 const TUint8* const aSentWPAIE, |
|
120 const TUint aSentWPAIELength, |
|
121 const TWPACipherSuite aGroupKeyCipherSuite, |
|
122 const TWPACipherSuite aPairwiseKeyCipherSuite |
|
123 ); |
|
124 |
|
125 /** |
|
126 * Indicates that we have disassociated from the AP. |
|
127 * This causes EAPOL to stop everything it is doing and go to idle state. |
|
128 * @return TInt result |
|
129 */ |
|
130 IMPORT_C TInt Disassociated(); |
|
131 |
|
132 /** |
|
133 * Processes received EAPOL packets. |
|
134 * @param aLength Packet length |
|
135 * @param aData Packet data |
|
136 * @return TInt result |
|
137 */ |
|
138 IMPORT_C TInt ReceivePacket( |
|
139 const TUint aLength, |
|
140 const TUint8* const aData); |
|
141 |
|
142 /** |
|
143 * Sends WPA MIC failure report. |
|
144 * @param aFatalMICFailure Flag indicating if this is the second MIC failure |
|
145 * in 60 seconds. |
|
146 * @param aMICFailureType Indicates whether the failure occurred in pairwise or |
|
147 * group key decoding. |
|
148 * @return TInt result |
|
149 */ |
|
150 IMPORT_C TInt SendWPAMICFailureReport( |
|
151 TBool aFatalMICFailure, |
|
152 const TMICFailureType aMICFailureType); |
|
153 |
|
154 protected: |
|
155 |
|
156 CEapol(); |
|
157 |
|
158 void ConstructL( |
|
159 MEapolToWlmIf* const aPartner, |
|
160 const TBool aIsClient, |
|
161 const TUint aServerIndex); |
|
162 |
|
163 private: |
|
164 |
|
165 /// Pointer to next upper stack layer |
|
166 eapol_am_core_symbian_c* iEapolCore; |
|
167 //-------------------------------------------------- |
|
168 }; |
|
169 |
|
170 #endif //#if !defined(_EAPOL_H_) |
|
171 |
|
172 //-------------------------------------------------- |
|
173 |
|
174 |
|
175 // End of file |