26
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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 "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 |
*
|
36
|
14 |
* Description: EAP Authentication Notifier
|
26
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
34
|
18 |
/*
|
36
|
19 |
* %version: 15 %
|
34
|
20 |
*/
|
|
21 |
|
26
|
22 |
#ifndef __EAPAUTHNOTIFIER_H__
|
|
23 |
#define __EAPAUTHNOTIFIER_H__
|
|
24 |
|
36
|
25 |
// System includes
|
26
|
26 |
#include <e32base.h>
|
|
27 |
#include <hb/hbcore/hbdevicedialogsymbian.h>
|
|
28 |
|
36
|
29 |
// User includes
|
|
30 |
|
|
31 |
// Forward declarations
|
|
32 |
|
|
33 |
class TEapExpandedType;
|
|
34 |
class CEapAuthObserver;
|
|
35 |
|
|
36 |
// External data types
|
|
37 |
|
|
38 |
//Global function prototypes
|
|
39 |
|
|
40 |
//Constants
|
|
41 |
|
26
|
42 |
const TUint KMaxNotifItemLength = 256;
|
|
43 |
const TUint KMaxUiDataLength = 1024;
|
|
44 |
|
|
45 |
/**
|
|
46 |
* Callback interface
|
|
47 |
*/
|
|
48 |
class MNotificationCallback
|
|
49 |
{
|
|
50 |
public:
|
36
|
51 |
/**
|
|
52 |
* Notify for the client that the Dialog is complete
|
|
53 |
*
|
|
54 |
* @param aStatus status
|
|
55 |
* return -
|
|
56 |
*/
|
26
|
57 |
virtual void DlgComplete( TInt aStatus ) = 0;
|
|
58 |
};
|
|
59 |
|
36
|
60 |
/**
|
|
61 |
* EAP Notifier
|
|
62 |
*/
|
26
|
63 |
NONSHARABLE_CLASS ( CEapAuthNotifier ): public CBase
|
|
64 |
{
|
|
65 |
public:
|
36
|
66 |
// Data types
|
26
|
67 |
|
36
|
68 |
/** EAP Notifier types */
|
26
|
69 |
enum EEapNotifierType
|
|
70 |
{
|
|
71 |
EEapNotifierTypeLEapUsernamePasswordDialog,
|
|
72 |
EEapNotifierTypeGTCQueryDialog,
|
|
73 |
EEapNotifierTypePapAuthQueryDialog,
|
34
|
74 |
EEapNotifierTypePapChallengeDialog,
|
|
75 |
EEapNotifierTypeGtcChallengeDialog,
|
26
|
76 |
EEapNotifierTypeFastInstallPacQueryDialog,
|
|
77 |
EEapNotifierTypeFastPacStorePwQueryDialog,
|
|
78 |
EEapNotifierTypeFastCreateMasterkeyQueryDialog,
|
|
79 |
EEapNotifierTypeFastPacFilePwQueryDialog,
|
|
80 |
EEapNotifierTypeFastStartAuthProvWaitNote,
|
|
81 |
EEapNotifierTypeFastStartUnauthProvWaitNote,
|
|
82 |
EEapNotifierTypePapUsernamePasswordDialog,
|
|
83 |
EEapNotifierTypeFastShowProvNotSuccessNote,
|
|
84 |
EEapNotifierTypeEapMsChapV2UsernamePasswordDialog,
|
|
85 |
EEapNotifierTypeMsChapV2UsernamePasswordDialog,
|
|
86 |
EEapNotifierTypeMsChapV2NewPasswordDialog,
|
|
87 |
EEapNotifierTypeMsChapV2OldPasswordDialog,
|
|
88 |
EEapNotifierTypeMsChapV2PasswordExpiredNote,
|
|
89 |
EEapNotifierTypeGTCUsernamePasswordDialog,
|
|
90 |
};
|
|
91 |
|
36
|
92 |
/** EAP Notifier Data struct */
|
26
|
93 |
struct TEapDialogInfo
|
|
94 |
{
|
|
95 |
TBool iPasswordPromptEnabled;
|
|
96 |
TBool iIsIdentityQuery;
|
|
97 |
TBuf16<KMaxNotifItemLength> iUsername;
|
|
98 |
TBuf16<KMaxNotifItemLength> iPassword;
|
|
99 |
TBuf16<KMaxNotifItemLength> iOldPassword;
|
|
100 |
TBool iIsFirstQuery;
|
|
101 |
TBuf16<KMaxUiDataLength> iUidata;
|
|
102 |
};
|
36
|
103 |
|
26
|
104 |
/**
|
|
105 |
* Two-phased constructor.
|
|
106 |
*/
|
|
107 |
IMPORT_C static CEapAuthNotifier* NewL( MNotificationCallback& aClient );
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Destructor
|
|
111 |
*/
|
|
112 |
~CEapAuthNotifier();
|
36
|
113 |
|
|
114 |
public:
|
26
|
115 |
/**
|
|
116 |
* Start the Notifier
|
36
|
117 |
*
|
26
|
118 |
* @param aType notifier type
|
|
119 |
* @param aPasswordInfo data to be filled
|
|
120 |
* @param aEapType eap type
|
|
121 |
* return -
|
|
122 |
*/
|
|
123 |
IMPORT_C void StartL( EEapNotifierType aType,
|
|
124 |
TEapDialogInfo* aEapInfo,
|
|
125 |
TEapExpandedType& aEapType );
|
|
126 |
|
|
127 |
/**
|
|
128 |
* Cancel() the notifier
|
36
|
129 |
*
|
26
|
130 |
* @param -
|
|
131 |
* return -
|
|
132 |
*/
|
|
133 |
IMPORT_C void Cancel();
|
36
|
134 |
|
26
|
135 |
/**
|
|
136 |
* CompleteL the notifier is complete
|
36
|
137 |
*
|
26
|
138 |
* @param aStatus status
|
|
139 |
* return -
|
|
140 |
*/
|
|
141 |
void CompleteL( TInt aStatus );
|
|
142 |
|
|
143 |
/**
|
|
144 |
* Sets the selected user name and password of the presented dialog
|
36
|
145 |
*
|
26
|
146 |
* @param aPasswordInfo password
|
|
147 |
* return -
|
|
148 |
*/
|
|
149 |
void SetSelectedUnameAndPwd( TEapDialogInfo& aPasswordInfo );
|
|
150 |
|
|
151 |
/**
|
|
152 |
* Sets the selected password of the presented dialog
|
36
|
153 |
*
|
26
|
154 |
* @param aPasswordInfo password
|
|
155 |
* return -
|
|
156 |
*/
|
|
157 |
void SetSelectedPassword(
|
|
158 |
TEapDialogInfo& aPasswordInfo );
|
|
159 |
|
|
160 |
/**
|
|
161 |
* Sets the selected Old password of the presented dialog
|
36
|
162 |
*
|
26
|
163 |
* @param aPasswordInfo old password
|
|
164 |
* return -
|
|
165 |
*/
|
|
166 |
void SetSelectedOldPassword(
|
|
167 |
TEapDialogInfo& aPasswordInfo );
|
|
168 |
|
|
169 |
private:
|
|
170 |
/**
|
|
171 |
* Constructor
|
|
172 |
*/
|
|
173 |
CEapAuthNotifier( MNotificationCallback& aClient );
|
|
174 |
|
|
175 |
/**
|
34
|
176 |
* ConstructL
|
|
177 |
*/
|
|
178 |
void ConstructL();
|
|
179 |
|
|
180 |
/**
|
26
|
181 |
* Set data for the UsernamePassword Dialog(s)
|
36
|
182 |
*
|
26
|
183 |
* @param aPasswordInfo data to be filled
|
|
184 |
* @param aEapType Eap type to be used
|
|
185 |
* @param aMap Pointer to variant data
|
36
|
186 |
* @param aAuthMethod Authentication method to be used
|
26
|
187 |
* return -
|
|
188 |
*/
|
|
189 |
void SetUsernamePasswordDataL(
|
|
190 |
TEapDialogInfo* aPasswordInfo,
|
|
191 |
TEapExpandedType& aEapType,
|
|
192 |
CHbSymbianVariantMap* aMap,
|
34
|
193 |
const TDesC& aAuthMethod );
|
26
|
194 |
|
|
195 |
|
|
196 |
/**
|
|
197 |
* Set data for the query Dialog(s)
|
36
|
198 |
*
|
26
|
199 |
* @param aEapInfo data to be filled
|
|
200 |
* @param aMap Pointer to variant data
|
36
|
201 |
* @param aAuthMethod Authentication method to be used
|
26
|
202 |
* return -
|
|
203 |
*/
|
|
204 |
void SetQueryDialogDataL(
|
|
205 |
TEapDialogInfo* aEapInfo,
|
|
206 |
CHbSymbianVariantMap* aMap,
|
34
|
207 |
const TDesC& aAuthMethod );
|
26
|
208 |
|
|
209 |
/**
|
|
210 |
* Set data for the Install Pac query Dialog(s)
|
36
|
211 |
*
|
26
|
212 |
* @param aEapInfo data to be filled
|
|
213 |
* @param aMap Pointer to variant data
|
|
214 |
* return -
|
|
215 |
*/
|
|
216 |
void SetFastInstallPacQueryDialogDataL(
|
|
217 |
TEapDialogInfo* aEapInfo,
|
|
218 |
CHbSymbianVariantMap* aMap );
|
|
219 |
|
|
220 |
/**
|
|
221 |
* Set data for the Pac file query Dialog(s)
|
36
|
222 |
*
|
26
|
223 |
* @param aEapInfo data to be filled
|
|
224 |
* @param aMap Pointer to variant data
|
|
225 |
* return -
|
|
226 |
*/
|
36
|
227 |
void SetFastPacFileQueryPwDialogDataL(
|
26
|
228 |
TEapDialogInfo* aEapInfo,
|
|
229 |
CHbSymbianVariantMap* aMap );
|
|
230 |
|
|
231 |
/**
|
|
232 |
* Set data for the prov wait note Dialog(s)
|
36
|
233 |
*
|
26
|
234 |
* @param aMap Pointer to variant data
|
36
|
235 |
* @param aAuthProvWaitNote Tells whether auth or unauth
|
26
|
236 |
* return -
|
|
237 |
*/
|
36
|
238 |
void SetFastProvWaitNoteDialogDataL(
|
26
|
239 |
CHbSymbianVariantMap* aMap,
|
|
240 |
TBool aAuthProvWaitNote );
|
|
241 |
|
|
242 |
/**
|
|
243 |
* Set data for the Password Dialog(s)
|
36
|
244 |
*
|
26
|
245 |
* @param aEapType Eap type to be used
|
|
246 |
* @param aMap Pointer to variant data
|
36
|
247 |
* @param aAuthMethod Authentication method to be used
|
26
|
248 |
* return -
|
|
249 |
*/
|
|
250 |
void SetPasswordQueryDataL(
|
|
251 |
TEapExpandedType& aEapType,
|
|
252 |
CHbSymbianVariantMap* aMap,
|
34
|
253 |
const TDesC& aAuthMethod );
|
26
|
254 |
|
36
|
255 |
private: // Data
|
34
|
256 |
|
36
|
257 |
/**
|
|
258 |
* For callback
|
|
259 |
*/
|
34
|
260 |
MNotificationCallback& iClient;
|
|
261 |
|
36
|
262 |
/**
|
|
263 |
* Pointer to the device dialog interface for handling the dialog
|
|
264 |
*/
|
26
|
265 |
CHbDeviceDialogSymbian* iDialog;
|
36
|
266 |
|
|
267 |
/**
|
|
268 |
* The observer to handle the data received from the orbit dialog
|
|
269 |
*/
|
26
|
270 |
CEapAuthObserver* iObserver;
|
34
|
271 |
|
36
|
272 |
/**
|
|
273 |
* Information if request was already completed, in case the
|
26
|
274 |
* observer receives the data signal and the signal about closing the
|
|
275 |
* dialog.
|
|
276 |
*/
|
|
277 |
TBool iCompleted;
|
|
278 |
|
36
|
279 |
/**
|
|
280 |
* Information if request was already cancelled.
|
|
281 |
*/
|
26
|
282 |
TBool iCancelled;
|
|
283 |
|
36
|
284 |
/**
|
|
285 |
* Pointer to the Eap Dialog Info structure
|
|
286 |
*/
|
34
|
287 |
TEapDialogInfo* iEapInfo;
|
|
288 |
|
26
|
289 |
|
|
290 |
};
|
|
291 |
|
|
292 |
#endif //__EAPAUTHNOTIFIER_H__
|
|
293 |
|