author | Pat Downey <patd@symbian.org> |
Wed, 01 Sep 2010 12:23:57 +0100 | |
branch | RCL_3 |
changeset 46 | c74b3d9f6b9e |
parent 45 | bad0cc58d154 |
permissions | -rw-r--r-- |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies). |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: EAP and WLAN authentication protocols. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
2
1c7bc153c08e
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
18 |
/* |
46 | 19 |
* %version: 36.1.2 % |
2
1c7bc153c08e
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
20 |
*/ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
// This is enumeration of EAPOL source code. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
#if defined(USE_EAP_MINIMUM_RELEASE_TRACES) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#undef EAP_FILE_NUMBER_ENUM |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
#define EAP_FILE_NUMBER_ENUM 430 |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
#undef EAP_FILE_NUMBER_DATE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
#define EAP_FILE_NUMBER_DATE 1127594498 |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
#endif //#if defined(USE_EAP_MINIMUM_RELEASE_TRACES) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
#include <e32base.h> |
46 | 31 |
#include "EapTlsPeapUtils.h" |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
#include "EapTlsPeapDbParameterNames.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
#include "EapTlsPeapDbDefaults.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
#include <EapTlsPeapUiConnection.h> |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
#include <EapTlsPeapUiDataConnection.h> |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
#include <EapTlsPeapUiTlsPeapData.h> |
46 | 37 |
#include "eap_am_trace_symbian.h" |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
#ifdef USE_PAC_STORE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
#include "pac_store_db_symbian.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
#endif |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
|
46 | 43 |
const TUint KMaxSqlQueryLength = 256; |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
// CEapTlsPeapUiDataConnection::CEapTlsPeapUiDataConnection() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
CEapTlsPeapUiDataConnection::CEapTlsPeapUiDataConnection(CEapTlsPeapUiConnection * aUiConn) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
: iIsOpened(EFalse) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
, iUiConn(aUiConn) |
46 | 52 |
, iColSet(NULL) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
, iDataPtr(NULL) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
, iFastSpecificColSet(NULL) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
58 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
// CEapTlsPeapUiDataConnection::~CEapTlsPeapUiDataConnection() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
62 |
// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
CEapTlsPeapUiDataConnection::~CEapTlsPeapUiDataConnection() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
64 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
if (iUiConn) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
Close(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
68 |
iUiConn = NULL; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
69 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
71 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
72 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
// CEapTlsPeapUiDataConnection::Open() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
75 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
77 |
TInt CEapTlsPeapUiDataConnection::Open() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
{ |
46 | 79 |
EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeapUiDataConnection::Open: Start EAP-Type=%d\n"), |
80 |
iUiConn->GetEapType())); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
81 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
if (iIsOpened) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
return KErrAlreadyExists; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
|
46 | 87 |
TInt err = iUiConn->GetDatabase(iDatabase); |
88 |
if (err != KErrNone) |
|
89 |
{ |
|
90 |
return err; |
|
91 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
92 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
93 |
iIsOpened = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
94 |
|
46 | 95 |
EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeapUiDataConnection::Open: End\n"))); |
96 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
97 |
return KErrNone; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
98 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
99 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
100 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
101 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
102 |
// CEapTlsPeapUiDataConnection::GetData() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
104 |
// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
105 |
TInt CEapTlsPeapUiDataConnection::GetData(CEapTlsPeapUiTlsPeapData ** aDataPtr) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
106 |
{ |
46 | 107 |
EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeapUiDataConnection::GetData: Start EAP-Type=%d\n"), |
108 |
iUiConn->GetEapType())); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
109 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
110 |
if (aDataPtr == NULL) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
111 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
return KErrArgument; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
113 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
114 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
115 |
if (iIsOpened == EFalse) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
116 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
117 |
EAP_TRACE_DEBUG_SYMBIAN( |
46 | 118 |
(_L("CEapTlsPeapUiDataConnection::GetData: Data Connection not opened\n"))); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
119 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
120 |
return KErrSessionClosed; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
122 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
123 |
if (iDataPtr != 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
125 |
*aDataPtr = iDataPtr; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
126 |
return KErrNone; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
128 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
129 |
iDataPtr = new CEapTlsPeapUiTlsPeapData(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
130 |
if (!iDataPtr) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
131 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
132 |
EAP_TRACE_DEBUG_SYMBIAN( |
46 | 133 |
(_L("CEapTlsPeapUiDataConnection::GetData: ERROR: NO MEMORY!\n"))); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
134 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
135 |
return KErrNoMemory; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
136 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
137 |
|
46 | 138 |
TRAPD(err, FetchDataL()); |
139 |
if (err != KErrNone) |
|
140 |
{ |
|
141 |
delete iDataPtr; |
|
142 |
iDataPtr = NULL; |
|
143 |
||
144 |
delete iColSet; |
|
145 |
iColSet = NULL; |
|
146 |
||
147 |
delete iFastSpecificColSet; |
|
148 |
iFastSpecificColSet = NULL; |
|
149 |
||
150 |
iView.Close(); |
|
151 |
iFastSpecificView.Close(); |
|
152 |
||
153 |
return err; |
|
154 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
155 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
156 |
*aDataPtr = iDataPtr; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
157 |
|
46 | 158 |
EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeapUiDataConnection::GetData: End\n"))); |
159 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
160 |
return KErrNone; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
161 |
} // CEapTlsPeapUiDataConnection::GetData() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
162 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
163 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |
// CEapTlsPeapUiDataConnection::Update() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
166 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
167 |
// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
168 |
TInt CEapTlsPeapUiDataConnection::Update() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
169 |
{ |
46 | 170 |
EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeapUiDataConnection::Update: Start EAP-Type=%d\n"), |
171 |
iUiConn->GetEapType())); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
172 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
173 |
// Do the length checks first. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
174 |
// Check if length of username and realm are less than the max length possible in DB. |
46 | 175 |
if(iDataPtr->GetManualUsername().Length() > KMaxManualUsernameLengthInDB |
176 |
|| iDataPtr->GetManualRealm().Length() > KMaxManualRealmLengthInDB) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
177 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
178 |
// Username or realm too long. Can not be stored in DB. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
179 |
EAP_TRACE_DEBUG_SYMBIAN( |
46 | 180 |
(_L("CEapTlsPeapUiDataConnection::Update: Too long username or realm. Length: UN=%d, Realm=%d\n"), |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
181 |
iDataPtr->GetManualUsername().Length(), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
182 |
iDataPtr->GetManualRealm().Length())); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
183 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
184 |
return KErrOverflow; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
185 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
186 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
187 |
#ifdef USE_FAST_EAP_TYPE |
46 | 188 |
// Check the length of PAC store password. |
45
bad0cc58d154
Revision: 201029
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
189 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
190 |
if(iDataPtr->GetPacStorePassword().Size() > KMaxPasswordLengthInDB) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
191 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
192 |
// PAC store password too long. Can not be stored in DB. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
193 |
EAP_TRACE_DEBUG_SYMBIAN( |
46 | 194 |
(_L("CEapTlsPeapUiDataConnection::Update: Too long PAC store PW. Size:%d\n"), |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
195 |
iDataPtr->GetPacStorePassword().Size())); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
196 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
197 |
return KErrOverflow; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
198 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
199 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
200 |
#endif |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
201 |
|
46 | 202 |
TRAPD(err, UpdateDataL()); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
203 |
|
46 | 204 |
EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeapUiDataConnection::Update: End, err=%d\n"), |
205 |
err)); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
206 |
|
46 | 207 |
return err; |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
208 |
} // CEapTlsPeapUiDataConnection::Update() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
209 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
210 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
211 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
212 |
// CEapTlsPeapUiDataConnection::Close() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
213 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
214 |
// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
215 |
TInt CEapTlsPeapUiDataConnection::Close() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
216 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
217 |
if (iIsOpened == EFalse) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
218 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
219 |
return KErrNone; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
220 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
221 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
222 |
delete iDataPtr; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
223 |
iDataPtr = NULL; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
224 |
|
46 | 225 |
delete iColSet; |
226 |
iColSet = NULL; |
|
227 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
228 |
delete iFastSpecificColSet; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
229 |
iFastSpecificColSet = NULL; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
230 |
|
46 | 231 |
iView.Close(); |
232 |
||
233 |
iFastSpecificView.Close(); |
|
234 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
235 |
iUiConn = NULL; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
236 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
237 |
return KErrNone; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
238 |
} // CEapTlsPeapUiDataConnection::Close() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
239 |
|
46 | 240 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
241 |
// --------------------------------------------------------- |
46 | 242 |
// CEapTlsPeapUiDataConnection::FetchDataL() |
243 |
// --------------------------------------------------------- |
|
244 |
// |
|
245 |
void CEapTlsPeapUiDataConnection::FetchDataL() |
|
246 |
{ |
|
247 |
EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeapUiDataConnection::FetchDataL: Start EAP-Type=%d\n"), |
|
248 |
iUiConn->GetEapType())); |
|
249 |
||
250 |
HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
|
251 |
TPtr sqlStatement = buf->Des(); |
|
252 |
||
253 |
// Form the general query for TLS, PEAP, TTLS and FAST. Query everything. |
|
254 |
_LIT(KSQLQuery, "SELECT * FROM %S WHERE %S=%d AND %S=%d AND %S=%d"); |
|
255 |
||
256 |
if (iUiConn->GetEapType() == eap_type_tls) |
|
257 |
{ |
|
258 |
sqlStatement.Format(KSQLQuery, |
|
259 |
&KTlsDatabaseTableName, |
|
260 |
&KServiceType, |
|
261 |
iUiConn->GetIndexType(), |
|
262 |
&KServiceIndex, |
|
263 |
iUiConn->GetIndex(), |
|
264 |
&KTunnelingType, |
|
265 |
iUiConn->GetTunnelingType()); |
|
266 |
} |
|
267 |
else if (iUiConn->GetEapType() == eap_type_peap) |
|
268 |
{ |
|
269 |
sqlStatement.Format(KSQLQuery, |
|
270 |
&KPeapDatabaseTableName, |
|
271 |
&KServiceType, |
|
272 |
iUiConn->GetIndexType(), |
|
273 |
&KServiceIndex, |
|
274 |
iUiConn->GetIndex(), |
|
275 |
&KTunnelingType, |
|
276 |
iUiConn->GetTunnelingType()); |
|
277 |
} |
|
278 |
else if (iUiConn->GetEapType() == eap_type_ttls || iUiConn->GetEapType() == eap_type_ttls_plain_pap) |
|
279 |
{ |
|
280 |
sqlStatement.Format(KSQLQuery, |
|
281 |
&KTtlsDatabaseTableName, |
|
282 |
&KServiceType, |
|
283 |
iUiConn->GetIndexType(), |
|
284 |
&KServiceIndex, |
|
285 |
iUiConn->GetIndex(), |
|
286 |
&KTunnelingType, |
|
287 |
iUiConn->GetTunnelingType()); |
|
288 |
} |
|
289 |
||
290 |
#ifdef USE_FAST_EAP_TYPE |
|
291 |
else if (iUiConn->GetEapType() == eap_type_fast) |
|
292 |
{ |
|
293 |
// Unlike other EAP types, EAP-FAST has two settings tables. |
|
294 |
// General settings and special settings |
|
295 |
||
296 |
// This is for the General settings. The special settings are read below. |
|
297 |
||
298 |
sqlStatement.Format(KSQLQuery, |
|
299 |
&KFastGeneralSettingsDBTableName, |
|
300 |
&KServiceType, |
|
301 |
iUiConn->GetIndexType(), |
|
302 |
&KServiceIndex, |
|
303 |
iUiConn->GetIndex(), |
|
304 |
&KTunnelingType, |
|
305 |
iUiConn->GetTunnelingType()); |
|
306 |
} |
|
307 |
#endif |
|
308 |
else |
|
309 |
{ |
|
310 |
// Unknown EAP type |
|
311 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EAP-Type=%d - ERROR: Unknown EAP type!\n"), |
|
312 |
iUiConn->GetEapType())); |
|
313 |
||
314 |
User::Leave(KErrNotSupported); |
|
315 |
} |
|
316 |
||
317 |
// Evaluate view |
|
318 |
User::LeaveIfError(iView.Prepare(iDatabase, TDbQuery(sqlStatement))); |
|
319 |
User::LeaveIfError(iView.EvaluateAll()); |
|
320 |
||
321 |
// Get the first (and only) row |
|
322 |
iView.FirstL(); |
|
323 |
iView.GetL(); |
|
324 |
||
325 |
// Get column set so we get the correct column numbers |
|
326 |
delete iColSet; |
|
327 |
iColSet = NULL; |
|
328 |
iColSet = iView.ColSetL(); |
|
329 |
||
330 |
// Start fetching the values |
|
331 |
||
332 |
||
333 |
/**************** only for TTLS PAP ****************/ |
|
334 |
||
335 |
if ( iUiConn->GetEapType() == eap_type_ttls_plain_pap ) |
|
336 |
{ |
|
337 |
// Prompt password |
|
338 |
TUint intValue = iView.ColUint( iColSet->ColNo( |
|
339 |
cf_str_EAP_TLS_PEAP_ttls_pap_password_prompt_literal ) ); |
|
340 |
if ( intValue == 0 ) |
|
341 |
{ |
|
342 |
*( iDataPtr->GetPapPasswordPrompt() ) = EFalse; |
|
343 |
} |
|
344 |
else |
|
345 |
{ |
|
346 |
*( iDataPtr->GetPapPasswordPrompt() ) = ETrue; |
|
347 |
} |
|
348 |
||
349 |
// username |
|
350 |
iDataPtr->GetPapUserName().Copy( iView.ColDes16( iColSet->ColNo( |
|
351 |
cf_str_EAP_TLS_PEAP_ttls_pap_username_literal ) ) ); |
|
352 |
||
353 |
// password |
|
354 |
iDataPtr->GetPapPassword().Copy( iView.ColDes16( iColSet->ColNo( |
|
355 |
cf_str_EAP_TLS_PEAP_ttls_pap_password_literal ) ) ); |
|
356 |
||
357 |
CleanupStack::PopAndDestroy(buf); |
|
358 |
||
359 |
EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeapUiDataConnection::FetchDataL: Return\n"))); |
|
360 |
return; |
|
361 |
} |
|
362 |
||
363 |
// Get use manual username |
|
364 |
TUint intValue = iView.ColUint(iColSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_username_literal)); |
|
365 |
if (intValue == 0) |
|
366 |
{ |
|
367 |
*(iDataPtr->GetUseManualUsername()) = EFalse; |
|
368 |
} |
|
369 |
else |
|
370 |
{ |
|
371 |
*(iDataPtr->GetUseManualUsername()) = ETrue; |
|
372 |
} |
|
373 |
||
374 |
// Get use manual realm |
|
375 |
intValue = iView.ColUint(iColSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_realm_literal)); |
|
376 |
if (intValue == 0) |
|
377 |
{ |
|
378 |
*(iDataPtr->GetUseManualRealm()) = EFalse; |
|
379 |
} |
|
380 |
else |
|
381 |
{ |
|
382 |
*(iDataPtr->GetUseManualRealm()) = ETrue; |
|
383 |
} |
|
384 |
||
385 |
// Get Username |
|
386 |
iDataPtr->GetManualUsername().Copy(iView.ColDes16(iColSet->ColNo(cf_str_EAP_TLS_PEAP_manual_username_literal))); |
|
387 |
||
388 |
// Get Realm |
|
389 |
iDataPtr->GetManualRealm().Copy(iView.ColDes16(iColSet->ColNo(cf_str_EAP_TLS_PEAP_manual_realm_literal))); |
|
390 |
||
391 |
// Get PEAP/TTLS versions |
|
392 |
if (iUiConn->GetEapType() == eap_type_peap |
|
393 |
|| iUiConn->GetEapType() == eap_type_ttls |
|
394 |
#ifdef USE_FAST_EAP_TYPE |
|
395 |
|| iUiConn->GetEapType() == eap_type_fast |
|
396 |
#endif |
|
397 |
) |
|
398 |
{ |
|
399 |
TPtrC8 binaryValue = iView.ColDes8(iColSet->ColNo(cf_str_EAP_TLS_PEAP_accepted_PEAP_versions_literal)); |
|
400 |
||
401 |
const TInt* allowedVersions = reinterpret_cast<const TInt *>(binaryValue.Ptr()); |
|
402 |
||
403 |
TInt i; |
|
404 |
for (i = 0; i < static_cast<TInt>(binaryValue.Length() / sizeof(TInt)); i++) |
|
405 |
{ |
|
406 |
switch(allowedVersions[i]) |
|
407 |
{ |
|
408 |
case 0: |
|
409 |
*(iDataPtr->GetAllowVersion0()) = ETrue; |
|
410 |
break; |
|
411 |
case 1: |
|
412 |
*(iDataPtr->GetAllowVersion1()) = ETrue; |
|
413 |
break; |
|
414 |
case 2: |
|
415 |
*(iDataPtr->GetAllowVersion2()) = ETrue; |
|
416 |
break; |
|
417 |
} |
|
418 |
} |
|
419 |
} |
|
420 |
||
421 |
||
422 |
intValue = iView.ColUint(iColSet->ColNo(cf_str_EAP_TLS_PEAP_use_identity_privacy_literal)); |
|
423 |
||
424 |
if (intValue == 0) |
|
425 |
{ |
|
426 |
*(iDataPtr->GetTlsPrivacy()) = EFalse; |
|
427 |
} |
|
428 |
else |
|
429 |
{ |
|
430 |
*(iDataPtr->GetTlsPrivacy()) = ETrue; |
|
431 |
} |
|
432 |
||
433 |
||
434 |
#ifdef USE_FAST_EAP_TYPE |
|
435 |
||
436 |
EAP_TRACE_DEBUG_SYMBIAN((_L("Fetching EAP-FAST specific Special settings!\n"))); |
|
437 |
||
438 |
if(iUiConn->GetEapType() == eap_type_fast) |
|
439 |
{ |
|
440 |
// This is for the EAP-FAST specific Special settings. |
|
441 |
||
442 |
sqlStatement.Format(KSQLQuery, |
|
443 |
&KFastSpecialSettingsDBTableName, |
|
444 |
&KServiceType, |
|
445 |
iUiConn->GetIndexType(), |
|
446 |
&KServiceIndex, |
|
447 |
iUiConn->GetIndex(), |
|
448 |
&KTunnelingType, |
|
449 |
iUiConn->GetTunnelingType()); |
|
450 |
||
451 |
// Evaluate view |
|
452 |
User::LeaveIfError(iFastSpecificView.Prepare(iDatabase, TDbQuery(sqlStatement))); |
|
453 |
User::LeaveIfError(iFastSpecificView.EvaluateAll()); |
|
454 |
||
455 |
// Get the first (and only) row |
|
456 |
iFastSpecificView.FirstL(); |
|
457 |
iFastSpecificView.GetL(); |
|
458 |
||
459 |
// Get column set so we get the correct column numbers |
|
460 |
delete iFastSpecificColSet; |
|
461 |
iFastSpecificColSet = NULL; |
|
462 |
iFastSpecificColSet = iFastSpecificView.ColSetL(); |
|
463 |
||
464 |
// Start fetching the values |
|
465 |
// The below uses EAP-FAST Specific settings table. So use the specific view and colset. |
|
466 |
||
467 |
// Get provisioning modes |
|
468 |
intValue = iFastSpecificView.ColUint(iFastSpecificColSet->ColNo(cf_str_EAP_FAST_allow_server_authenticated_provisioning_mode_literal)); |
|
469 |
if (intValue == 0) |
|
470 |
{ |
|
471 |
*(iDataPtr->GetAuthProvModeAllowed()) = EFalse; |
|
472 |
} |
|
473 |
else |
|
474 |
{ |
|
475 |
*(iDataPtr->GetAuthProvModeAllowed()) = ETrue; |
|
476 |
} |
|
477 |
||
478 |
intValue = iFastSpecificView.ColUint(iFastSpecificColSet->ColNo(cf_str_EAP_FAST_allow_server_unauthenticated_provisioning_mode_ADHP_literal)); |
|
479 |
if (intValue == 0) |
|
480 |
{ |
|
481 |
*(iDataPtr->GetUnauthProvModeAllowed()) = EFalse; |
|
482 |
} |
|
483 |
else |
|
484 |
{ |
|
485 |
*(iDataPtr->GetUnauthProvModeAllowed()) = ETrue; |
|
486 |
} |
|
487 |
||
488 |
#ifdef USE_PAC_STORE |
|
489 |
// Get PAC store Password |
|
490 |
// PAC store password is in a different database, pac store db. |
|
491 |
// We can use the PacStoreDbUtils to get the PAC store password. |
|
492 |
||
493 |
TBuf8<KMaxPasswordLengthInDB> tmpPacStorePw8; |
|
494 |
||
495 |
iUiConn->GetPacStoreDb()->GetPacStoreDataL( |
|
496 |
cf_str_EAP_FAST_PAC_store_password_literal(), |
|
497 |
tmpPacStorePw8); |
|
498 |
||
499 |
EAP_TRACE_DATA_DEBUG_SYMBIAN( |
|
500 |
("CEapTlsPeapUiDataConnection::FetchDataL: PW from PAC store DB(8 bits)", |
|
501 |
tmpPacStorePw8.Ptr(), |
|
502 |
tmpPacStorePw8.Size())); |
|
503 |
||
504 |
/***** Convert the 8 bit password to 16 bits for the UI ***************/ |
|
505 |
||
506 |
iDataPtr->GetPacStorePassword().Copy(tmpPacStorePw8); // This takes care of the conversion automatically. |
|
507 |
||
508 |
EAP_TRACE_DATA_DEBUG_SYMBIAN( |
|
509 |
("CEapTlsPeapUiDataConnection::FetchDataL: PW to UI (16 bits)", |
|
510 |
iDataPtr->GetPacStorePassword().Ptr(), |
|
511 |
iDataPtr->GetPacStorePassword().Size())); |
|
512 |
||
513 |
/*****************TEST*************/ |
|
514 |
||
515 |
#endif // End: #ifdef USE_PAC_STORE |
|
516 |
||
517 |
} // End: if(iUiConn->GetEapType() == eap_type_fast) |
|
518 |
||
519 |
#endif // End: #ifdef USE_FAST_EAP_TYPE |
|
520 |
||
521 |
CleanupStack::PopAndDestroy(buf); |
|
522 |
||
523 |
EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeapUiDataConnection::FetchDataL: End\n"))); |
|
524 |
||
525 |
} // CEapTlsPeapUiDataConnection::FetchDataL() |
|
526 |
||
527 |
||
528 |
// --------------------------------------------------------- |
|
529 |
// CEapTlsPeapUiDataConnection::UpdateDataL() |
|
530 |
// --------------------------------------------------------- |
|
531 |
// |
|
532 |
void CEapTlsPeapUiDataConnection::UpdateDataL() |
|
533 |
{ |
|
534 |
EAP_TRACE_DEBUG_SYMBIAN( |
|
535 |
(_L("CEapTlsPeapUiDataConnection::UpdateDataL: Start\n"))); |
|
536 |
||
537 |
iView.UpdateL(); |
|
538 |
||
539 |
iView.SetColL( |
|
540 |
iColSet->ColNo(cf_str_EAP_TLS_PEAP_manual_username_literal), |
|
541 |
iDataPtr->GetManualUsername()); |
|
542 |
||
543 |
iView.SetColL( |
|
544 |
iColSet->ColNo(cf_str_EAP_TLS_PEAP_manual_realm_literal), |
|
545 |
iDataPtr->GetManualRealm()); |
|
546 |
||
547 |
if (*(iDataPtr->GetUseManualUsername())) |
|
548 |
{ |
|
549 |
iView.SetColL( |
|
550 |
iColSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_username_literal), |
|
551 |
ETLSPEAPUseManualUsernameYes); |
|
552 |
} |
|
553 |
else |
|
554 |
{ |
|
555 |
iView.SetColL( |
|
556 |
iColSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_username_literal), |
|
557 |
ETLSPEAPUseManualUsernameNo); |
|
558 |
} |
|
559 |
||
560 |
if (*(iDataPtr->GetUseManualRealm())) |
|
561 |
{ |
|
562 |
iView.SetColL( |
|
563 |
iColSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_realm_literal), |
|
564 |
ETLSPEAPUseManualRealmYes); |
|
565 |
} |
|
566 |
else |
|
567 |
{ |
|
568 |
iView.SetColL( |
|
569 |
iColSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_realm_literal), |
|
570 |
ETLSPEAPUseManualRealmNo); |
|
571 |
} |
|
572 |
||
573 |
// PEAP/TTLS versions |
|
574 |
if (iUiConn->GetEapType() == eap_type_peap |
|
575 |
|| iUiConn->GetEapType() == eap_type_ttls |
|
576 |
#ifdef USE_FAST_EAP_TYPE |
|
577 |
|| iUiConn->GetEapType() == eap_type_fast |
|
578 |
#endif |
|
579 |
) |
|
580 |
{ |
|
581 |
TBuf8<KMaxPEAPVersionsStringLengthInDB> acceptedVersions; |
|
582 |
||
583 |
if (*(iDataPtr->GetAllowVersion0())) |
|
584 |
{ |
|
585 |
TInt tmp(0); |
|
586 |
acceptedVersions.Append(reinterpret_cast<const TUint8*>(&tmp), sizeof(TInt)); |
|
587 |
} |
|
588 |
if (*(iDataPtr->GetAllowVersion1())) |
|
589 |
{ |
|
590 |
TInt tmp(1); |
|
591 |
acceptedVersions.Append(reinterpret_cast<const TUint8*>(&tmp), sizeof(TInt)); |
|
592 |
} |
|
593 |
if (*(iDataPtr->GetAllowVersion2())) |
|
594 |
{ |
|
595 |
TInt tmp(2); |
|
596 |
acceptedVersions.Append(reinterpret_cast<const TUint8*>(&tmp), sizeof(TInt)); |
|
597 |
} |
|
598 |
||
599 |
iView.SetColL( |
|
600 |
iColSet->ColNo(cf_str_EAP_TLS_PEAP_accepted_PEAP_versions_literal), |
|
601 |
acceptedVersions); |
|
602 |
} |
|
603 |
||
604 |
// Last full authentication time should be made zero when EAP configurations are modified. |
|
605 |
// This makes sure that the next authentication with this EAP would be full authentication |
|
606 |
// instead of reauthentication even if the session is still valid. |
|
607 |
||
608 |
TPtrC lastFullAuthTimeString; |
|
609 |
||
610 |
switch (iUiConn->GetEapType()) |
|
611 |
{ |
|
612 |
case eap_type_tls: |
|
613 |
{ |
|
614 |
lastFullAuthTimeString.Set(KTLSLastFullAuthTime); |
|
615 |
} |
|
616 |
break; |
|
617 |
||
618 |
case eap_type_peap: |
|
619 |
{ |
|
620 |
lastFullAuthTimeString.Set(KPEAPLastFullAuthTime); |
|
621 |
} |
|
622 |
break; |
|
623 |
||
624 |
case eap_type_ttls: |
|
625 |
{ |
|
626 |
lastFullAuthTimeString.Set(KTTLSLastFullAuthTime); |
|
627 |
} |
|
628 |
break; |
|
629 |
||
630 |
#ifdef USE_FAST_EAP_TYPE |
|
631 |
case eap_type_fast: |
|
632 |
{ |
|
633 |
lastFullAuthTimeString.Set(KFASTLastFullAuthTime); |
|
634 |
} |
|
635 |
break; |
|
636 |
#endif |
|
637 |
||
638 |
case eap_type_ttls_plain_pap: |
|
639 |
{ |
|
640 |
lastFullAuthTimeString.Set( KTTLSPAPLastFullAuthTime ); |
|
641 |
} |
|
642 |
break; |
|
643 |
||
644 |
default: |
|
645 |
{ |
|
646 |
// Should never happen. Don't return error here as this is just to reset the auth time only. |
|
647 |
EAP_TRACE_DEBUG_SYMBIAN( |
|
648 |
(_L("Session Validity: EAP-Type=%d - ERROR: Unknown EAP type!\n"), |
|
649 |
iUiConn->GetEapType() )); |
|
650 |
} |
|
651 |
} |
|
652 |
||
653 |
iView.SetColL( |
|
654 |
iColSet->ColNo(lastFullAuthTimeString), |
|
655 |
default_FullAuthTime); |
|
656 |
||
657 |
EAP_TRACE_DEBUG_SYMBIAN( |
|
658 |
(_L("Session Validity: EAP-Type=%d, Resetting Full Auth Time since settings are modified\n"), |
|
659 |
iUiConn->GetEapType() )); |
|
660 |
||
661 |
||
662 |
// Update TLS Privacy |
|
663 |
if (*(iDataPtr->GetTlsPrivacy())) |
|
664 |
{ |
|
665 |
iView.SetColL( |
|
666 |
iColSet->ColNo(cf_str_EAP_TLS_PEAP_use_identity_privacy_literal), |
|
667 |
ETLSPEAPTLSPrivacyYes); |
|
668 |
} |
|
669 |
else |
|
670 |
{ |
|
671 |
iView.SetColL( |
|
672 |
iColSet->ColNo(cf_str_EAP_TLS_PEAP_use_identity_privacy_literal), |
|
673 |
ETLSPEAPTLSPrivacyNo); |
|
674 |
} |
|
675 |
||
676 |
||
677 |
||
678 |
||
679 |
/************** only for TTLS PAP **************/ |
|
680 |
||
681 |
if( iUiConn->GetEapType() == eap_type_ttls_plain_pap ) |
|
682 |
{ |
|
683 |
// PAP user name |
|
684 |
iView.SetColL( iColSet->ColNo( cf_str_EAP_TLS_PEAP_ttls_pap_username_literal ), |
|
685 |
iDataPtr->GetPapUserName() ); |
|
686 |
// PAP password |
|
687 |
iView.SetColL( iColSet->ColNo( cf_str_EAP_TLS_PEAP_ttls_pap_password_literal ), |
|
688 |
iDataPtr->GetPapPassword() ); |
|
689 |
// PAP password prompt |
|
690 |
if ( *( iDataPtr->GetPapPasswordPrompt() ) ) |
|
691 |
{ |
|
692 |
iView.SetColL( iColSet->ColNo( cf_str_EAP_TLS_PEAP_ttls_pap_password_prompt_literal ), |
|
693 |
EPapPasswordPromptOn ); |
|
694 |
} |
|
695 |
else |
|
696 |
{ |
|
697 |
iView.SetColL( iColSet->ColNo( cf_str_EAP_TLS_PEAP_ttls_pap_password_prompt_literal ), |
|
698 |
EPapPasswordPromptOff ); |
|
699 |
} |
|
700 |
||
701 |
} // if( iUiConn->GetEapType() == eap_type_ttls_plain_pap ) |
|
702 |
||
703 |
||
704 |
||
705 |
// Now put all the updated values in DB table. |
|
706 |
iView.PutL(); |
|
707 |
||
708 |
#ifdef USE_FAST_EAP_TYPE |
|
709 |
||
710 |
if(iUiConn->GetEapType() == eap_type_fast) |
|
711 |
{ |
|
712 |
// Make the view ready for updation. This is important! |
|
713 |
iFastSpecificView.UpdateL(); |
|
714 |
||
715 |
// Update Authentication modes |
|
716 |
if (*(iDataPtr->GetAuthProvModeAllowed())) |
|
717 |
{ |
|
718 |
iFastSpecificView.SetColL( |
|
719 |
iFastSpecificColSet->ColNo(cf_str_EAP_FAST_allow_server_authenticated_provisioning_mode_literal), |
|
720 |
EFASTAuthProvModeAllowedYes); |
|
721 |
} |
|
722 |
else |
|
723 |
{ |
|
724 |
iFastSpecificView.SetColL( |
|
725 |
iFastSpecificColSet->ColNo(cf_str_EAP_FAST_allow_server_authenticated_provisioning_mode_literal), |
|
726 |
EFASTAuthProvModeAllowedNo); |
|
727 |
} |
|
728 |
||
729 |
if (*(iDataPtr->GetUnauthProvModeAllowed())) |
|
730 |
{ |
|
731 |
iFastSpecificView.SetColL( |
|
732 |
iFastSpecificColSet->ColNo(cf_str_EAP_FAST_allow_server_unauthenticated_provisioning_mode_ADHP_literal), |
|
733 |
EFASTUnauthProvModeAllowedYes); |
|
734 |
} |
|
735 |
else |
|
736 |
{ |
|
737 |
iFastSpecificView.SetColL( |
|
738 |
iFastSpecificColSet->ColNo(cf_str_EAP_FAST_allow_server_unauthenticated_provisioning_mode_ADHP_literal), |
|
739 |
EFASTUnauthProvModeAllowedNo); |
|
740 |
} |
|
741 |
||
742 |
// Now put all the updated values in DB table. |
|
743 |
iFastSpecificView.PutL(); |
|
744 |
||
745 |
||
746 |
#ifdef USE_PAC_STORE |
|
747 |
||
748 |
// Update PAC store password. |
|
749 |
// PAC store password should be stored in a different database, pac store db. |
|
750 |
// We can use the UI connection to save the PAC store password. |
|
751 |
||
752 |
EAP_TRACE_DATA_DEBUG_SYMBIAN( |
|
753 |
("CEapTlsPeapUiDataConnection::UpdateDataL: PW from UI(16 bits)", |
|
754 |
iDataPtr->GetPacStorePassword().Ptr(), |
|
755 |
iDataPtr->GetPacStorePassword().Size())); |
|
756 |
||
757 |
TBuf8<KMaxPasswordLengthInDB> tmpSetPacStorePw8; |
|
758 |
tmpSetPacStorePw8.Copy(iDataPtr->GetPacStorePassword()); |
|
759 |
||
760 |
EAP_TRACE_DATA_DEBUG_SYMBIAN( |
|
761 |
("CEapTlsPeapUiDataConnection::UpdateDataL: PW to PAC store DB(8 bits)", |
|
762 |
tmpSetPacStorePw8.Ptr(), |
|
763 |
tmpSetPacStorePw8.Size())); |
|
764 |
||
765 |
iUiConn->GetPacStoreDb()->SetPacStoreDataL( |
|
766 |
cf_str_EAP_FAST_PAC_store_password_literal(), |
|
767 |
tmpSetPacStorePw8); |
|
768 |
||
769 |
/*****************TEST*************/ |
|
770 |
||
771 |
#ifdef PAC_STORE_DATA_HACK |
|
772 |
||
773 |
TBuf<4> tmpSetPacStoreData1; |
|
774 |
TBuf<4> tmpSetPacStoreData2; |
|
775 |
TBuf<4> tmpSetPacStoreData3; |
|
776 |
TBuf<4> tmpSetPacStoreData4; |
|
777 |
TBuf<4> tmpSetPacStoreData5; |
|
778 |
TBuf<4> tmpSetPacStoreData6; |
|
779 |
RArray<SInfoEntry> infoarray1; |
|
780 |
RArray<SInfoEntry> infoarray2; |
|
781 |
||
782 |
tmpSetPacStoreData1.Copy(iDataPtr->GetUsePAC_Store_Group_Reference()); |
|
783 |
tmpSetPacStoreData2.Copy(iDataPtr->GetUsePAC_Store_Group_Value()); |
|
784 |
tmpSetPacStoreData3.Copy(iDataPtr->GetUsePAC_Store_AID_Reference()); |
|
785 |
tmpSetPacStoreData4.Copy(iDataPtr->GetUsePAC_Store_AID_Value()); |
|
786 |
tmpSetPacStoreData6.Copy(iDataPtr->GetUsePAC_Store_PAC_Reference()); |
|
787 |
tmpSetPacStoreData6.Copy(iDataPtr->GetUsePAC_Store_PAC_Value()); |
|
788 |
||
789 |
EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeapUiDataConnection::UpdateDataL: tmpSetPacStoreData=%S\n"), |
|
790 |
&tmpSetPacStorePw)); |
|
791 |
||
792 |
iUiConn->GetPacStoreDb()->SetPacStoreDataL( |
|
793 |
KPacStoreGroupReference, |
|
794 |
tmpSetPacStoreData1, |
|
795 |
KPacStoreGroupReference); |
|
796 |
iUiConn->GetPacStoreDb()->SetPacStoreDataL( |
|
797 |
KPacStoreGroupValue, |
|
798 |
tmpSetPacStoreData2, |
|
799 |
KPacStoreGroupReference); |
|
800 |
iUiConn->GetPacStoreDb()->SetPacStoreDataL( |
|
801 |
KPacStoreAIDReference, |
|
802 |
tmpSetPacStoreData3, |
|
803 |
KPacStoreAIDReference); |
|
804 |
iUiConn->GetPacStoreDb()->SetPacStoreDataL( |
|
805 |
KPacStoreAIDValue, |
|
806 |
tmpSetPacStoreData4, |
|
807 |
KPacStoreAIDReference); |
|
808 |
iUiConn->GetPacStoreDb()->SetPacStoreDataL( |
|
809 |
KPacStorePACReference, |
|
810 |
tmpSetPacStoreData5, |
|
811 |
KPacStorePACValue); |
|
812 |
iUiConn->GetPacStoreDb()->SetPacStoreDataL( |
|
813 |
KPacStorePACValue, |
|
814 |
tmpSetPacStoreData6, |
|
815 |
KPacStorePACReference); |
|
816 |
||
817 |
#endif |
|
818 |
||
819 |
/*****************TEST*************/ |
|
820 |
||
821 |
#endif // End: #ifdef USE_PAC_STORE |
|
822 |
||
823 |
} // End: if(iUiConn->GetEapType() == eap_type_fast) |
|
824 |
||
825 |
#endif // End: #ifdef USE_FAST_EAP_TYPE |
|
826 |
||
827 |
EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeapUiDataConnection::UpdateDataL: End\n"))); |
|
828 |
||
829 |
} // CEapTlsPeapUiDataConnection::UpdateDataL() |
|
830 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
831 |
// End of file |