author | hgs |
Thu, 16 Sep 2010 13:07:04 +0300 | |
changeset 49 | 43351a4f2da3 |
parent 36 | c98682f98478 |
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 |
/* |
49 | 19 |
* %version: 141 % |
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 438 |
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 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
// INCLUDE FILES |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
#include "EapTlsPeapUtils.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 "EapTlsPeapDbParameterNames.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
#include <x500dn.h> |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
#include <x509cert.h> |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
#include <x509certext.h> |
34 | 38 |
|
39 |
#include "EapPluginTools.h" |
|
26 | 40 |
#include "EapConversion.h" |
34 | 41 |
#include "EapAutomatic.h" |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
#ifdef USE_FAST_EAP_TYPE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
#include "pac_store_db_parameters.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
#endif //#ifdef USE_FAST_EAP_TYPE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
|
26 | 47 |
#include <EapTraceSymbian.h> |
48 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
#include "EapTlsPeapCertFetcher.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
const TUint KMaxSqlQueryLength = 2048; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
const TInt KMicroSecsInAMinute = 60000000; // 60000000 micro seconds is 1 minute. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
const TInt KDefaultColumnInView_One = 1; // For DB view. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
const TInt KMaxEapDbTableNameLength = 64; |
26 | 55 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
// ================= MEMBER FUNCTIONS ======================= |
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 |
void EapTlsPeapUtils::OpenDatabaseL( |
26 | 59 |
RDbNamedDatabase& aDatabase, |
60 |
RFs& aFileServerSession, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
const TIndexType aIndexType, |
26 | 62 |
const TInt aIndex, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
const eap_type_value_e aTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
64 |
eap_type_value_e aEapType) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
EAP_TRACE_DEBUG_SYMBIAN( |
26 | 67 |
(_L("EapTlsPeapUtils::OpenDatabaseL(): - Start - aIndexType=%d, aIndex=%d, aTunnelingType=0xfe%06x%08x, aEapType=0xfe%06x%08x\n"), |
68 |
aIndexType, |
|
69 |
aIndex, |
|
70 |
aTunnelingType.get_vendor_id(), |
|
71 |
aTunnelingType.get_vendor_type(), |
|
72 |
aEapType.get_vendor_id(), |
|
73 |
aEapType.get_vendor_type())); |
|
74 |
||
75 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::OpenDatabaseL()\n")); |
|
0
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 |
if (aEapType == eap_type_tls) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
{ |
26 | 79 |
OpenTlsDatabaseL(aDatabase, aFileServerSession, aIndexType, aIndex, aTunnelingType); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
80 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
81 |
else if (aEapType == eap_type_peap) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
{ |
26 | 83 |
OpenPeapDatabaseL(aDatabase, aFileServerSession, aIndexType, aIndex, aTunnelingType); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
#if defined(USE_TTLS_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
else if (aEapType == eap_type_ttls) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
{ |
26 | 88 |
OpenTtlsDatabaseL(aDatabase, aFileServerSession, aIndexType, aIndex, aTunnelingType); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
#endif // #if defined(USE_TTLS_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
91 |
#if defined(USE_FAST_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
92 |
else if (aEapType == eap_type_fast) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
93 |
{ |
26 | 94 |
OpenFastDatabaseL(aDatabase, aFileServerSession, aIndexType, aIndex, aTunnelingType); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
95 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
#endif // #if defined(USE_FAST_EAP_TYPE) |
36 | 97 |
else if ( aEapType == eap_expanded_type_ttls_plain_pap.get_type() ) |
26 | 98 |
{ |
99 |
OpenTtlsDatabaseL( aDatabase, aFileServerSession, aIndexType, aIndex, aTunnelingType); |
|
100 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
101 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
102 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
// Unsupported EAP type |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
104 |
User::Leave(KErrNotSupported); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
105 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
106 |
} // EapTlsPeapUtils::OpenDatabaseL() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
107 |
|
26 | 108 |
// --------------------------------------------------------- |
109 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
110 |
void EapTlsPeapUtils::OpenTlsDatabaseL( |
26 | 111 |
RDbNamedDatabase& aDatabase, |
112 |
RFs& aFileServerSession, |
|
113 |
const TIndexType aIndexType, |
|
114 |
const TInt aIndex, |
|
115 |
const eap_type_value_e aTunnelingType) |
|
0
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( |
26 | 118 |
(_L("EapTlsPeapUtils::OpenTlsDatabaseL(): - Start - aIndexType=%d, aIndex=%d, aTunnelingType=0xfe%06x%08x\n"), |
119 |
aIndexType, |
|
120 |
aIndex, |
|
121 |
aTunnelingType.get_vendor_id(), |
|
122 |
aTunnelingType.get_vendor_type())); |
|
123 |
||
124 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::OpenTlsDatabaseL()\n")); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
125 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
126 |
// 1. Open/create a database |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
|
26 | 128 |
TInt error(KErrNone); |
129 |
TFileName aPrivateDatabasePathName; |
|
130 |
||
131 |
EapPluginTools::CreateDatabaseLC( |
|
132 |
aDatabase, |
|
133 |
aFileServerSession, |
|
134 |
error, |
|
135 |
KTlsDatabaseName, |
|
136 |
aPrivateDatabasePathName); |
|
137 |
||
138 |
if(error == KErrNone) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
139 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
140 |
aDatabase.Close(); |
26 | 141 |
} |
142 |
else if (error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
143 |
{ |
26 | 144 |
User::LeaveIfError(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
145 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
146 |
|
26 | 147 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTlsDatabaseL(): - calls aDatabase.Open()\n"))); |
148 |
||
149 |
error = aDatabase.Open(aFileServerSession, aPrivateDatabasePathName); |
|
150 |
||
151 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTlsDatabaseL(): - Opened private DB for EAP-TLS. error=%d\n"), error)); |
|
152 |
||
153 |
User::LeaveIfError(error); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
154 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
155 |
// 2. Create the eaptls table to database (ignore error if exists) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
156 |
|
26 | 157 |
// Table columns: |
158 |
//// NAME ////////////////////////////////////////// TYPE //////////// Constant //////////////////// |
|
159 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
160 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
161 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
162 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
163 |
//| EAP_TLS_PEAP_use_manual_realm | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_use_manual_realm_literal |// |
|
164 |
//| EAP_TLS_PEAP_manual_realm | VARCHAR(255) | cf_str_EAP_TLS_PEAP_manual_realm_literal |// |
|
165 |
//| EAP_TLS_PEAP_use_manual_username | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_use_manual_username_literal |// |
|
166 |
//| EAP_TLS_PEAP_manual_username | VARCHAR(255) | cf_str_EAP_TLS_PEAP_manual_username_literal |// |
|
167 |
//| EAP_TLS_PEAP_cipher_suite | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_cipher_suite_literal |// |
|
168 |
//| EAP_TLS_server_authenticates_client | UNSIGNED INTEGER | cf_str_TLS_server_authenticates_client_policy_in_client_literal |// |
|
34 | 169 |
//| CA_cert_label | VARCHAR(255) | KCACertLabel |// |
26 | 170 |
//| client_cert_label | VARCHAR(255) | KClientCertLabel |// |
171 |
//| EAP_TLS_PEAP_saved_session_id | BINARY(32) | cf_str_EAP_TLS_PEAP_saved_session_id_literal |// |
|
172 |
//| EAP_TLS_PEAP_saved_master_secret | BINARY(48) | cf_str_EAP_TLS_PEAP_saved_master_secret_literal |// |
|
173 |
//| EAP_TLS_PEAP_saved_cipher_suite | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_saved_cipher_suite_literal |// |
|
174 |
//| EAP_TLS_PEAP_verify_certificate_realm | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_verify_certificate_realm_literal |// |
|
175 |
//| EAP_TLS_max_session_validity_time | BIGINT | cf_str_EAP_TLS_max_session_validity_time_literal |// |
|
176 |
//| EAP_TLS_last_full_authentication_time | BIGINT | KTLSLastFullAuthTime |// |
|
177 |
//| EAP_TLS_PEAP_use_identity_privacy | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_use_identity_privacy_literal|// |
|
178 |
//| EAP_TLS_PEAP_use_automatic_ca_certificate | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_use_automatic_ca_certificate_literal|// |
|
179 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
180 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
181 |
HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
182 |
TPtr sqlStatement = buf->Des(); |
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 |
// Table creation is divided into two parts because otherwise the SQL string would get too long |
26 | 185 |
_LIT(KSQLCreateTable1, "CREATE TABLE %S \ |
186 |
(%S UNSIGNED INTEGER, \ |
|
187 |
%S UNSIGNED INTEGER, \ |
|
188 |
%S UNSIGNED INTEGER, \ |
|
189 |
%S UNSIGNED INTEGER, \ |
|
190 |
%S UNSIGNED INTEGER, \ |
|
191 |
%S VARCHAR(%d), \ |
|
192 |
%S UNSIGNED INTEGER, \ |
|
193 |
%S VARCHAR(%d), \ |
|
194 |
%S UNSIGNED INTEGER, \ |
|
195 |
%S UNSIGNED INTEGER, \ |
|
196 |
%S VARCHAR(%d), \ |
|
197 |
%S VARCHAR(%d), \ |
|
198 |
%S BINARY(%d), \ |
|
199 |
%S BINARY(%d), \ |
|
200 |
%S UNSIGNED INTEGER, \ |
|
201 |
%S UNSIGNED INTEGER, \ |
|
202 |
%S BIGINT, \ |
|
203 |
%S BIGINT, \ |
|
204 |
%S UNSIGNED INTEGER, \ |
|
205 |
%S UNSIGNED INTEGER)"); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
206 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
207 |
sqlStatement.Format(KSQLCreateTable1, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
208 |
&KTlsDatabaseTableName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
209 |
&KServiceType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
210 |
&KServiceIndex, |
26 | 211 |
&KTunnelingTypeVendorId, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
212 |
&KTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
213 |
&cf_str_EAP_TLS_PEAP_use_manual_realm_literal, |
26 | 214 |
&cf_str_EAP_TLS_PEAP_manual_realm_literal, KMaxRealmLengthInDB, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
215 |
&cf_str_EAP_TLS_PEAP_use_manual_username_literal, |
26 | 216 |
&cf_str_EAP_TLS_PEAP_manual_username_literal, KMaxUsernameLengthInDB, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
217 |
&cf_str_EAP_TLS_PEAP_cipher_suite_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
218 |
&cf_str_TLS_server_authenticates_client_policy_in_client_literal, |
34 | 219 |
&KCACertLabel, KMaxCertLabelLengthInDB, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
220 |
&KClientCertLabel, KMaxCertLabelLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
221 |
&cf_str_EAP_TLS_PEAP_saved_session_id_literal, KMaxSessionIdLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
222 |
&cf_str_EAP_TLS_PEAP_saved_master_secret_literal, KMaxMasterSecretLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
223 |
&cf_str_EAP_TLS_PEAP_saved_cipher_suite_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
224 |
&cf_str_EAP_TLS_PEAP_verify_certificate_realm_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
225 |
&cf_str_EAP_TLS_max_session_validity_time_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
226 |
&KTLSLastFullAuthTime, |
26 | 227 |
&cf_str_EAP_TLS_PEAP_use_identity_privacy_literal, |
228 |
&cf_str_EAP_TLS_PEAP_use_automatic_ca_certificate_literal); |
|
229 |
||
230 |
error = aDatabase.Execute(sqlStatement); |
|
231 |
if (error == KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
232 |
{ |
26 | 233 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTlsDatabaseL - Alter Table error=%d\n"), error) ); |
234 |
_LIT( KColumnDef, "UNSIGNED INTEGER" ); |
|
235 |
AlterTableL( aDatabase, EAddColumn , KTlsDatabaseTableName, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
236 |
cf_str_EAP_TLS_PEAP_use_identity_privacy_literal, KColumnDef); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
237 |
} |
26 | 238 |
else if (error != KErrNone) |
239 |
{ |
|
240 |
User::Leave(error); |
|
241 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
242 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
243 |
// Create table for _allowed_ user certificates |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
244 |
|
26 | 245 |
//// NAME ////////////////// TYPE ////////////// Constant /////////// |
246 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
247 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
248 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
249 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
250 |
//| CertLabel | VARCHAR(255) | KCertLabel |// |
|
251 |
//| SubjectKeyId | BINARY(20) | KSubjectKeyIdentifier |// This is Symbian subjectkey id |
|
252 |
//| ActualSubjectKeyId | BINARY(20) | KActualSubjectKeyIdentifier |// This is the actual subjectkeyid present in the certificate. |
|
253 |
//| SubjectName | VARCHAR(255) | KSubjectName |// |
|
254 |
//| IssuerName | VARCHAR(255) | KIssuerName |// |
|
255 |
//| SerialNumber | VARCHAR(255) | KSerialNumber |// |
|
256 |
//| Thumbprint | BINARY(64) | KThumbprint |// |
|
257 |
////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
258 |
||
259 |
_LIT(KSQLCreateTable2, "CREATE TABLE %S \ |
|
260 |
(%S UNSIGNED INTEGER, \ |
|
261 |
%S UNSIGNED INTEGER, \ |
|
262 |
%S UNSIGNED INTEGER, \ |
|
263 |
%S UNSIGNED INTEGER, \ |
|
264 |
%S VARCHAR(%d), \ |
|
265 |
%S BINARY(%d), \ |
|
266 |
%S BINARY(%d), \ |
|
267 |
%S VARCHAR(%d), \ |
|
268 |
%S VARCHAR(%d), \ |
|
269 |
%S VARCHAR(%d), \ |
|
270 |
%S BINARY(%d))"); |
|
271 |
||
272 |
sqlStatement.Format(KSQLCreateTable2, |
|
273 |
&KTlsAllowedUserCertsDatabaseTableName, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
274 |
&KServiceType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
275 |
&KServiceIndex, |
26 | 276 |
&KTunnelingTypeVendorId, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
277 |
&KTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
278 |
&KCertLabel, KMaxCertLabelLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
279 |
&KSubjectKeyIdentifier, KMaxSubjectKeyIdLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
280 |
&KActualSubjectKeyIdentifier, KKeyIdentifierLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
281 |
&KSubjectName, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
282 |
&KIssuerName, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
283 |
&KSerialNumber, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
284 |
&KThumbprint, KThumbprintMaxLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
285 |
|
26 | 286 |
error = aDatabase.Execute(sqlStatement); |
287 |
if (error != KErrNone && error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
288 |
{ |
26 | 289 |
User::Leave(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
290 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
291 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
292 |
// Create table for _allowed_ CA certs |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
293 |
|
26 | 294 |
//// NAME ////////////////// TYPE ////////////// Constant /////////// |
295 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
296 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
297 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
298 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
299 |
//| CertLabel | VARCHAR(255) | KCACertLabel |// |
|
300 |
//| SubjectKeyId | BINARY(255) | KSubjectKeyIdentifier |// This is Symbian subjectkey id |
|
301 |
//| ActualSubjectKeyId | BINARY(20) | KActualSubjectKeyIdentifier |// This is the actual subjectkeyid present in the certificate. |
|
302 |
//| SubjectName | VARCHAR(255) | KSubjectName |// |
|
303 |
//| IssuerName | VARCHAR(255) | KIssuerName |// |
|
304 |
//| SerialNumber | VARCHAR(255) | KSerialNumber |// |
|
305 |
//| Thumbprint | BINARY(64) | KThumbprint |// |
|
306 |
////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
307 |
||
308 |
_LIT(KSQLCreateTable3, "CREATE TABLE %S \ |
|
309 |
(%S UNSIGNED INTEGER, \ |
|
310 |
%S UNSIGNED INTEGER, \ |
|
311 |
%S UNSIGNED INTEGER, \ |
|
312 |
%S UNSIGNED INTEGER, \ |
|
313 |
%S VARCHAR(%d), \ |
|
314 |
%S BINARY(%d), \ |
|
315 |
%S BINARY(%d), \ |
|
316 |
%S VARCHAR(%d), \ |
|
317 |
%S VARCHAR(%d), \ |
|
318 |
%S VARCHAR(%d), \ |
|
319 |
%S BINARY(%d))"); |
|
320 |
||
321 |
sqlStatement.Format(KSQLCreateTable3, |
|
322 |
&KTlsAllowedCACertsDatabaseTableName, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
323 |
&KServiceType, |
26 | 324 |
&KServiceIndex, |
325 |
&KTunnelingTypeVendorId, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
326 |
&KTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
327 |
&KCertLabel, KMaxCertLabelLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
328 |
&KSubjectKeyIdentifier, KMaxSubjectKeyIdLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
329 |
&KActualSubjectKeyIdentifier, KKeyIdentifierLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
330 |
&KSubjectName, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
331 |
&KIssuerName, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
332 |
&KSerialNumber, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
333 |
&KThumbprint, KThumbprintMaxLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
334 |
|
26 | 335 |
error = aDatabase.Execute(sqlStatement); |
336 |
if (error != KErrNone && error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
337 |
{ |
26 | 338 |
User::Leave(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
339 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
340 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
341 |
// Create table for allowed cipher suites |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
342 |
|
26 | 343 |
//// NAME ///////////////// TYPE ////////////// Constant /////////// |
344 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
345 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
346 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
347 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
348 |
//| CipherSuite | UNSIGNED INTEGER | KCipherSuite |// |
|
349 |
////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
350 |
||
351 |
_LIT(KSQLCreateTable4, "CREATE TABLE %S \ |
|
352 |
(%S UNSIGNED INTEGER, \ |
|
353 |
%S UNSIGNED INTEGER, \ |
|
354 |
%S UNSIGNED INTEGER, \ |
|
355 |
%S UNSIGNED INTEGER, \ |
|
356 |
%S UNSIGNED INTEGER)"); |
|
357 |
||
358 |
sqlStatement.Format(KSQLCreateTable4, |
|
359 |
&KTlsAllowedCipherSuitesDatabaseTableName, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
360 |
&KServiceType, |
26 | 361 |
&KServiceIndex, |
362 |
&KTunnelingTypeVendorId, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
363 |
&KTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
364 |
&KCipherSuite); |
26 | 365 |
|
366 |
error = aDatabase.Execute(sqlStatement); |
|
367 |
if (error != KErrNone && error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
368 |
{ |
26 | 369 |
User::Leave(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
370 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
371 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
372 |
// 4. Check if database table contains a row for this service type and id |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
373 |
|
26 | 374 |
_LIT(KSQLQueryRow, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); |
375 |
||
376 |
sqlStatement.Format(KSQLQueryRow, |
|
377 |
&cf_str_EAP_TLS_PEAP_cipher_suite_literal, |
|
378 |
&KTlsDatabaseTableName, |
|
379 |
&KServiceType, |
|
380 |
aIndexType, |
|
381 |
&KServiceIndex, |
|
382 |
aIndex, |
|
383 |
&KTunnelingTypeVendorId, |
|
384 |
aTunnelingType.get_vendor_id(), |
|
385 |
&KTunnelingType, |
|
386 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
387 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
388 |
RDbView view; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
389 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
390 |
// View must be closed when no longer needed |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
391 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
392 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
393 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
394 |
// 5. If row is not found then add it |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
395 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
396 |
TInt rows = view.CountL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
397 |
CleanupStack::PopAndDestroy(); // view |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
398 |
if (rows == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
399 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
400 |
_LIT(KSQLInsert, "SELECT * FROM %S"); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
401 |
sqlStatement.Format(KSQLInsert, &KTlsDatabaseTableName); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
402 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
403 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited, RDbView::EInsertOnly)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
404 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
405 |
view.InsertL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
406 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
407 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
408 |
CDbColSet* colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
409 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
410 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
411 |
// Set the default values. The other three tables (certs, ca certs & cipher suites) are empty by default. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
412 |
view.SetColL(colSet->ColNo(KServiceType), static_cast<TInt>(aIndexType)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
413 |
view.SetColL(colSet->ColNo(KServiceIndex), aIndex); |
26 | 414 |
view.SetColL(colSet->ColNo(KTunnelingTypeVendorId), aTunnelingType.get_vendor_id()); |
415 |
view.SetColL(colSet->ColNo(KTunnelingType), aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
416 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
417 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_realm_literal), default_EAP_TLS_PEAP_use_manual_realm); |
26 | 418 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_manual_realm_literal), default_EAP_realm); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
419 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
420 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_username_literal), default_EAP_TLS_PEAP_use_manual_username); |
26 | 421 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_manual_username_literal), default_EAP_username); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
422 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
423 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_cipher_suite_literal), default_EAP_TLS_PEAP_cipher_suite); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
424 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
425 |
view.SetColL(colSet->ColNo(cf_str_TLS_server_authenticates_client_policy_in_client_literal), default_EAP_TLS_server_authenticates_client); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
426 |
|
34 | 427 |
view.SetColL(colSet->ColNo(KCACertLabel), default_CA_cert_label); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
428 |
view.SetColL(colSet->ColNo(KClientCertLabel), default_client_cert_label); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
429 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
430 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_verify_certificate_realm_literal), default_EAP_TLS_PEAP_verify_certificate_realm); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
431 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
432 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_max_session_validity_time_literal), default_MaxSessionTime); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
433 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
434 |
view.SetColL(colSet->ColNo(KTLSLastFullAuthTime), default_FullAuthTime); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
435 |
|
34 | 436 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_identity_privacy_literal), default_EAP_TLS_PEAP_TTLS_Privacy); |
26 | 437 |
|
438 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_automatic_ca_certificate_literal), default_EAP_TLS_PEAP_use_automatic_ca_certificate); |
|
439 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
440 |
view.PutL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
441 |
|
26 | 442 |
CleanupStack::PopAndDestroy( colSet ); |
443 |
CleanupStack::PopAndDestroy( &view ); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
444 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
445 |
// Add default disabled cipher suites |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
446 |
_LIT(KSQLInsert2, "SELECT * FROM %S"); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
447 |
sqlStatement.Format(KSQLInsert2, &KTlsAllowedCipherSuitesDatabaseTableName); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
448 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited, RDbView::EInsertOnly)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
449 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
450 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
451 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
452 |
colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
453 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
454 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
455 |
TInt i(0); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
456 |
while (default_allowed_cipher_suites[i] != 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
457 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
458 |
view.InsertL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
459 |
view.SetColL(colSet->ColNo(KServiceType), static_cast<TInt>(aIndexType)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
460 |
view.SetColL(colSet->ColNo(KServiceIndex), aIndex); |
26 | 461 |
view.SetColL(colSet->ColNo(KTunnelingTypeVendorId), aTunnelingType.get_vendor_id()); |
462 |
view.SetColL(colSet->ColNo(KTunnelingType), aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
463 |
view.SetColL(colSet->ColNo(KCipherSuite), default_allowed_cipher_suites[i]); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
464 |
view.PutL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
465 |
i++; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
466 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
467 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
468 |
CleanupStack::PopAndDestroy( colSet ); // Delete colSet. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
469 |
CleanupStack::PopAndDestroy( &view ); // Close view. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
470 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
471 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
472 |
// 6. Do the altering of tables here. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
473 |
// Add columns to existing certificate DB tables for Serial number, Issuer name etc. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
474 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
475 |
TBufC<KDbMaxColName> tableName; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
476 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
477 |
// For the table _allowed_ USER certificates |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
478 |
tableName = KTlsAllowedUserCertsDatabaseTableName; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
479 |
AddExtraCertColumnsL(aDatabase,tableName); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
480 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
481 |
// For the table _allowed_ CA certificates |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
482 |
tableName = KTlsAllowedCACertsDatabaseTableName; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
483 |
AddExtraCertColumnsL(aDatabase,tableName); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
484 |
|
26 | 485 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
486 |
aDatabase.Compact(); |
26 | 487 |
|
488 |
CleanupStack::PopAndDestroy( buf ); |
|
489 |
CleanupStack::Pop( &aDatabase ); |
|
490 |
CleanupStack::Pop( &aFileServerSession ); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
491 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
492 |
|
26 | 493 |
// --------------------------------------------------------- |
494 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
495 |
void EapTlsPeapUtils::OpenPeapDatabaseL( |
26 | 496 |
RDbNamedDatabase& aDatabase, |
497 |
RFs& aFileServerSession, |
|
498 |
const TIndexType aIndexType, |
|
499 |
const TInt aIndex, |
|
500 |
const eap_type_value_e aTunnelingType) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
501 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
502 |
EAP_TRACE_DEBUG_SYMBIAN( |
26 | 503 |
(_L("EapTlsPeapUtils::OpenPeapDatabaseL(): - Start - aIndexType=%d, aIndex=%d, aTunnelingType=0xfe%06x%08x\n"), |
504 |
aIndexType, |
|
505 |
aIndex, |
|
506 |
aTunnelingType.get_vendor_id(), |
|
507 |
aTunnelingType.get_vendor_type())); |
|
508 |
||
509 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::OpenPeapDatabaseL()\n")); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
510 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
511 |
// 1. Open/create a database |
26 | 512 |
|
513 |
TInt error(KErrNone); |
|
514 |
TFileName aPrivateDatabasePathName; |
|
515 |
||
516 |
EapPluginTools::CreateDatabaseLC( |
|
517 |
aDatabase, |
|
518 |
aFileServerSession, |
|
519 |
error, |
|
520 |
KPeapDatabaseName, |
|
521 |
aPrivateDatabasePathName); |
|
522 |
||
523 |
if(error == KErrNone) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
524 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
525 |
aDatabase.Close(); |
26 | 526 |
} |
527 |
else if (error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
528 |
{ |
26 | 529 |
User::LeaveIfError(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
530 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
531 |
|
26 | 532 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenPeapDatabaseL(): - calls aDatabase.Open()\n"))); |
533 |
||
534 |
error = aDatabase.Open(aFileServerSession, aPrivateDatabasePathName); |
|
535 |
||
536 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenPeapDatabaseL(): - Opened private DB for EAP-PEAP. error=%d\n"), error)); |
|
537 |
||
538 |
User::LeaveIfError(error); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
539 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
540 |
// 2. Create the eappeap table to database (ignore error if exists) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
541 |
|
26 | 542 |
// Table columns: |
543 |
//// NAME /////////////////////////////////////////////// TYPE ////////////// Constant /////////////////// |
|
544 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
545 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
546 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
547 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
548 |
//| EAP_TLS_PEAP_use_manual_realm | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_use_manual_realm_literal |// |
|
549 |
//| EAP_TLS_PEAP_manual_realm | VARCHAR(255) | cf_str_EAP_TLS_PEAP_manual_realm_literal |// |
|
550 |
//| EAP_TLS_PEAP_use_manual_username | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_use_manual_username_literal |// |
|
551 |
//| EAP_TLS_PEAP_manual_username | VARCHAR(255) | cf_str_EAP_TLS_PEAP_manual_username_literal |// |
|
552 |
//| EAP_TLS_PEAP_max_count_of_session_resumes | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_max_count_of_session_resumes_literal |// |
|
553 |
//| EAP_TLS_PEAP_cipher_suite | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_cipher_suite_literal |// |
|
554 |
//| EAP_TLS_PEAP_used_PEAP_version | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_used_PEAP_version_literal |// |
|
555 |
//| EAP_TLS_PEAP_accepted_PEAP_versions | BINARY(12) | cf_str_EAP_TLS_PEAP_accepted_PEAP_versions_literal|// |
|
556 |
//| PEAP_accepted_tunneled_client_types | VARBINARY(240) | cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal |// |
|
557 |
//| PEAP_unaccepted_tunneled_client_types | VARBINARY(240) | cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal |// |
|
558 |
//| EAP_TLS_server_authenticates_client | UNSIGNED INTEGER | cf_str_TLS_server_authenticates_client_policy_in_client_literal|// |
|
34 | 559 |
//| CA_cert_label | VARCHAR(255) | KCACertLabel |// |
26 | 560 |
//| client_cert_label | VARCHAR(255) | KClientCertLabel |// |
561 |
//| EAP_TLS_PEAP_saved_session_id | BINARY(32) | cf_str_EAP_TLS_PEAP_saved_session_id_literal |// |
|
562 |
//| EAP_TLS_PEAP_saved_master_secret | BINARY(48) | cf_str_EAP_TLS_PEAP_saved_master_secret_literal |// |
|
563 |
//| EAP_TLS_PEAP_saved_cipher_suite | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_saved_cipher_suite_literal |// |
|
564 |
//| EAP_TLS_PEAP_verify_certificate_realm | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_verify_certificate_realm_literal |// |
|
565 |
//| EAP_PEAP_max_session_validity_time | BIGINT | cf_str_EAP_PEAP_max_session_validity_time_literal |// |
|
566 |
//| EAP_PEAP_last_full_authentication_time | BIGINT | KPEAPLastFullAuthTime |// |
|
567 |
//| EAP_TLS_PEAP_use_identity_privacy | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_use_identity_privacy_literal|// |
|
568 |
//| EAP_TLS_PEAP_use_automatic_ca_certificate | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_use_automatic_ca_certificate_literal|// |
|
569 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
570 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
571 |
HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
572 |
TPtr sqlStatement = buf->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
573 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
574 |
// Table creation is divided into two parts because otherwise the SQL string would get too long |
26 | 575 |
_LIT(KSQLCreateTable1, "CREATE TABLE %S \ |
576 |
(%S UNSIGNED INTEGER, \ |
|
577 |
%S UNSIGNED INTEGER, \ |
|
578 |
%S UNSIGNED INTEGER, \ |
|
579 |
%S UNSIGNED INTEGER, \ |
|
580 |
%S UNSIGNED INTEGER, \ |
|
581 |
%S VARCHAR(%d), \ |
|
582 |
%S UNSIGNED INTEGER, \ |
|
583 |
%S VARCHAR(%d), \ |
|
584 |
%S UNSIGNED INTEGER, \ |
|
585 |
%S UNSIGNED INTEGER, \ |
|
586 |
%S BINARY(%d), \ |
|
587 |
%S VARBINARY(%d), \ |
|
588 |
%S VARBINARY(%d), \ |
|
589 |
%S UNSIGNED INTEGER, \ |
|
590 |
%S VARCHAR(%d), \ |
|
591 |
%S VARCHAR(%d), \ |
|
592 |
%S BINARY(%d), \ |
|
593 |
%S BINARY(%d), \ |
|
594 |
%S UNSIGNED INTEGER, \ |
|
595 |
%S UNSIGNED INTEGER, \ |
|
596 |
%S BIGINT, \ |
|
597 |
%S BIGINT, \ |
|
598 |
%S UNSIGNED INTEGER, \ |
|
599 |
%S UNSIGNED INTEGER)"); |
|
600 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
601 |
sqlStatement.Format(KSQLCreateTable1, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
602 |
&KPeapDatabaseTableName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
603 |
&KServiceType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
604 |
&KServiceIndex, |
26 | 605 |
&KTunnelingTypeVendorId, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
606 |
&KTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
607 |
&cf_str_EAP_TLS_PEAP_use_manual_realm_literal, |
26 | 608 |
&cf_str_EAP_TLS_PEAP_manual_realm_literal, KMaxRealmLengthInDB, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
609 |
&cf_str_EAP_TLS_PEAP_use_manual_username_literal, |
26 | 610 |
&cf_str_EAP_TLS_PEAP_manual_username_literal, KMaxUsernameLengthInDB, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
611 |
&cf_str_EAP_TLS_PEAP_cipher_suite_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
612 |
&cf_str_EAP_TLS_PEAP_used_PEAP_version_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
613 |
&cf_str_EAP_TLS_PEAP_accepted_PEAP_versions_literal, KMaxPEAPVersionsStringLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
614 |
&cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal, KMaxTunneledTypeStringLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
615 |
&cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal, KMaxTunneledTypeStringLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
616 |
&cf_str_TLS_server_authenticates_client_policy_in_client_literal, |
34 | 617 |
&KCACertLabel, KMaxCertLabelLengthInDB, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
618 |
&KClientCertLabel, KMaxCertLabelLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
619 |
&cf_str_EAP_TLS_PEAP_saved_session_id_literal, KMaxSessionIdLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
620 |
&cf_str_EAP_TLS_PEAP_saved_master_secret_literal, KMaxMasterSecretLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
621 |
&cf_str_EAP_TLS_PEAP_saved_cipher_suite_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
622 |
&cf_str_EAP_TLS_PEAP_verify_certificate_realm_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
623 |
&cf_str_EAP_PEAP_max_session_validity_time_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
624 |
&KPEAPLastFullAuthTime, |
26 | 625 |
&cf_str_EAP_TLS_PEAP_use_identity_privacy_literal, |
626 |
&cf_str_EAP_TLS_PEAP_use_automatic_ca_certificate_literal); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
627 |
|
26 | 628 |
error = aDatabase.Execute(sqlStatement); |
629 |
if (error == KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
630 |
{ |
26 | 631 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenPeapDatabaseL - Alter Table error=%d\n"), error) ); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
632 |
_LIT( KColumnDef, "UNSIGNED INTEGER" ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
633 |
AlterTableL( aDatabase, EAddColumn , KPeapDatabaseTableName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
634 |
cf_str_EAP_TLS_PEAP_use_identity_privacy_literal, KColumnDef); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
635 |
} |
26 | 636 |
else if (error != KErrNone) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
637 |
{ |
26 | 638 |
User::Leave(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
639 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
640 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
641 |
// Create table for _allowed_ user certificates |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
642 |
|
26 | 643 |
//// NAME ////////////////// TYPE ////////////// Constant /////////// |
644 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
645 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
646 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
647 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
648 |
//| CertLabel | VARCHAR(255) | KCACertLabel |// |
|
649 |
//| SubjectKeyId | BINARY(20) | KSubjectKeyIdentifier |// This is Symbian subjectkey id |
|
650 |
//| ActualSubjectKeyId | BINARY(20) | KActualSubjectKeyIdentifier |// This is the actual subjectkeyid present in the certificate. |
|
651 |
//| SubjectName | VARCHAR(255) | KSubjectName |// |
|
652 |
//| IssuerName | VARCHAR(255) | KIssuerName |// |
|
653 |
//| SerialNumber | VARCHAR(255) | KSerialNumber |// |
|
654 |
//| Thumbprint | BINARY(64) | KThumbprint |// |
|
655 |
////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
656 |
||
657 |
_LIT(KSQLCreateTable2, "CREATE TABLE %S \ |
|
658 |
(%S UNSIGNED INTEGER, \ |
|
659 |
%S UNSIGNED INTEGER, \ |
|
660 |
%S UNSIGNED INTEGER, \ |
|
661 |
%S UNSIGNED INTEGER, \ |
|
662 |
%S VARCHAR(%d), \ |
|
663 |
%S BINARY(%d), \ |
|
664 |
%S BINARY(%d), \ |
|
665 |
%S VARCHAR(%d), \ |
|
666 |
%S VARCHAR(%d), \ |
|
667 |
%S VARCHAR(%d), \ |
|
668 |
%S BINARY(%d))"); |
|
669 |
||
670 |
sqlStatement.Format(KSQLCreateTable2, |
|
671 |
&KPeapAllowedUserCertsDatabaseTableName, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
672 |
&KServiceType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
673 |
&KServiceIndex, |
26 | 674 |
&KTunnelingTypeVendorId, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
675 |
&KTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
676 |
&KCertLabel, KMaxCertLabelLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
677 |
&KSubjectKeyIdentifier, KMaxSubjectKeyIdLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
678 |
&KActualSubjectKeyIdentifier, KKeyIdentifierLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
679 |
&KSubjectName, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
680 |
&KIssuerName, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
681 |
&KSerialNumber, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
682 |
&KThumbprint, KThumbprintMaxLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
683 |
|
26 | 684 |
error = aDatabase.Execute(sqlStatement); |
685 |
if (error != KErrNone && error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
686 |
{ |
26 | 687 |
User::Leave(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
688 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
689 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
690 |
// Create table for _allowed_ CA certs |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
691 |
|
26 | 692 |
//// NAME ////////////////// TYPE ////////////// Constant /////////// |
693 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
694 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
695 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
696 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
697 |
//| CACertLabel | VARCHAR(255) | KCACertLabel |// |
|
698 |
//| SubjectKeyId | BINARY(20) | KSubjectKeyIdentifier |// This is Symbian subjectkey id |
|
699 |
//| ActualSubjectKeyId | BINARY(20) | KActualSubjectKeyIdentifier |// This is the actual subjectkeyid present in the certificate. |
|
700 |
//| SubjectName | VARCHAR(255) | KSubjectName |// |
|
701 |
//| IssuerName | VARCHAR(255) | KIssuerName |// |
|
702 |
//| SerialNumber | VARCHAR(255) | KSerialNumber |// |
|
703 |
//| Thumbprint | BINARY(64) | KThumbprint |// |
|
704 |
////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
705 |
||
706 |
_LIT(KSQLCreateTable3, "CREATE TABLE %S \ |
|
707 |
(%S UNSIGNED INTEGER, \ |
|
708 |
%S UNSIGNED INTEGER, \ |
|
709 |
%S UNSIGNED INTEGER, \ |
|
710 |
%S UNSIGNED INTEGER, \ |
|
711 |
%S VARCHAR(%d), \ |
|
712 |
%S BINARY(%d), \ |
|
713 |
%S BINARY(%d), \ |
|
714 |
%S VARCHAR(%d), \ |
|
715 |
%S VARCHAR(%d), \ |
|
716 |
%S VARCHAR(%d), \ |
|
717 |
%S BINARY(%d))"); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
718 |
|
26 | 719 |
sqlStatement.Format(KSQLCreateTable3, |
720 |
&KPeapAllowedCACertsDatabaseTableName, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
721 |
&KServiceType, |
26 | 722 |
&KServiceIndex, |
723 |
&KTunnelingTypeVendorId, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
724 |
&KTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
725 |
&KCertLabel, KMaxCertLabelLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
726 |
&KSubjectKeyIdentifier, KMaxSubjectKeyIdLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
727 |
&KActualSubjectKeyIdentifier, KKeyIdentifierLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
728 |
&KSubjectName, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
729 |
&KIssuerName, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
730 |
&KSerialNumber, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
731 |
&KThumbprint, KThumbprintMaxLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
732 |
|
26 | 733 |
error = aDatabase.Execute(sqlStatement); |
734 |
if (error != KErrNone && error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
735 |
{ |
26 | 736 |
User::Leave(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
737 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
738 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
739 |
// Create table for _allowed_ cipher suites |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
740 |
|
26 | 741 |
//// NAME ///////////////////// TYPE ////////////// Constant /////////// |
742 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
743 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
744 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
745 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
746 |
//| CipherSuite | UNSIGNED INTEGER | KCipherSuite |// |
|
747 |
////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
748 |
||
749 |
_LIT(KSQLCreateTable4, "CREATE TABLE %S \ |
|
750 |
(%S UNSIGNED INTEGER, \ |
|
751 |
%S UNSIGNED INTEGER, \ |
|
752 |
%S UNSIGNED INTEGER, \ |
|
753 |
%S UNSIGNED INTEGER, \ |
|
754 |
%S UNSIGNED INTEGER)"); |
|
755 |
||
756 |
sqlStatement.Format(KSQLCreateTable4, |
|
757 |
&KPeapAllowedCipherSuitesDatabaseTableName, |
|
758 |
&KServiceType, |
|
759 |
&KServiceIndex, |
|
760 |
&KTunnelingTypeVendorId, |
|
761 |
&KTunnelingType, |
|
762 |
&KCipherSuite); |
|
763 |
||
764 |
error = aDatabase.Execute(sqlStatement); |
|
765 |
if (error != KErrNone && error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
766 |
{ |
26 | 767 |
User::Leave(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
768 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
769 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
770 |
// 4. Check if database table contains a row for this service type and id |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
771 |
|
26 | 772 |
_LIT(KSQLQueryRow, "SELECT * FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); |
773 |
||
774 |
sqlStatement.Format(KSQLQueryRow, |
|
775 |
&KPeapDatabaseTableName, |
|
776 |
&KServiceType, |
|
777 |
aIndexType, |
|
778 |
&KServiceIndex, |
|
779 |
aIndex, |
|
780 |
&KTunnelingTypeVendorId, |
|
781 |
aTunnelingType.get_vendor_id(), |
|
782 |
&KTunnelingType, |
|
783 |
aTunnelingType.get_vendor_type()); |
|
784 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
785 |
RDbView view; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
786 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
787 |
// View must be closed when no longer needed |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
788 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
789 |
User::LeaveIfError(view.EvaluateAll()); |
26 | 790 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
791 |
// 5. If row is not found then add it |
26 | 792 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
793 |
TInt rows = view.CountL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
794 |
CleanupStack::PopAndDestroy(); // view |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
795 |
if (rows == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
796 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
797 |
_LIT(KSQLInsert, "SELECT * FROM %S"); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
798 |
sqlStatement.Format(KSQLInsert, &KPeapDatabaseTableName); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
799 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
800 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited, RDbView::EInsertOnly)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
801 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
802 |
view.InsertL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
803 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
804 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
805 |
CDbColSet* colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
806 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
807 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
808 |
// Set the default values. The other three tables (certs, ca certs & cipher suites) are empty by default. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
809 |
view.SetColL(colSet->ColNo(KServiceType), static_cast<TInt>(aIndexType)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
810 |
view.SetColL(colSet->ColNo(KServiceIndex), aIndex); |
26 | 811 |
view.SetColL(colSet->ColNo(KTunnelingTypeVendorId), aTunnelingType.get_vendor_id()); |
812 |
view.SetColL(colSet->ColNo(KTunnelingType), aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
813 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
814 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_realm_literal), default_EAP_TLS_PEAP_use_manual_realm); |
26 | 815 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_manual_realm_literal), default_EAP_realm); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
816 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
817 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_username_literal), default_EAP_TLS_PEAP_use_manual_username); |
26 | 818 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_manual_username_literal), default_EAP_username); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
819 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
820 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_cipher_suite_literal), default_EAP_TLS_PEAP_cipher_suite); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
821 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
822 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_used_PEAP_version_literal), default_EAP_TLS_PEAP_used_PEAP_version); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
823 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
824 |
TInt i(0); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
825 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
826 |
while (default_EAP_TLS_PEAP_accepted_PEAP_versions[i] != -1) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
827 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
828 |
i++; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
829 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
830 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
831 |
TBuf8<KMaxPEAPVersionsStringLengthInDB> tmp; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
832 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
833 |
tmp.Copy(reinterpret_cast<const TUint8 *> (default_EAP_TLS_PEAP_accepted_PEAP_versions), i * sizeof(TInt)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
834 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
835 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_accepted_PEAP_versions_literal), tmp); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
836 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
837 |
view.SetColL(colSet->ColNo(cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal), default_PEAP_tunneled_types); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
838 |
view.SetColL(colSet->ColNo(cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal), default_PEAP_tunneled_types); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
839 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
840 |
view.SetColL(colSet->ColNo(cf_str_TLS_server_authenticates_client_policy_in_client_literal), default_EAP_PEAP_TTLS_server_authenticates_client); |
34 | 841 |
view.SetColL(colSet->ColNo(KCACertLabel), default_CA_cert_label); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
842 |
view.SetColL(colSet->ColNo(KClientCertLabel), default_client_cert_label); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
843 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
844 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_verify_certificate_realm_literal), default_EAP_TLS_PEAP_verify_certificate_realm); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
845 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
846 |
view.SetColL(colSet->ColNo(cf_str_EAP_PEAP_max_session_validity_time_literal), default_MaxSessionTime); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
847 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
848 |
view.SetColL(colSet->ColNo(KPEAPLastFullAuthTime), default_FullAuthTime); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
849 |
|
34 | 850 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_identity_privacy_literal), default_EAP_TLS_PEAP_TTLS_Privacy); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
851 |
|
26 | 852 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_automatic_ca_certificate_literal), default_EAP_TLS_PEAP_use_automatic_ca_certificate); |
853 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
854 |
view.PutL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
855 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
856 |
CleanupStack::PopAndDestroy(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
857 |
CleanupStack::PopAndDestroy( &view ); // Close view. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
858 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
859 |
// Add default disabled cipher suites |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
860 |
_LIT(KSQLInsert2, "SELECT * FROM %S"); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
861 |
sqlStatement.Format(KSQLInsert2, &KPeapAllowedCipherSuitesDatabaseTableName); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
862 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited, RDbView::EInsertOnly)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
863 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
864 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
865 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
866 |
colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
867 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
868 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
869 |
i = 0; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
870 |
while (default_allowed_cipher_suites[i] != 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
871 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
872 |
view.InsertL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
873 |
view.SetColL(colSet->ColNo(KServiceType), static_cast<TInt>(aIndexType)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
874 |
view.SetColL(colSet->ColNo(KServiceIndex), aIndex); |
26 | 875 |
view.SetColL(colSet->ColNo(KTunnelingTypeVendorId), aTunnelingType.get_vendor_id()); |
876 |
view.SetColL(colSet->ColNo(KTunnelingType), aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
877 |
view.SetColL(colSet->ColNo(KCipherSuite), default_allowed_cipher_suites[i]); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
878 |
view.PutL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
879 |
i++; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
880 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
881 |
|
26 | 882 |
CleanupStack::PopAndDestroy( colSet ); |
883 |
CleanupStack::PopAndDestroy( &view ); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
884 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
885 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
886 |
// 6. Do the altering of tables here. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
887 |
// Add columns to existing certificate DB tables for Serial number, Issuer name etc. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
888 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
889 |
TBufC<KDbMaxColName> tableName; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
890 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
891 |
// For the table _allowed_ USER certificates |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
892 |
tableName = KPeapAllowedUserCertsDatabaseTableName; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
893 |
AddExtraCertColumnsL(aDatabase,tableName); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
894 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
895 |
// For the table _allowed_ CA certificates |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
896 |
tableName = KPeapAllowedCACertsDatabaseTableName; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
897 |
AddExtraCertColumnsL(aDatabase,tableName); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
898 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
899 |
aDatabase.Compact(); |
26 | 900 |
|
901 |
CleanupStack::PopAndDestroy( buf ); |
|
902 |
CleanupStack::Pop( &aDatabase ); |
|
903 |
CleanupStack::Pop( &aFileServerSession ); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
904 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
905 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
906 |
#if defined(USE_TTLS_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
907 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
908 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
909 |
// EapTlsPeapUtils::OpenTtlsDatabaseL() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
910 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
911 |
// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
912 |
void EapTlsPeapUtils::OpenTtlsDatabaseL( |
26 | 913 |
RDbNamedDatabase& aDatabase, |
914 |
RFs& aFileServerSession, |
|
915 |
const TIndexType aIndexType, |
|
916 |
const TInt aIndex, |
|
917 |
const eap_type_value_e aTunnelingType) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
918 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
919 |
EAP_TRACE_DEBUG_SYMBIAN( |
26 | 920 |
(_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): - Start - aIndexType=%d, aIndex=%d, aTunnelingType=0xfe%06x%08x\n"), |
921 |
aIndexType, |
|
922 |
aIndex, |
|
923 |
aTunnelingType.get_vendor_id(), |
|
924 |
aTunnelingType.get_vendor_type())); |
|
925 |
||
926 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::OpenTtlsDatabaseL()\n")); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
927 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
928 |
// 1. Open/create a database |
26 | 929 |
|
930 |
TInt error(KErrNone); |
|
931 |
TFileName aPrivateDatabasePathName; |
|
932 |
||
933 |
EapPluginTools::CreateDatabaseLC( |
|
934 |
aDatabase, |
|
935 |
aFileServerSession, |
|
936 |
error, |
|
937 |
KTtlsDatabaseName, |
|
938 |
aPrivateDatabasePathName); |
|
939 |
||
940 |
if(error == KErrNone) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
941 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
942 |
aDatabase.Close(); |
26 | 943 |
} |
944 |
else if (error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
945 |
{ |
26 | 946 |
User::LeaveIfError(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
947 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
948 |
|
26 | 949 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): - calls aDatabase.Open()\n"))); |
950 |
||
951 |
error = aDatabase.Open(aFileServerSession, aPrivateDatabasePathName); |
|
952 |
||
953 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): - Opened private DB for EAP-TTLS. error=%d\n"), error)); |
|
954 |
||
955 |
User::LeaveIfError(error); |
|
956 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
957 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
958 |
// 2. Create the eapttls table to database (ignore error if exists) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
959 |
|
26 | 960 |
// Table columns: |
961 |
//// NAME //////////////////////////////////////////// TYPE ////////////// Constant /////////////////// |
|
962 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
963 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
964 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
965 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
966 |
//| EAP_TLS_PEAP_use_manual_realm | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_use_manual_realm_literal |// |
|
967 |
//| EAP_TLS_PEAP_manual_realm | VARCHAR(255) | cf_str_EAP_TLS_PEAP_manual_realm_literal |// |
|
968 |
//| EAP_TLS_PEAP_use_manual_username | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_use_manual_username_literal |// |
|
969 |
//| EAP_TLS_PEAP_manual_username | VARCHAR(255) | cf_str_EAP_TLS_PEAP_manual_username_literal |// |
|
970 |
//| EAP_TLS_PEAP_cipher_suite | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_cipher_suite_literal |// |
|
971 |
//| EAP_TLS_PEAP_used_PEAP_version | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_used_PEAP_version_literal |// |
|
972 |
//| EAP_TLS_PEAP_accepted_PEAP_versions | BINARY(12) | cf_str_EAP_TLS_PEAP_accepted_PEAP_versions_literal|// |
|
973 |
//| PEAP_accepted_tunneled_client_types | VARBINARY(240) | cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal |// |
|
974 |
//| PEAP_unaccepted_tunneled_client_types | VARBINARY(240) | cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal |// |
|
975 |
//| EAP_TLS_server_authenticates_client | UNSIGNED INTEGER | cf_str_TLS_server_authenticates_client_policy_in_client_literal|// |
|
34 | 976 |
//| CA_cert_label | VARCHAR(255) | KCACertLabel |// |
26 | 977 |
//| client_cert_label | VARCHAR(255) | KClientCertLabel |// |
978 |
//| EAP_TLS_PEAP_saved_session_id | BINARY(32) | cf_str_EAP_TLS_PEAP_saved_session_id_literal |// |
|
979 |
//| EAP_TLS_PEAP_saved_master_secret | BINARY(48) | cf_str_EAP_TLS_PEAP_saved_master_secret_literal |// |
|
980 |
//| EAP_TLS_PEAP_saved_cipher_suite | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_saved_cipher_suite_literal |// |
|
981 |
//| EAP_TLS_PEAP_verify_certificate_realm | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_verify_certificate_realm_literal |// |
|
982 |
//| EAP_TTLS_max_session_validity_time | BIGINT | cf_str_EAP_TTLS_max_session_validity_time_literal |// |
|
983 |
//| EAP_TTLS_last_full_authentication_time | BIGINT | KTTLSLastFullAuthTime |// |
|
984 |
//| EAP_TLS_PEAP_use_identity_privacy | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_use_identity_privacy_literal |// |
|
985 |
||
986 |
||
987 |
//| EAP_TLS_PEAP_ttls_pap_password_prompt | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_ttls_pap_password_prompt_literal |// |
|
988 |
//| EAP_TLS_PEAP_ttls_pap_username | VARCHAR(253) | cf_str_EAP_TLS_PEAP_ttls_pap_username_literal |// |
|
989 |
//| EAP_TLS_PEAP_ttls_pap_password | VARCHAR(128) | cf_str_EAP_TLS_PEAP_ttls_pap_password_literal |// |
|
990 |
//| EAP_TLS_PEAP_ttls_pap_max_session_validity_time | BIGINT | cf_str_EAP_TLS_PEAP_ttls_pap_max_session_validity_time_literal |// |
|
991 |
//| EAP_TLS_PEAP_ttls_pap_last_full_authentication_time | BIGINT | KTTLSPAPLastFullAuthTime |// |
|
992 |
||
993 |
//| EAP_TLS_PEAP_use_automatic_ca_certificate | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_use_automatic_ca_certificate_literal|// |
|
994 |
||
995 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
996 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
997 |
HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
998 |
TPtr sqlStatement = buf->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
999 |
|
26 | 1000 |
// Table creation is divided into two parts because otherwise the SQL string would get too long |
1001 |
_LIT(KSQLCreateTable1, "CREATE TABLE %S \ |
|
1002 |
(%S UNSIGNED INTEGER, \ |
|
1003 |
%S UNSIGNED INTEGER, \ |
|
1004 |
%S UNSIGNED INTEGER, \ |
|
1005 |
%S UNSIGNED INTEGER, \ |
|
1006 |
%S UNSIGNED INTEGER, \ |
|
1007 |
%S VARCHAR(%d), \ |
|
1008 |
%S UNSIGNED INTEGER, \ |
|
1009 |
%S VARCHAR(%d), \ |
|
1010 |
%S UNSIGNED INTEGER, \ |
|
1011 |
%S UNSIGNED INTEGER, \ |
|
1012 |
%S BINARY(%d), \ |
|
1013 |
%S VARBINARY(%d), \ |
|
1014 |
%S VARBINARY(%d), \ |
|
1015 |
%S UNSIGNED INTEGER, \ |
|
1016 |
%S VARCHAR(%d), \ |
|
1017 |
%S VARCHAR(%d), \ |
|
1018 |
%S BINARY(%d), \ |
|
1019 |
%S BINARY(%d), \ |
|
1020 |
%S UNSIGNED INTEGER, \ |
|
1021 |
%S UNSIGNED INTEGER, \ |
|
1022 |
%S BIGINT, \ |
|
1023 |
%S BIGINT, \ |
|
1024 |
%S UNSIGNED INTEGER, \ |
|
1025 |
%S UNSIGNED INTEGER, \ |
|
1026 |
%S VARCHAR(%d), \ |
|
1027 |
%S VARCHAR(%d), \ |
|
1028 |
%S BIGINT, \ |
|
1029 |
%S BIGINT)"); |
|
1030 |
||
1031 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): sqlStatement.Format(KSQLCreateTable1)\n")) ); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1032 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1033 |
sqlStatement.Format( KSQLCreateTable1, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1034 |
&KTtlsDatabaseTableName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1035 |
&KServiceType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1036 |
&KServiceIndex, |
26 | 1037 |
&KTunnelingTypeVendorId, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1038 |
&KTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1039 |
&cf_str_EAP_TLS_PEAP_use_manual_realm_literal, |
26 | 1040 |
&cf_str_EAP_TLS_PEAP_manual_realm_literal, KMaxRealmLengthInDB, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1041 |
&cf_str_EAP_TLS_PEAP_use_manual_username_literal, |
26 | 1042 |
&cf_str_EAP_TLS_PEAP_manual_username_literal, KMaxUsernameLengthInDB, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1043 |
&cf_str_EAP_TLS_PEAP_cipher_suite_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1044 |
&cf_str_EAP_TLS_PEAP_used_PEAP_version_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1045 |
&cf_str_EAP_TLS_PEAP_accepted_PEAP_versions_literal, KMaxPEAPVersionsStringLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1046 |
&cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal, KMaxTunneledTypeStringLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1047 |
&cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal, KMaxTunneledTypeStringLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1048 |
&cf_str_TLS_server_authenticates_client_policy_in_client_literal, |
34 | 1049 |
&KCACertLabel, KMaxCertLabelLengthInDB, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1050 |
&KClientCertLabel, KMaxCertLabelLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1051 |
&cf_str_EAP_TLS_PEAP_saved_session_id_literal, KMaxSessionIdLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1052 |
&cf_str_EAP_TLS_PEAP_saved_master_secret_literal, KMaxMasterSecretLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1053 |
&cf_str_EAP_TLS_PEAP_saved_cipher_suite_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1054 |
&cf_str_EAP_TLS_PEAP_verify_certificate_realm_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1055 |
&cf_str_EAP_TTLS_max_session_validity_time_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1056 |
&KTTLSLastFullAuthTime, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1057 |
&cf_str_EAP_TLS_PEAP_use_identity_privacy_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1058 |
&cf_str_EAP_TLS_PEAP_ttls_pap_password_prompt_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1059 |
&cf_str_EAP_TLS_PEAP_ttls_pap_username_literal, KMaxPapUserNameLengthInDb, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1060 |
&cf_str_EAP_TLS_PEAP_ttls_pap_password_literal, KMaxPapPasswordLengthInDb, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1061 |
&cf_str_EAP_TLS_PEAP_ttls_pap_max_session_validity_time_literal, |
26 | 1062 |
&KTTLSPAPLastFullAuthTime); |
1063 |
||
1064 |
||
1065 |
||
1066 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): aDatabase.Execute()\n")) ); |
|
1067 |
||
1068 |
error = aDatabase.Execute(sqlStatement); |
|
1069 |
if (error == KErrNone) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1070 |
{ |
26 | 1071 |
// SQL command will be too long if this is included to KSQLCreateTable1. |
1072 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): OK, Alter Table error=%d\n"), error) ); |
|
1073 |
||
1074 |
_LIT( KColumnDef6, "UNSIGNED INTEGER" ); |
|
1075 |
AlterTableL( aDatabase, EAddColumn , KTtlsDatabaseTableName, |
|
1076 |
cf_str_EAP_TLS_PEAP_use_automatic_ca_certificate_literal, KColumnDef6); |
|
1077 |
} |
|
1078 |
else if (error == KErrAlreadyExists) |
|
1079 |
{ |
|
1080 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): Alter Table error=%d\n"), error) ); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1081 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1082 |
_LIT( KColumnDef, "UNSIGNED INTEGER" ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1083 |
AlterTableL( aDatabase, EAddColumn , KTtlsDatabaseTableName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1084 |
cf_str_EAP_TLS_PEAP_use_identity_privacy_literal, KColumnDef); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1085 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1086 |
_LIT( KColumnDef1, "UNSIGNED INTEGER" ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1087 |
AlterTableL( aDatabase, EAddColumn , KTtlsDatabaseTableName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1088 |
cf_str_EAP_TLS_PEAP_ttls_pap_password_prompt_literal, KColumnDef1); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1089 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1090 |
HBufC* buf1 = HBufC::NewLC(KMaxSqlQueryLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1091 |
TPtr sqlStatement = buf1->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1092 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1093 |
_LIT(KSQLAlterTableForVar, "VARCHAR (%d)"); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1094 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1095 |
sqlStatement.Format(KSQLAlterTableForVar, KMaxPapUserNameLengthInDb); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1096 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1097 |
AlterTableL( aDatabase, EAddColumn , KTtlsDatabaseTableName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1098 |
cf_str_EAP_TLS_PEAP_ttls_pap_username_literal, sqlStatement); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1099 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1100 |
sqlStatement.Format(KSQLAlterTableForVar, KMaxPapPasswordLengthInDb); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1101 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1102 |
AlterTableL( aDatabase, EAddColumn , KTtlsDatabaseTableName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1103 |
cf_str_EAP_TLS_PEAP_ttls_pap_password_literal, sqlStatement); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1104 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1105 |
CleanupStack::PopAndDestroy(buf1); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1106 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1107 |
_LIT( KColumnDef4, "BIGINT" ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1108 |
AlterTableL( aDatabase, EAddColumn , KTtlsDatabaseTableName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1109 |
cf_str_EAP_TLS_PEAP_ttls_pap_max_session_validity_time_literal, KColumnDef4); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1110 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1111 |
_LIT( KColumnDef5, "BIGINT" ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1112 |
AlterTableL( aDatabase, EAddColumn , KTtlsDatabaseTableName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1113 |
KTTLSPAPLastFullAuthTime, KColumnDef5); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1114 |
|
26 | 1115 |
_LIT( KColumnDef6, "UNSIGNED INTEGER" ); |
1116 |
AlterTableL( aDatabase, EAddColumn , KTtlsDatabaseTableName, |
|
1117 |
cf_str_EAP_TLS_PEAP_use_automatic_ca_certificate_literal, KColumnDef6); |
|
1118 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1119 |
} |
26 | 1120 |
else if (error != KErrNone) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1121 |
{ |
26 | 1122 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::OpenTtlsDatabaseL(): aDatabase.Execute() failed error=%d\n"), error) ); |
1123 |
||
1124 |
User::Leave(error); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1125 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1126 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1127 |
// Create table for _allowed_ user certificates |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1128 |
|
26 | 1129 |
//// NAME ////////////////// TYPE ////////////// Constant /////////// |
1130 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
1131 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
1132 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
1133 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
1134 |
//| CertLabel | VARCHAR(255) | KCACertLabel |// |
|
1135 |
//| SubjectKeyId | BINARY(20) | KSubjectKeyIdentifier |// This is Symbian subjectkey id |
|
1136 |
//| ActualSubjectKeyId | BINARY(20) | KActualSubjectKeyIdentifier |// This is the actual subjectkeyid present in the certificate. |
|
1137 |
//| SubjectName | VARCHAR(255) | KSubjectName |// |
|
1138 |
//| IssuerName | VARCHAR(255) | KIssuerName |// |
|
1139 |
//| SerialNumber | VARCHAR(255) | KSerialNumber |// |
|
1140 |
//| Thumbprint | BINARY(64) | KThumbprint |// |
|
1141 |
////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1142 |
||
1143 |
_LIT(KSQLCreateTable2, "CREATE TABLE %S \ |
|
1144 |
(%S UNSIGNED INTEGER, \ |
|
1145 |
%S UNSIGNED INTEGER, \ |
|
1146 |
%S UNSIGNED INTEGER, \ |
|
1147 |
%S UNSIGNED INTEGER, \ |
|
1148 |
%S VARCHAR(%d), \ |
|
1149 |
%S BINARY(%d), \ |
|
1150 |
%S BINARY(%d), \ |
|
1151 |
%S VARCHAR(%d), \ |
|
1152 |
%S VARCHAR(%d), \ |
|
1153 |
%S VARCHAR(%d), \ |
|
1154 |
%S BINARY(%d))"); |
|
1155 |
||
1156 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): sqlStatement.Format(KSQLCreateTable2)\n")) ); |
|
1157 |
||
1158 |
sqlStatement.Format(KSQLCreateTable2, |
|
1159 |
&KTtlsAllowedUserCertsDatabaseTableName, |
|
1160 |
&KServiceType, |
|
1161 |
&KServiceIndex, |
|
1162 |
&KTunnelingTypeVendorId, |
|
1163 |
&KTunnelingType, |
|
1164 |
&KCertLabel, KMaxCertLabelLengthInDB, |
|
1165 |
&KSubjectKeyIdentifier, KMaxSubjectKeyIdLengthInDB, |
|
1166 |
&KActualSubjectKeyIdentifier, KKeyIdentifierLength, |
|
1167 |
&KSubjectName, KGeneralStringMaxLength, |
|
1168 |
&KIssuerName, KGeneralStringMaxLength, |
|
1169 |
&KSerialNumber, KGeneralStringMaxLength, |
|
1170 |
&KThumbprint, KThumbprintMaxLength); |
|
1171 |
||
1172 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): aDatabase.Execute()\n")) ); |
|
1173 |
||
1174 |
error = aDatabase.Execute(sqlStatement); |
|
1175 |
if (error != KErrNone && error != KErrAlreadyExists) |
|
1176 |
{ |
|
1177 |
User::Leave(error); |
|
1178 |
} |
|
1179 |
||
1180 |
// Create table for _allowed_ CA certs |
|
1181 |
||
1182 |
//// NAME ////////////////// TYPE ////////////// Constant /////////// |
|
1183 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
1184 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
1185 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
1186 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
1187 |
//| CACertLabel | VARCHAR(255) | KCACertLabel |// |
|
1188 |
//| SubjectKeyId | BINARY(20) | KSubjectKeyIdentifier |// This is Symbian subjectkey id |
|
1189 |
//| ActualSubjectKeyId | BINARY(20) | KActualSubjectKeyIdentifier |// This is the actual subjectkeyid present in the certificate. |
|
1190 |
//| SubjectName | VARCHAR(255) | KSubjectName |// |
|
1191 |
//| IssuerName | VARCHAR(255) | KIssuerName |// |
|
1192 |
//| SerialNumber | VARCHAR(255) | KSerialNumber |// |
|
1193 |
//| Thumbprint | BINARY(64) | KThumbprint |// |
|
1194 |
////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1195 |
||
1196 |
_LIT(KSQLCreateTable3, "CREATE TABLE %S \ |
|
1197 |
(%S UNSIGNED INTEGER, \ |
|
1198 |
%S UNSIGNED INTEGER, \ |
|
1199 |
%S UNSIGNED INTEGER, \ |
|
1200 |
%S UNSIGNED INTEGER, \ |
|
1201 |
%S VARCHAR(%d), \ |
|
1202 |
%S BINARY(%d), \ |
|
1203 |
%S BINARY(%d), \ |
|
1204 |
%S VARCHAR(%d), \ |
|
1205 |
%S VARCHAR(%d), \ |
|
1206 |
%S VARCHAR(%d), \ |
|
1207 |
%S BINARY(%d))"); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1208 |
|
26 | 1209 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): sqlStatement.Format(KSQLCreateTable3)\n")) ); |
1210 |
||
1211 |
sqlStatement.Format(KSQLCreateTable3, |
|
1212 |
&KTtlsAllowedCACertsDatabaseTableName, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1213 |
&KServiceType, |
26 | 1214 |
&KServiceIndex, |
1215 |
&KTunnelingTypeVendorId, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1216 |
&KTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1217 |
&KCertLabel, KMaxCertLabelLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1218 |
&KSubjectKeyIdentifier, KMaxSubjectKeyIdLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1219 |
&KActualSubjectKeyIdentifier, KKeyIdentifierLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1220 |
&KSubjectName, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1221 |
&KIssuerName, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1222 |
&KSerialNumber, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1223 |
&KThumbprint, KThumbprintMaxLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1224 |
|
26 | 1225 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): aDatabase.Execute()\n")) ); |
1226 |
||
1227 |
error = aDatabase.Execute(sqlStatement); |
|
1228 |
if (error != KErrNone && error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1229 |
{ |
26 | 1230 |
User::Leave(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1231 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1232 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1233 |
// Create table for _allowed_ cipher suites |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1234 |
|
26 | 1235 |
//// NAME ///////////////// TYPE ////////////// Constant /////////// |
1236 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
1237 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
1238 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
1239 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
1240 |
//| CipherSuite | UNSIGNED INTEGER | KCipherSuite |// |
|
1241 |
////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1242 |
||
1243 |
_LIT(KSQLCreateTable4, "CREATE TABLE %S \ |
|
1244 |
(%S UNSIGNED INTEGER, \ |
|
1245 |
%S UNSIGNED INTEGER, \ |
|
1246 |
%S UNSIGNED INTEGER, \ |
|
1247 |
%S UNSIGNED INTEGER, \ |
|
1248 |
%S UNSIGNED INTEGER)"); |
|
1249 |
||
1250 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): sqlStatement.Format(KSQLCreateTable4)\n")) ); |
|
1251 |
||
1252 |
sqlStatement.Format(KSQLCreateTable4, |
|
1253 |
&KTtlsAllowedCipherSuitesDatabaseTableName, |
|
1254 |
&KServiceType, |
|
1255 |
&KServiceIndex, |
|
1256 |
&KTunnelingTypeVendorId, |
|
1257 |
&KTunnelingType, |
|
1258 |
&KCipherSuite); |
|
1259 |
||
1260 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): aDatabase.Execute()\n")) ); |
|
1261 |
||
1262 |
error = aDatabase.Execute(sqlStatement); |
|
1263 |
if (error != KErrNone && error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1264 |
{ |
26 | 1265 |
User::Leave(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1266 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1267 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1268 |
// 4. Check if database table contains a row for this service type and id |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1269 |
|
26 | 1270 |
_LIT(KSQLQueryRow, "SELECT * FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); |
1271 |
||
1272 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): sqlStatement.Format(KSQLQueryRow)\n")) ); |
|
1273 |
||
1274 |
sqlStatement.Format(KSQLQueryRow, |
|
1275 |
&KTtlsDatabaseTableName, |
|
1276 |
&KServiceType, |
|
1277 |
aIndexType, |
|
1278 |
&KServiceIndex, |
|
1279 |
aIndex, |
|
1280 |
&KTunnelingTypeVendorId, |
|
1281 |
aTunnelingType.get_vendor_id(), |
|
1282 |
&KTunnelingType, |
|
1283 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1284 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1285 |
RDbView view; |
26 | 1286 |
|
1287 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): view.Prepare()\n")) ); |
|
1288 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1289 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1290 |
// View must be closed when no longer needed |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1291 |
CleanupClosePushL(view); |
26 | 1292 |
|
1293 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): view.EvaluateAll()\n")) ); |
|
1294 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1295 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1296 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1297 |
// 5. If row is not found then add it |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1298 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1299 |
TInt rows = view.CountL(); |
26 | 1300 |
|
1301 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): view.CountL()=%d\n"), |
|
1302 |
rows)); |
|
1303 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1304 |
CleanupStack::PopAndDestroy(); // view |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1305 |
if (rows == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1306 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1307 |
_LIT(KSQLInsert, "SELECT * FROM %S"); |
26 | 1308 |
|
1309 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): sqlStatement.Format(KSQLInsert)\n")) ); |
|
1310 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1311 |
sqlStatement.Format(KSQLInsert, &KTtlsDatabaseTableName); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1312 |
|
26 | 1313 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): view.Prepare()\n")) ); |
1314 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1315 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited, RDbView::EInsertOnly)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1316 |
CleanupClosePushL(view); |
26 | 1317 |
|
1318 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): view.InsertL()\n")) ); |
|
1319 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1320 |
view.InsertL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1321 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1322 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1323 |
CDbColSet* colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1324 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1325 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1326 |
// Set the default values. The other three tables (certs, ca certs & cipher suites) are empty by default. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1327 |
view.SetColL(colSet->ColNo(KServiceType), static_cast<TInt>(aIndexType)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1328 |
view.SetColL(colSet->ColNo(KServiceIndex), aIndex); |
26 | 1329 |
view.SetColL(colSet->ColNo(KTunnelingTypeVendorId), aTunnelingType.get_vendor_id()); |
1330 |
view.SetColL(colSet->ColNo(KTunnelingType), aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1331 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1332 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_realm_literal), default_EAP_TLS_PEAP_use_manual_realm); |
26 | 1333 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_manual_realm_literal), default_EAP_realm); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1334 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1335 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_username_literal), default_EAP_TLS_PEAP_use_manual_username); |
26 | 1336 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_manual_username_literal), default_EAP_username); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1337 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1338 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_cipher_suite_literal), default_EAP_TLS_PEAP_cipher_suite); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1339 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1340 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_used_PEAP_version_literal), default_EAP_TLS_PEAP_used_PEAP_version); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1341 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1342 |
TInt i(0); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1343 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1344 |
while (default_EAP_TLS_PEAP_accepted_PEAP_versions[i] != -1) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1345 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1346 |
i++; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1347 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1348 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1349 |
TBuf8<KMaxPEAPVersionsStringLengthInDB> tmp; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1350 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1351 |
tmp.Copy(reinterpret_cast<const TUint8 *> (default_EAP_TLS_PEAP_accepted_PEAP_versions), i * sizeof(TInt)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1352 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1353 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_accepted_PEAP_versions_literal), tmp); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1354 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1355 |
view.SetColL(colSet->ColNo(cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal), default_PEAP_tunneled_types); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1356 |
view.SetColL(colSet->ColNo(cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal), default_PEAP_tunneled_types); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1357 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1358 |
view.SetColL(colSet->ColNo(cf_str_TLS_server_authenticates_client_policy_in_client_literal), default_EAP_PEAP_TTLS_server_authenticates_client); |
34 | 1359 |
view.SetColL(colSet->ColNo(KCACertLabel), default_CA_cert_label); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1360 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1361 |
view.SetColL(colSet->ColNo(KClientCertLabel), default_client_cert_label); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1362 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1363 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_verify_certificate_realm_literal), default_EAP_TLS_PEAP_verify_certificate_realm); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1364 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1365 |
view.SetColL(colSet->ColNo(cf_str_EAP_TTLS_max_session_validity_time_literal), default_MaxSessionTime); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1366 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1367 |
view.SetColL(colSet->ColNo(KTTLSLastFullAuthTime), default_FullAuthTime); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1368 |
|
34 | 1369 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_identity_privacy_literal), default_EAP_TLS_PEAP_TTLS_Privacy); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1370 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1371 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1372 |
view.SetColL( colSet->ColNo( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1373 |
cf_str_EAP_TLS_PEAP_ttls_pap_password_prompt_literal ), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1374 |
KDefaultPapPasswordPrompt ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1375 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1376 |
view.SetColL( colSet->ColNo( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1377 |
cf_str_EAP_TLS_PEAP_ttls_pap_username_literal ), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1378 |
KDefaultPapUserName ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1379 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1380 |
view.SetColL( colSet->ColNo( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1381 |
cf_str_EAP_TLS_PEAP_ttls_pap_password_literal ), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1382 |
KDefaultPapPassword ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1383 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1384 |
view.SetColL( colSet->ColNo( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1385 |
cf_str_EAP_TLS_PEAP_ttls_pap_max_session_validity_time_literal ), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1386 |
KDefaultMaxPapSessionTime ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1387 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1388 |
view.SetColL( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1389 |
colSet->ColNo( KTTLSPAPLastFullAuthTime ), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1390 |
KDefaultFullPapAuthTime ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1391 |
|
26 | 1392 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): view.SetColL(cf_str_EAP_TLS_PEAP_use_automatic_ca_certificate_literal)\n")) ); |
1393 |
||
1394 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_automatic_ca_certificate_literal), default_EAP_TLS_PEAP_use_automatic_ca_certificate); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1395 |
|
26 | 1396 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): view.PutL()\n")) ); |
1397 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1398 |
view.PutL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1399 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1400 |
CleanupStack::PopAndDestroy(colSet); |
26 | 1401 |
CleanupStack::PopAndDestroy( &view ); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1402 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1403 |
// Add default disabled cipher suites |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1404 |
_LIT(KSQLInsert2, "SELECT * FROM %S"); |
26 | 1405 |
|
1406 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): sqlStatement.Format(KSQLInsert2)\n")) ); |
|
1407 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1408 |
sqlStatement.Format(KSQLInsert2, &KTtlsAllowedCipherSuitesDatabaseTableName); |
26 | 1409 |
|
1410 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): view.Prepare()\n")) ); |
|
1411 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1412 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited, RDbView::EInsertOnly)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1413 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1414 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1415 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1416 |
colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1417 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1418 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1419 |
i = 0; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1420 |
while (default_allowed_cipher_suites[i] != 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1421 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1422 |
view.InsertL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1423 |
view.SetColL(colSet->ColNo(KServiceType), static_cast<TInt>(aIndexType)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1424 |
view.SetColL(colSet->ColNo(KServiceIndex), aIndex); |
26 | 1425 |
view.SetColL(colSet->ColNo(KTunnelingTypeVendorId), aTunnelingType.get_vendor_id()); |
1426 |
view.SetColL(colSet->ColNo(KTunnelingType), aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1427 |
view.SetColL(colSet->ColNo(KCipherSuite), default_allowed_cipher_suites[i]); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1428 |
view.PutL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1429 |
i++; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1430 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1431 |
|
26 | 1432 |
CleanupStack::PopAndDestroy( colSet ); |
1433 |
CleanupStack::PopAndDestroy( &view ); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1434 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1435 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1436 |
// 6. Do the altering of tables here. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1437 |
// Add columns to existing certificate DB tables for Serial number, Issuer name etc. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1438 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1439 |
TBufC<KDbMaxColName> tableName; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1440 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1441 |
// For the table _allowed_ USER certificates |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1442 |
tableName = KTtlsAllowedUserCertsDatabaseTableName; |
26 | 1443 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): AddExtraCertColumnsL()\n")) ); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1444 |
AddExtraCertColumnsL(aDatabase,tableName); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1445 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1446 |
// For the table _allowed_ CA certificates |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1447 |
tableName = KTtlsAllowedCACertsDatabaseTableName; |
26 | 1448 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): AddExtraCertColumnsL()\n")) ); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1449 |
AddExtraCertColumnsL(aDatabase,tableName); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1450 |
|
26 | 1451 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenTtlsDatabaseL(): aDatabase.Compact()\n")) ); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1452 |
aDatabase.Compact(); |
26 | 1453 |
|
1454 |
CleanupStack::PopAndDestroy( buf ); |
|
1455 |
CleanupStack::Pop( &aDatabase ); |
|
1456 |
CleanupStack::Pop( &aFileServerSession ); |
|
1457 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1458 |
} // EapTlsPeapUtils::OpenTtlsDatabaseL() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1459 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1460 |
#endif // #if defined(USE_TTLS_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1461 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1462 |
#if defined(USE_FAST_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1463 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1464 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1465 |
// EapTlsPeapUtils::OpenFastDatabaseL() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1466 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1467 |
// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1468 |
void EapTlsPeapUtils::OpenFastDatabaseL( |
26 | 1469 |
RDbNamedDatabase& aDatabase, |
1470 |
RFs& aFileServerSession, |
|
1471 |
const TIndexType aIndexType, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1472 |
const TInt aIndex, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1473 |
const eap_type_value_e aTunnelingType) |
26 | 1474 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1475 |
EAP_TRACE_DEBUG_SYMBIAN( |
26 | 1476 |
(_L("EapTlsPeapUtils::OpenFastDatabaseL(): - Start - aIndexType=%d, aIndex=%d, aTunnelingType=0xfe%06x%08x\n"), |
1477 |
aIndexType, |
|
1478 |
aIndex, |
|
1479 |
aTunnelingType.get_vendor_id(), |
|
1480 |
aTunnelingType.get_vendor_type())); |
|
1481 |
||
1482 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::OpenFastDatabaseL()\n")); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1483 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1484 |
// 1. Open/create a database |
26 | 1485 |
|
1486 |
TInt error(KErrNone); |
|
1487 |
TFileName aPrivateDatabasePathName; |
|
1488 |
||
1489 |
EapPluginTools::CreateDatabaseLC( |
|
1490 |
aDatabase, |
|
1491 |
aFileServerSession, |
|
1492 |
error, |
|
1493 |
KFastDatabaseName, |
|
1494 |
aPrivateDatabasePathName); |
|
1495 |
||
1496 |
if(error == KErrNone) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1497 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1498 |
aDatabase.Close(); |
26 | 1499 |
} |
1500 |
else if (error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1501 |
{ |
26 | 1502 |
User::LeaveIfError(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1503 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1504 |
|
26 | 1505 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenFastDatabaseL(): - calls aDatabase.Open()\n"))); |
1506 |
||
1507 |
error = aDatabase.Open(aFileServerSession, aPrivateDatabasePathName); |
|
1508 |
||
1509 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::OpenFastDatabaseL(): - Opened private DB for EAP-FAST. error=%d\n"), error)); |
|
1510 |
||
1511 |
User::LeaveIfError(error); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1512 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1513 |
// 2. Create the eapfast tables to database (ignore error if exists) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1514 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1515 |
// Table 1: Create table for general settings of EAP-FAST. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1516 |
|
26 | 1517 |
// Table columns: |
1518 |
//// NAME //////////////////////////////////////////// TYPE ////////////// Constant /////////////////// |
|
1519 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
1520 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
1521 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
1522 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
1523 |
//| EAP_TLS_PEAP_use_manual_realm | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_use_manual_realm_literal |// |
|
1524 |
//| EAP_TLS_PEAP_manual_realm | VARCHAR(255) | cf_str_EAP_TLS_PEAP_manual_realm_literal |// |
|
1525 |
//| EAP_TLS_PEAP_use_manual_username | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_use_manual_username_literal |// |
|
1526 |
//| EAP_TLS_PEAP_manual_username | VARCHAR(255) | cf_str_EAP_TLS_PEAP_manual_username_literal |// |
|
1527 |
//| EAP_TLS_PEAP_cipher_suite | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_cipher_suite_literal |// |
|
1528 |
//| EAP_TLS_PEAP_used_PEAP_version | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_used_PEAP_version_literal |// |
|
1529 |
//| EAP_TLS_PEAP_accepted_PEAP_versions | BINARY(12) | cf_str_EAP_TLS_PEAP_accepted_PEAP_versions_literal|// |
|
1530 |
//| PEAP_accepted_tunneled_client_types | VARBINARY(240) | cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal |// |
|
1531 |
//| PEAP_unaccepted_tunneled_client_types | VARBINARY(240) | cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal |// |
|
1532 |
//| EAP_TLS_server_authenticates_client | UNSIGNED INTEGER | cf_str_TLS_server_authenticates_client_policy_in_client_literal|// |
|
1533 |
//| EAP_TLS_PEAP_saved_session_id | BINARY(32) | cf_str_EAP_TLS_PEAP_saved_session_id_literal |// |
|
1534 |
//| EAP_TLS_PEAP_saved_master_secret | BINARY(48) | cf_str_EAP_TLS_PEAP_saved_master_secret_literal |// |
|
1535 |
//| EAP_TLS_PEAP_saved_cipher_suite | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_saved_cipher_suite_literal |// |
|
1536 |
//| EAP_TLS_PEAP_verify_certificate_realm | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_verify_certificate_realm_literal |// |
|
1537 |
//| EAP_FAST_max_session_validity_time | BIGINT | cf_str_EAP_FAST_max_session_validity_time_literal |// |
|
1538 |
//| EAP_FAST_last_full_authentication_time | BIGINT | KFASTLastFullAuthTime |// |
|
1539 |
//| EAP_TLS_PEAP_use_identity_privacy | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_use_identity_privacy_literal |// |
|
1540 |
//| EAP_TLS_PEAP_use_automatic_ca_certificate | UNSIGNED INTEGER | cf_str_EAP_TLS_PEAP_use_automatic_ca_certificate_literal|// |
|
1541 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1542 |
||
1543 |
/** moved to PAC store db, because time is the same for all IAPs **/ |
|
1544 |
//| EAP_FAST_last_password_identity_time | BIGINT | KFASTLastPasswordIdentityTime |// |
|
1545 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1546 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1547 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1548 |
HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1549 |
TPtr sqlStatement = buf->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1550 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1551 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1552 |
(_L("EapTlsPeapUtils::OpenFastDatabaseL - Creating the tables for EAP-FAST\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1553 |
|
26 | 1554 |
_LIT(KSQLCreateTable1, "CREATE TABLE %S \ |
1555 |
(%S UNSIGNED INTEGER, \ |
|
1556 |
%S UNSIGNED INTEGER, \ |
|
1557 |
%S UNSIGNED INTEGER, \ |
|
1558 |
%S UNSIGNED INTEGER, \ |
|
1559 |
%S UNSIGNED INTEGER, \ |
|
1560 |
%S VARCHAR(%d), \ |
|
1561 |
%S UNSIGNED INTEGER, \ |
|
1562 |
%S VARCHAR(%d), \ |
|
1563 |
%S UNSIGNED INTEGER, \ |
|
1564 |
%S UNSIGNED INTEGER, \ |
|
1565 |
%S BINARY(%d), \ |
|
1566 |
%S VARBINARY(%d), \ |
|
1567 |
%S VARBINARY(%d), \ |
|
1568 |
%S UNSIGNED INTEGER, \ |
|
1569 |
%S BINARY(%d), \ |
|
1570 |
%S BINARY(%d), \ |
|
1571 |
%S UNSIGNED INTEGER, \ |
|
1572 |
%S UNSIGNED INTEGER, \ |
|
1573 |
%S BIGINT, \ |
|
1574 |
%S BIGINT, \ |
|
1575 |
%S UNSIGNED INTEGER, \ |
|
1576 |
%S UNSIGNED INTEGER)"); |
|
1577 |
||
1578 |
sqlStatement.Format(KSQLCreateTable1, |
|
1579 |
&KFastGeneralSettingsDBTableName, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1580 |
&KServiceType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1581 |
&KServiceIndex, |
26 | 1582 |
&KTunnelingTypeVendorId, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1583 |
&KTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1584 |
&cf_str_EAP_TLS_PEAP_use_manual_realm_literal, |
26 | 1585 |
&cf_str_EAP_TLS_PEAP_manual_realm_literal, KMaxRealmLengthInDB, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1586 |
&cf_str_EAP_TLS_PEAP_use_manual_username_literal, |
26 | 1587 |
&cf_str_EAP_TLS_PEAP_manual_username_literal, KMaxUsernameLengthInDB, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1588 |
&cf_str_EAP_TLS_PEAP_cipher_suite_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1589 |
&cf_str_EAP_TLS_PEAP_used_PEAP_version_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1590 |
&cf_str_EAP_TLS_PEAP_accepted_PEAP_versions_literal, KMaxPEAPVersionsStringLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1591 |
&cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal, KMaxTunneledTypeStringLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1592 |
&cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal, KMaxTunneledTypeStringLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1593 |
&cf_str_TLS_server_authenticates_client_policy_in_client_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1594 |
&cf_str_EAP_TLS_PEAP_saved_session_id_literal, KMaxSessionIdLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1595 |
&cf_str_EAP_TLS_PEAP_saved_master_secret_literal, KMaxMasterSecretLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1596 |
&cf_str_EAP_TLS_PEAP_saved_cipher_suite_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1597 |
&cf_str_EAP_TLS_PEAP_verify_certificate_realm_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1598 |
&cf_str_EAP_FAST_max_session_validity_time_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1599 |
&KFASTLastFullAuthTime, |
26 | 1600 |
&cf_str_EAP_TLS_PEAP_use_identity_privacy_literal, |
1601 |
&cf_str_EAP_TLS_PEAP_use_automatic_ca_certificate_literal); |
|
1602 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1603 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1604 |
(_L("EapTlsPeapUtils::OpenFastDatabaseL - SQL query formated OK\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1605 |
|
26 | 1606 |
error = aDatabase.Execute(sqlStatement); |
1607 |
if (error != KErrNone && error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1608 |
{ |
26 | 1609 |
User::Leave(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1610 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1611 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1612 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1613 |
(_L("EapTlsPeapUtils::OpenFastDatabaseL Created General settings table\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1614 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1615 |
// Table 2: Create table for Special settings of EAP-FAST. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1616 |
|
26 | 1617 |
// Table columns: |
1618 |
//// NAME //////////////////////////////////////////// TYPE ////////////// Constant /////////////////// |
|
1619 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
1620 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
1621 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
1622 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
1623 |
//| EAP_FAST_allow_server_authenticated_provisioning_mode| UNSIGNED INTEGER | cf_str_EAP_FAST_allow_server_authenticated_provisioning_mode_literal |// |
|
1624 |
//| EAP_FAST_allow_server_unauthenticated_provisioning_mode_ADHP| UNSIGNED INTEGER | cf_str_EAP_FAST_allow_server_unauthenticated_provisioning_mode_ADHP_literal |// |
|
1625 |
//| EAP_FAST_Warn_ADHP_No_PAC | UNSIGNED INTEGER | KFASTWarnADHPNoPAC|// |
|
1626 |
//| EAP_FAST_Warn_ADHP_No_Matching_PAC | UNSIGNED INTEGER | KFASTWarnADHPNoMatchingPAC|// |
|
1627 |
//| EAP_FAST_Warn_Not_Default_Server | UNSIGNED INTEGER | KFASTWarnNotDefaultServer|// |
|
1628 |
//| EAP_FAST_PAC_Group_Import_Reference_Collection| VARCHAR(255) | KFASTPACGroupImportReferenceCollection |// |
|
1629 |
//| EAP_FAST_PAC_Group_DB_Reference_Collection | BINARY(255) | KFASTPACGroupDBReferenceCollection |// |
|
1630 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1631 |
||
1632 |
||
1633 |
_LIT(KSQLCreateTable2, "CREATE TABLE %S \ |
|
1634 |
(%S UNSIGNED INTEGER, \ |
|
1635 |
%S UNSIGNED INTEGER, \ |
|
1636 |
%S UNSIGNED INTEGER, \ |
|
1637 |
%S UNSIGNED INTEGER, \ |
|
1638 |
%S UNSIGNED INTEGER, \ |
|
1639 |
%S UNSIGNED INTEGER, \ |
|
1640 |
%S UNSIGNED INTEGER, \ |
|
1641 |
%S UNSIGNED INTEGER, \ |
|
1642 |
%S UNSIGNED INTEGER, \ |
|
1643 |
%S VARCHAR(%d), \ |
|
1644 |
%S BINARY(%d) )"); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1645 |
|
26 | 1646 |
sqlStatement.Format(KSQLCreateTable2, |
1647 |
&KFastSpecialSettingsDBTableName, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1648 |
&KServiceType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1649 |
&KServiceIndex, |
26 | 1650 |
&KTunnelingTypeVendorId, |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1651 |
&KTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1652 |
&cf_str_EAP_FAST_allow_server_authenticated_provisioning_mode_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1653 |
&cf_str_EAP_FAST_allow_server_unauthenticated_provisioning_mode_ADHP_literal, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1654 |
&KFASTWarnADHPNoPAC, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1655 |
&KFASTWarnADHPNoMatchingPAC, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1656 |
&KFASTWarnNotDefaultServer, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1657 |
&KFASTPACGroupImportReferenceCollection, KMaxPACGroupRefCollectionLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1658 |
&KFASTPACGroupDBReferenceCollection, KMaxPACGroupRefCollectionLengthInDB); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1659 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1660 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1661 |
(_L("EapTlsPeapUtils::OpenFastDatabaseL - SQL query formated OK\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1662 |
|
26 | 1663 |
error = aDatabase.Execute(sqlStatement); |
1664 |
if (error != KErrNone && error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1665 |
{ |
26 | 1666 |
User::Leave(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1667 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1668 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1669 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1670 |
(_L("EapTlsPeapUtils::OpenFastDatabaseL Created Specific settings table\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1671 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1672 |
// Table 3: Create table for _allowed_ user certificates |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1673 |
|
26 | 1674 |
//// NAME ////////////////// TYPE ////////////// Constant /////////// |
1675 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
1676 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
1677 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
1678 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
1679 |
//| CertLabel | VARCHAR(255) | KCACertLabel |// |
|
1680 |
//| SubjectKeyId | BINARY(20) | KSubjectKeyIdentifier |// This is Symbian subjectkey id |
|
1681 |
//| ActualSubjectKeyId | BINARY(20) | KActualSubjectKeyIdentifier |// This is the actual subjectkeyid present in the certificate. |
|
1682 |
//| SubjectName | VARCHAR(255) | KSubjectName |// |
|
1683 |
//| IssuerName | VARCHAR(255) | KIssuerName |// |
|
1684 |
//| SerialNumber | VARCHAR(255) | KSerialNumber |// |
|
1685 |
//| Thumbprint | BINARY(64) | KThumbprint |// |
|
1686 |
////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1687 |
||
1688 |
_LIT(KSQLCreateTable3, "CREATE TABLE %S \ |
|
1689 |
(%S UNSIGNED INTEGER, \ |
|
1690 |
%S UNSIGNED INTEGER, \ |
|
1691 |
%S UNSIGNED INTEGER, \ |
|
1692 |
%S UNSIGNED INTEGER, \ |
|
1693 |
%S VARCHAR(%d), \ |
|
1694 |
%S BINARY(%d), \ |
|
1695 |
%S BINARY(%d), \ |
|
1696 |
%S VARCHAR(%d), \ |
|
1697 |
%S VARCHAR(%d), \ |
|
1698 |
%S VARCHAR(%d), \ |
|
1699 |
%S BINARY(%d))"); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1700 |
|
26 | 1701 |
sqlStatement.Format(KSQLCreateTable3, |
1702 |
&KFastAllowedUserCertsDatabaseTableName, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1703 |
&KServiceType, |
26 | 1704 |
&KServiceIndex, |
1705 |
&KTunnelingTypeVendorId, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1706 |
&KTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1707 |
&KCertLabel, KMaxCertLabelLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1708 |
&KSubjectKeyIdentifier, KMaxSubjectKeyIdLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1709 |
&KActualSubjectKeyIdentifier, KKeyIdentifierLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1710 |
&KSubjectName, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1711 |
&KIssuerName, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1712 |
&KSerialNumber, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1713 |
&KThumbprint, KThumbprintMaxLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1714 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1715 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1716 |
(_L("EapTlsPeapUtils::OpenFastDatabaseL - SQL query formated OK\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1717 |
|
26 | 1718 |
error = aDatabase.Execute(sqlStatement); |
1719 |
if (error != KErrNone && error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1720 |
{ |
26 | 1721 |
User::Leave(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1722 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1723 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1724 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1725 |
(_L("EapTlsPeapUtils::OpenFastDatabaseL Created User certificates table\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1726 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1727 |
// Table 4: Create table for _allowed_ CA certs |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1728 |
|
26 | 1729 |
//// NAME ////////////////// TYPE ////////////// Constant /////////// |
1730 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
1731 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
1732 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
1733 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
1734 |
//| CACertLabel | VARCHAR(255) | KCACertLabel |// |
|
1735 |
//| SubjectKeyId | BINARY(20) | KSubjectKeyIdentifier |// This is Symbian subjectkey id |
|
1736 |
//| ActualSubjectKeyId | BINARY(20) | KActualSubjectKeyIdentifier |// This is the actual subjectkeyid present in the certificate. |
|
1737 |
//| SubjectName | VARCHAR(255) | KSubjectName |// |
|
1738 |
//| IssuerName | VARCHAR(255) | KIssuerName |// |
|
1739 |
//| SerialNumber | VARCHAR(255) | KSerialNumber |// |
|
1740 |
//| Thumbprint | BINARY(64) | KThumbprint |// |
|
1741 |
////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1742 |
||
1743 |
_LIT(KSQLCreateTable4, "CREATE TABLE %S \ |
|
1744 |
(%S UNSIGNED INTEGER, \ |
|
1745 |
%S UNSIGNED INTEGER, \ |
|
1746 |
%S UNSIGNED INTEGER, \ |
|
1747 |
%S UNSIGNED INTEGER, \ |
|
1748 |
%S VARCHAR(%d), \ |
|
1749 |
%S BINARY(%d), \ |
|
1750 |
%S BINARY(%d), \ |
|
1751 |
%S VARCHAR(%d), \ |
|
1752 |
%S VARCHAR(%d), \ |
|
1753 |
%S VARCHAR(%d), \ |
|
1754 |
%S BINARY(%d))"); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1755 |
|
26 | 1756 |
sqlStatement.Format(KSQLCreateTable4, |
1757 |
&KFastAllowedCACertsDatabaseTableName, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1758 |
&KServiceType, |
26 | 1759 |
&KServiceIndex, |
1760 |
&KTunnelingTypeVendorId, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1761 |
&KTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1762 |
&KCertLabel, KMaxCertLabelLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1763 |
&KSubjectKeyIdentifier, KMaxSubjectKeyIdLengthInDB, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1764 |
&KActualSubjectKeyIdentifier, KKeyIdentifierLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1765 |
&KSubjectName, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1766 |
&KIssuerName, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1767 |
&KSerialNumber, KGeneralStringMaxLength, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1768 |
&KThumbprint, KThumbprintMaxLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1769 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1770 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1771 |
(_L("EapTlsPeapUtils::OpenFastDatabaseL - SQL query formated OK\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1772 |
|
26 | 1773 |
error = aDatabase.Execute(sqlStatement); |
1774 |
if (error != KErrNone && error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1775 |
{ |
26 | 1776 |
User::Leave(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1777 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1778 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1779 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1780 |
(_L("EapTlsPeapUtils::OpenFastDatabaseL Created CA certificates table\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1781 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1782 |
// Table 5: Create table for _allowed_ cipher suites |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1783 |
|
26 | 1784 |
//// NAME ///////////////// TYPE ////////////// Constant /////////// |
1785 |
//| ServiceType | UNSIGNED INTEGER | KServiceType |// |
|
1786 |
//| ServiceIndex | UNSIGNED INTEGER | KServiceIndex |// |
|
1787 |
//| TunnelingTypeVendorId | UNSIGNED INTEGER | KTunnelingTypeVendorId |// |
|
1788 |
//| TunnelingType | UNSIGNED INTEGER | KTunnelingType |// |
|
1789 |
//| CipherSuite | UNSIGNED INTEGER | KCipherSuite |// |
|
1790 |
////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1791 |
||
1792 |
_LIT(KSQLCreateTable5, "CREATE TABLE %S \ |
|
1793 |
(%S UNSIGNED INTEGER, \ |
|
1794 |
%S UNSIGNED INTEGER, \ |
|
1795 |
%S UNSIGNED INTEGER, \ |
|
1796 |
%S UNSIGNED INTEGER, \ |
|
1797 |
%S UNSIGNED INTEGER)"); |
|
1798 |
||
1799 |
sqlStatement.Format(KSQLCreateTable5, |
|
1800 |
&KFastAllowedCipherSuitesDatabaseTableName, |
|
1801 |
&KServiceType, |
|
1802 |
&KServiceIndex, |
|
1803 |
&KTunnelingTypeVendorId, |
|
1804 |
&KTunnelingType, |
|
1805 |
&KCipherSuite); |
|
1806 |
||
1807 |
error = aDatabase.Execute(sqlStatement); |
|
1808 |
if (error != KErrNone && error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1809 |
{ |
26 | 1810 |
User::Leave(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1811 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1812 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1813 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1814 |
(_L("EapTlsPeapUtils::OpenFastDatabaseL Created Cipher suites table\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1815 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1816 |
// 4. Check if database table contains a row for this service type and id |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1817 |
|
26 | 1818 |
_LIT(KSQLQueryRow, "SELECT * FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); |
1819 |
||
1820 |
sqlStatement.Format(KSQLQueryRow, |
|
1821 |
&KFastGeneralSettingsDBTableName, |
|
1822 |
&KServiceType, |
|
1823 |
aIndexType, |
|
1824 |
&KServiceIndex, |
|
1825 |
aIndex, |
|
1826 |
&KTunnelingTypeVendorId, |
|
1827 |
aTunnelingType.get_vendor_id(), |
|
1828 |
&KTunnelingType, |
|
1829 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1830 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1831 |
RDbView view; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1832 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1833 |
// View must be closed when no longer needed |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1834 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1835 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1836 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1837 |
// 5. If a row is not found then add it |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1838 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1839 |
TInt rows = view.CountL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1840 |
CleanupStack::PopAndDestroy(); // view |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1841 |
if (rows == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1842 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1843 |
// This is to add default values to the General settings table. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1844 |
_LIT(KSQLInsert, "SELECT * FROM %S"); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1845 |
sqlStatement.Format(KSQLInsert, &KFastGeneralSettingsDBTableName); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1846 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1847 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited, RDbView::EInsertOnly)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1848 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1849 |
view.InsertL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1850 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1851 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1852 |
CDbColSet* colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1853 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1854 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1855 |
// Set the default values. The other three tables (certs, ca certs & cipher suites) are empty by default. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1856 |
view.SetColL(colSet->ColNo(KServiceType), static_cast<TInt>(aIndexType)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1857 |
view.SetColL(colSet->ColNo(KServiceIndex), aIndex); |
26 | 1858 |
view.SetColL(colSet->ColNo(KTunnelingTypeVendorId), aTunnelingType.get_vendor_id()); |
1859 |
view.SetColL(colSet->ColNo(KTunnelingType), aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1860 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1861 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_realm_literal), default_EAP_TLS_PEAP_use_manual_realm); |
26 | 1862 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_manual_realm_literal), default_EAP_realm); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1863 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1864 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_username_literal), default_EAP_TLS_PEAP_use_manual_username); |
26 | 1865 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_manual_username_literal), default_EAP_username); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1866 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1867 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_cipher_suite_literal), default_EAP_TLS_PEAP_cipher_suite); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1868 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1869 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_used_PEAP_version_literal), default_EAP_TLS_PEAP_used_PEAP_version); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1870 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1871 |
TInt i(0); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1872 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1873 |
while (default_EAP_TLS_PEAP_accepted_PEAP_versions[i] != -1) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1874 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1875 |
i++; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1876 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1877 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1878 |
TBuf8<KMaxPEAPVersionsStringLengthInDB> tmp; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1879 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1880 |
tmp.Copy(reinterpret_cast<const TUint8 *> (default_EAP_TLS_PEAP_accepted_PEAP_versions), i * sizeof(TInt)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1881 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1882 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_accepted_PEAP_versions_literal), tmp); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1883 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1884 |
view.SetColL(colSet->ColNo(cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal), default_PEAP_tunneled_types); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1885 |
view.SetColL(colSet->ColNo(cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal), default_PEAP_tunneled_types); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1886 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1887 |
view.SetColL(colSet->ColNo(cf_str_TLS_server_authenticates_client_policy_in_client_literal), default_EAP_PEAP_TTLS_server_authenticates_client); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1888 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1889 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_verify_certificate_realm_literal), default_EAP_TLS_PEAP_verify_certificate_realm); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1890 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1891 |
view.SetColL(colSet->ColNo(cf_str_EAP_FAST_max_session_validity_time_literal), default_MaxSessionTime); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1892 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1893 |
view.SetColL(colSet->ColNo(KFASTLastFullAuthTime), default_FullAuthTime); |
34 | 1894 |
|
1895 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_identity_privacy_literal), default_EAP_TLS_PEAP_TTLS_Privacy); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1896 |
|
26 | 1897 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_automatic_ca_certificate_literal), default_EAP_TLS_PEAP_use_automatic_ca_certificate); |
1898 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1899 |
view.PutL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1900 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1901 |
CleanupStack::PopAndDestroy(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1902 |
CleanupStack::PopAndDestroy( &view ); // Close view. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1903 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1904 |
//--------------------------------------------------------// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1905 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1906 |
// This is to add default values to the Specific settings table. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1907 |
// KSQLInsert is "SELECT * FROM %S" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1908 |
sqlStatement.Format(KSQLInsert, &KFastSpecialSettingsDBTableName); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1909 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1910 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited, RDbView::EInsertOnly)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1911 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1912 |
view.InsertL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1913 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1914 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1915 |
colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1916 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1917 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1918 |
// Set the default values. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1919 |
view.SetColL(colSet->ColNo(KServiceType), static_cast<TInt>(aIndexType)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1920 |
view.SetColL(colSet->ColNo(KServiceIndex), aIndex); |
26 | 1921 |
view.SetColL(colSet->ColNo(KTunnelingTypeVendorId), aTunnelingType.get_vendor_id()); |
1922 |
view.SetColL(colSet->ColNo(KTunnelingType), aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1923 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1924 |
view.SetColL(colSet->ColNo(cf_str_EAP_FAST_allow_server_authenticated_provisioning_mode_literal), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1925 |
default_EAP_FAST_Auth_Prov_Mode_Allowed); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1926 |
view.SetColL(colSet->ColNo(cf_str_EAP_FAST_allow_server_unauthenticated_provisioning_mode_ADHP_literal), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1927 |
default_EAP_FAST_Unauth_Prov_Mode_Allowed); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1928 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1929 |
view.PutL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1930 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1931 |
CleanupStack::PopAndDestroy(colSet); |
26 | 1932 |
CleanupStack::PopAndDestroy( &view ); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1933 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1934 |
//--------------------------------------------------------// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1935 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1936 |
// Add default disabled cipher suites to cipher suites table. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1937 |
_LIT(KSQLInsert2, "SELECT * FROM %S"); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1938 |
sqlStatement.Format(KSQLInsert2, &KFastAllowedCipherSuitesDatabaseTableName); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1939 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited, RDbView::EInsertOnly)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1940 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1941 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1942 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1943 |
colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1944 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1945 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1946 |
i = 0; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1947 |
while (default_allowed_cipher_suites[i] != 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1948 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1949 |
view.InsertL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1950 |
view.SetColL(colSet->ColNo(KServiceType), static_cast<TInt>(aIndexType)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1951 |
view.SetColL(colSet->ColNo(KServiceIndex), aIndex); |
26 | 1952 |
view.SetColL(colSet->ColNo(KTunnelingTypeVendorId), aTunnelingType.get_vendor_id()); |
1953 |
view.SetColL(colSet->ColNo(KTunnelingType), aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1954 |
view.SetColL(colSet->ColNo(KCipherSuite), default_allowed_cipher_suites[i]); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1955 |
view.PutL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1956 |
i++; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1957 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1958 |
|
26 | 1959 |
CleanupStack::PopAndDestroy( colSet ); |
1960 |
CleanupStack::PopAndDestroy( &view ); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1961 |
} |
26 | 1962 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1963 |
aDatabase.Compact(); |
26 | 1964 |
|
1965 |
CleanupStack::PopAndDestroy( buf ); |
|
1966 |
CleanupStack::Pop( &aDatabase ); |
|
1967 |
CleanupStack::Pop( &aFileServerSession ); |
|
1968 |
||
1969 |
} // EapTlsPeapUtils::OpenFastDatabaseL() |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1970 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1971 |
#endif // #if defined(USE_FAST_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1972 |
|
26 | 1973 |
// --------------------------------------------------------- |
1974 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1975 |
void EapTlsPeapUtils::SetIndexL( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1976 |
RDbNamedDatabase& aDatabase, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1977 |
const TDesC& aTableName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1978 |
const TIndexType aIndexType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1979 |
const TInt aIndex, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1980 |
const eap_type_value_e aTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1981 |
const TIndexType aNewIndexType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1982 |
const TInt aNewIndex, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1983 |
const eap_type_value_e aNewTunnelingType) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1984 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1985 |
EAP_TRACE_DEBUG_SYMBIAN( |
26 | 1986 |
(_L("EapTlsPeapUtils::SetIndexL(): -Start- aIndexType=%d, aIndex=%d, aTunnelingType=0xfe%06x%08x, aNewTunnelingType=0xfe%06x%08x\n"), |
1987 |
aIndexType, |
|
1988 |
aIndex, |
|
1989 |
aTunnelingType.get_vendor_id(), |
|
1990 |
aTunnelingType.get_vendor_type(), |
|
1991 |
aNewTunnelingType.get_vendor_id(), |
|
1992 |
aNewTunnelingType.get_vendor_type())); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1993 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1994 |
EAP_TRACE_DEBUG_SYMBIAN( |
26 | 1995 |
(_L("EapTlsPeapUtils::SetIndexL(): -Start- aNewIndexType=%d, aNewIndex=%d, aNewTunnelingType=%d \n"), |
1996 |
aNewIndexType, |
|
1997 |
aNewIndex, |
|
1998 |
aNewTunnelingType.get_vendor_id(), |
|
1999 |
aNewTunnelingType.get_vendor_type())); |
|
2000 |
||
2001 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::SetIndexL()\n")); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2002 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2003 |
HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2004 |
TPtr sqlStatement = buf->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2005 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2006 |
// First delete the target |
26 | 2007 |
_LIT(KSQL, "SELECT * FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); |
2008 |
||
2009 |
sqlStatement.Format(KSQL, |
|
2010 |
&aTableName, |
|
2011 |
&KServiceType, |
|
2012 |
aIndexType, |
|
2013 |
&KServiceIndex, |
|
2014 |
aIndex, |
|
2015 |
&KTunnelingTypeVendorId, |
|
2016 |
aTunnelingType.get_vendor_id(), |
|
2017 |
&KTunnelingType, |
|
2018 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2019 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2020 |
RDbView view; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2021 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2022 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2023 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2024 |
// View must be closed when no longer needed |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2025 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2026 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2027 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2028 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2029 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2030 |
CDbColSet* colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2031 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2032 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2033 |
if (view.FirstL()) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2034 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2035 |
do { |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2036 |
view.GetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2037 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2038 |
view.UpdateL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2039 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2040 |
view.SetColL(colSet->ColNo(KServiceType), static_cast<TUint>(aNewIndexType)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2041 |
view.SetColL(colSet->ColNo(KServiceIndex), static_cast<TUint>(aNewIndex)); |
26 | 2042 |
view.SetColL(colSet->ColNo(KTunnelingTypeVendorId), aNewTunnelingType.get_vendor_id()); |
2043 |
view.SetColL(colSet->ColNo(KTunnelingType), aNewTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2044 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2045 |
view.PutL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2046 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2047 |
} while (view.NextL() != EFalse); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2048 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2049 |
|
26 | 2050 |
CleanupStack::PopAndDestroy(colSet); |
2051 |
CleanupStack::PopAndDestroy(&view); |
|
2052 |
CleanupStack::PopAndDestroy(buf); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2053 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2054 |
|
26 | 2055 |
// --------------------------------------------------------- |
2056 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2057 |
void EapTlsPeapUtils::ReadCertRowsToArrayL( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2058 |
RDbNamedDatabase& aDatabase, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2059 |
eap_am_tools_symbian_c * const /*aTools*/, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2060 |
const TDesC& aTableName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2061 |
const TIndexType aIndexType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2062 |
const TInt aIndex, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2063 |
const eap_type_value_e aTunnelingType, |
26 | 2064 |
RPointerArray<EapCertificateEntry>& aArray) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2065 |
{ |
26 | 2066 |
EAP_TRACE_DEBUG_SYMBIAN( |
2067 |
(_L("EapTlsPeapUtils::ReadCertRowsToArrayL(): - Start - aIndexType=%d, aIndex=%d, aTunnelingType=0xfe%06x%08x\n"), |
|
2068 |
aIndexType, |
|
2069 |
aIndex, |
|
2070 |
aTunnelingType.get_vendor_id(), |
|
2071 |
aTunnelingType.get_vendor_type())); |
|
2072 |
||
2073 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::ReadCertRowsToArrayL()\n")); |
|
2074 |
||
2075 |
CleanupClosePushL( aArray ); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2076 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2077 |
HBufC* buf = HBufC::NewLC(512); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2078 |
TPtr sqlStatement = buf->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2079 |
|
26 | 2080 |
_LIT(KSQLQueryRow, "SELECT * FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); |
2081 |
||
2082 |
sqlStatement.Format(KSQLQueryRow, |
|
2083 |
&aTableName, |
|
2084 |
&KServiceType, |
|
2085 |
aIndexType, |
|
2086 |
&KServiceIndex, |
|
2087 |
aIndex, |
|
2088 |
&KTunnelingTypeVendorId, |
|
2089 |
aTunnelingType.get_vendor_id(), |
|
2090 |
&KTunnelingType, |
|
2091 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2092 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2093 |
RDbView view; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2094 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2095 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2096 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2097 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2098 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2099 |
CDbColSet* colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2100 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2101 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2102 |
if (view.FirstL()) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2103 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2104 |
do { |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2105 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2106 |
view.GetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2107 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2108 |
{ |
26 | 2109 |
EapCertificateEntry * const certInfo = new EapCertificateEntry; |
2110 |
if (certInfo == 0) |
|
2111 |
{ |
|
2112 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::ReadCertRowsToArrayL(): No memory\n"))); |
|
2113 |
User::Leave(KErrNoMemory); |
|
2114 |
} |
|
2115 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2116 |
// Store the line |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2117 |
TPtrC ptr = view.ColDes(colSet->ColNo(KCertLabel)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2118 |
|
26 | 2119 |
certInfo->SetLabel(ptr); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2120 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2121 |
TPtrC8 ptr2 = view.ColDes8(colSet->ColNo(KSubjectKeyIdentifier)); // This is for authentication and uses Symbian subjectkey id. |
26 | 2122 |
certInfo->SetSubjectKeyId(ptr2); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2123 |
|
36 | 2124 |
TInt error = aArray.Append(certInfo); |
2125 |
||
2126 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ReadCertRowsToArrayL - Appended Cert with label=%S, error=%d\n"), |
|
2127 |
certInfo->GetLabel(), |
|
2128 |
error)); |
|
2129 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2130 |
EAP_TRACE_DATA_DEBUG_SYMBIAN(("ReadCertRowsToArrayL - Appended Cert's SubjectKeyID:", |
26 | 2131 |
certInfo->GetSubjectKeyId().Ptr(), |
2132 |
certInfo->GetSubjectKeyId().Length())); |
|
36 | 2133 |
|
2134 |
if (error != KErrNone) |
|
2135 |
{ |
|
2136 |
delete certInfo; |
|
2137 |
User::Leave(error); |
|
2138 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2139 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2140 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2141 |
} while (view.NextL() != EFalse); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2142 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2143 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2144 |
// Close database |
26 | 2145 |
CleanupStack::PopAndDestroy(colSet); |
2146 |
CleanupStack::PopAndDestroy(&view); |
|
2147 |
CleanupStack::PopAndDestroy(buf); |
|
2148 |
CleanupStack::Pop( &aArray ); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2149 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2150 |
|
26 | 2151 |
// --------------------------------------------------------- |
2152 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2153 |
void EapTlsPeapUtils::ReadUintRowsToArrayL( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2154 |
RDbNamedDatabase& aDatabase, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2155 |
eap_am_tools_symbian_c * const /*aTools*/, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2156 |
const TDesC& aTableName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2157 |
const TDesC& aColumnName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2158 |
const TIndexType aIndexType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2159 |
const TInt aIndex, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2160 |
const eap_type_value_e aTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2161 |
RArray<TUint>& aArray) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2162 |
{ |
26 | 2163 |
EAP_TRACE_DEBUG_SYMBIAN( |
2164 |
(_L("EapTlsPeapUtils::ReadUintRowsToArrayL(): - Start - aIndexType=%d, aIndex=%d, aTunnelingType=0xfe%06x%08x\n"), |
|
2165 |
aIndexType, |
|
2166 |
aIndex, |
|
2167 |
aTunnelingType.get_vendor_id(), |
|
2168 |
aTunnelingType.get_vendor_type())); |
|
2169 |
||
2170 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::ReadUintRowsToArrayL()\n")); |
|
2171 |
||
2172 |
CleanupClosePushL( aArray ); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2173 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2174 |
HBufC* buf = HBufC::NewLC(512); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2175 |
TPtr sqlStatement = buf->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2176 |
|
26 | 2177 |
_LIT(KSQLQueryRow, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); |
2178 |
||
2179 |
sqlStatement.Format(KSQLQueryRow, |
|
2180 |
&aColumnName, |
|
2181 |
&aTableName, |
|
2182 |
&KServiceType, |
|
2183 |
aIndexType, |
|
2184 |
&KServiceIndex, |
|
2185 |
aIndex, |
|
2186 |
&KTunnelingTypeVendorId, |
|
2187 |
aTunnelingType.get_vendor_id(), |
|
2188 |
&KTunnelingType, |
|
2189 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2190 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2191 |
RDbView view; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2192 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2193 |
CleanupClosePushL(view); |
26 | 2194 |
User::LeaveIfError(view.EvaluateAll()); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2195 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2196 |
if (view.FirstL()) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2197 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2198 |
do { |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2199 |
view.GetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2200 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2201 |
switch (view.ColType(KDefaultColumnInView_One)) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2202 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2203 |
case EDbColUint32: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2204 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2205 |
// Store the line |
26 | 2206 |
TUint tmp = view.ColUint(KDefaultColumnInView_One); |
36 | 2207 |
TInt error = aArray.Append(tmp); |
34 | 2208 |
|
2209 |
EAP_TRACE_DEBUG_SYMBIAN( |
|
36 | 2210 |
(_L("EapTlsPeapUtils::ReadUintRowsToArrayL(): TUint=%d, error=%d\n"), |
2211 |
tmp, |
|
2212 |
error)); |
|
2213 |
||
2214 |
if (error != KErrNone) |
|
2215 |
{ |
|
2216 |
User::Leave(error); |
|
2217 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2218 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2219 |
break; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2220 |
default: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2221 |
User::Leave(KErrArgument); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2222 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2223 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2224 |
} while (view.NextL() != EFalse); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2225 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2226 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2227 |
// Close database |
26 | 2228 |
CleanupStack::PopAndDestroy(&view); |
2229 |
CleanupStack::PopAndDestroy(buf); |
|
2230 |
CleanupStack::Pop( &aArray ); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2231 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2232 |
|
26 | 2233 |
// --------------------------------------------------------- |
2234 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2235 |
// Don't use this finction as Label is not saved for certificates saved by SetConfigurationL(). |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2236 |
// Provisioning (OMA DM etc) use SetConfigurationL() to save certificate details. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2237 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2238 |
TBool EapTlsPeapUtils::CompareTCertLabels(const TCertLabel& item1, const TCertLabel& item2) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2239 |
{ |
26 | 2240 |
EAP_TRACE_DEBUG_SYMBIAN( |
2241 |
(_L("EapTlsPeapUtils::CompareTCertLabels(): item1=\"%S\", item2=\"%S\"\n"), |
|
2242 |
&item1, |
|
2243 |
&item2)); |
|
2244 |
||
2245 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::CompareTCertLabels()\n")); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2246 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2247 |
if (item1 == item2) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2248 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2249 |
return ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2250 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2251 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2252 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2253 |
return EFalse; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2254 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2255 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2256 |
|
26 | 2257 |
// --------------------------------------------------------- |
2258 |
||
2259 |
TBool EapTlsPeapUtils::CompareSCertEntries(const EapCertificateEntry& item1, const EapCertificateEntry& item2) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2260 |
{ |
26 | 2261 |
EAP_TRACE_DEBUG_SYMBIAN( |
2262 |
(_L("EapTlsPeapUtils::CompareSCertEntries(): item1.Label=\"%S\", item2.Label=\"%S\"\n"), |
|
2263 |
item1.GetLabel(), |
|
2264 |
item2.GetLabel())); |
|
2265 |
||
2266 |
EAP_TRACE_DEBUG_SYMBIAN( |
|
2267 |
(_L("EapTlsPeapUtils::CompareSCertEntries(): item1.Label=\"%S\", item2.Label=\"%S\"\n"), |
|
2268 |
item1.GetLabel(), |
|
2269 |
item2.GetLabel())); |
|
2270 |
||
2271 |
EAP_TRACE_DATA_DEBUG_SYMBIAN(("EapTlsPeapUtils::CompareSCertEntries(): SubjectKeyID_1:", |
|
2272 |
item1.GetSubjectKeyId().Ptr(), |
|
2273 |
item1.GetSubjectKeyId().Length())); |
|
2274 |
||
2275 |
EAP_TRACE_DATA_DEBUG_SYMBIAN(("EapTlsPeapUtils::CompareSCertEntries(): SubjectKeyID_2:", |
|
2276 |
item2.GetSubjectKeyId().Ptr(), |
|
2277 |
item2.GetSubjectKeyId().Length())); |
|
2278 |
||
2279 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::CompareSCertEntries()\n")); |
|
2280 |
||
2281 |
||
2282 |
if (*(item1.GetLabel()) == *(item2.GetLabel()) |
|
2283 |
|| item1.GetLabel()->Length() == 0 |
|
2284 |
|| item2.GetLabel()->Length() == 0 ) // Label is not saved when certs are saved using OMA DM. |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2285 |
{ |
26 | 2286 |
if (item1.GetSubjectKeyId() == item2.GetSubjectKeyId()) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2287 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2288 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::CompareSCertEntries, Certs matched\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2289 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2290 |
return ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2291 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2292 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2293 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2294 |
return EFalse; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2295 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2296 |
|
26 | 2297 |
//-------------------------------------------------- |
2298 |
||
2299 |
// Stores the tunneled EAP type (expanded) to the database. |
|
2300 |
void EapTlsPeapUtils::SetTunnelingExpandedEapDataL( |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2301 |
RDbNamedDatabase& aDatabase, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2302 |
eap_am_tools_symbian_c * const /*aTools*/, |
26 | 2303 |
RPointerArray<TEapExpandedType> &aEnabledEAPArrary, |
2304 |
RPointerArray<TEapExpandedType> &aDisabledEAPArrary, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2305 |
const TIndexType aIndexType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2306 |
const TInt aIndex, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2307 |
const eap_type_value_e aTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2308 |
const eap_type_value_e aEapType) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2309 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2310 |
EAP_TRACE_DEBUG_SYMBIAN( |
26 | 2311 |
(_L("EapTlsPeapUtils::SetTunnelingExpandedEapDataL(): - Start - aIndexType=%d, aIndex=%d, aTunnelingType=0xfe%06x%08x, aEapType=0xfe%06x%08x\n"), |
2312 |
aIndexType, |
|
2313 |
aIndex, |
|
2314 |
aTunnelingType.get_vendor_id(), |
|
2315 |
aTunnelingType.get_vendor_type(), |
|
2316 |
aEapType.get_vendor_id(), |
|
2317 |
aEapType.get_vendor_type())); |
|
2318 |
||
2319 |
EAP_TRACE_DEBUG_SYMBIAN( |
|
2320 |
(_L("Number of Tunneled EAP types: Enabled=%d, Disabled=%d\n"), |
|
2321 |
aEnabledEAPArrary.Count(), |
|
2322 |
aDisabledEAPArrary.Count())); |
|
2323 |
||
2324 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::SetTunnelingExpandedEapDataL()\n")); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2325 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2326 |
HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2327 |
TPtr sqlStatement = buf->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2328 |
|
26 | 2329 |
_LIT(KSQLQueryRow, "SELECT %S, %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); |
2330 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2331 |
if (aEapType == eap_type_peap) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2332 |
{ |
26 | 2333 |
sqlStatement.Format(KSQLQueryRow, |
2334 |
&cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2335 |
&cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal, |
26 | 2336 |
&KPeapDatabaseTableName, |
2337 |
&KServiceType, |
|
2338 |
aIndexType, |
|
2339 |
&KServiceIndex, |
|
2340 |
aIndex, |
|
2341 |
&KTunnelingTypeVendorId, |
|
2342 |
aTunnelingType.get_vendor_id(), |
|
2343 |
&KTunnelingType, |
|
2344 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2345 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2346 |
#if defined(USE_TTLS_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2347 |
else if (aEapType == eap_type_ttls) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2348 |
{ |
26 | 2349 |
sqlStatement.Format(KSQLQueryRow, |
2350 |
&cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2351 |
&cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal, |
26 | 2352 |
&KTtlsDatabaseTableName, |
2353 |
&KServiceType, |
|
2354 |
aIndexType, |
|
2355 |
&KServiceIndex, |
|
2356 |
aIndex, |
|
2357 |
&KTunnelingTypeVendorId, |
|
2358 |
aTunnelingType.get_vendor_id(), |
|
2359 |
&KTunnelingType, |
|
2360 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2361 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2362 |
#endif |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2363 |
#if defined(USE_FAST_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2364 |
else if (aEapType == eap_type_fast) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2365 |
{ |
26 | 2366 |
sqlStatement.Format(KSQLQueryRow, |
2367 |
&cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2368 |
&cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal, |
26 | 2369 |
&KFastGeneralSettingsDBTableName, |
2370 |
&KServiceType, |
|
2371 |
aIndexType, |
|
2372 |
&KServiceIndex, |
|
2373 |
aIndex, |
|
2374 |
&KTunnelingTypeVendorId, |
|
2375 |
aTunnelingType.get_vendor_id(), |
|
2376 |
&KTunnelingType, |
|
2377 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2378 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2379 |
#endif |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2380 |
|
36 | 2381 |
else if ( aEapType == eap_expanded_type_ttls_plain_pap.get_type() ) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2382 |
{ |
26 | 2383 |
sqlStatement.Format(KSQLQueryRow, |
2384 |
&cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2385 |
&cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal, |
26 | 2386 |
&KTtlsDatabaseTableName, |
2387 |
&KServiceType, |
|
2388 |
aIndexType, |
|
2389 |
&KServiceIndex, |
|
2390 |
aIndex, |
|
2391 |
&KTunnelingTypeVendorId, |
|
2392 |
aTunnelingType.get_vendor_id(), |
|
2393 |
&KTunnelingType, |
|
2394 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2395 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2396 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2397 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2398 |
{ |
26 | 2399 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::SetTunnelingExpandedEapDataL - Unsupported EAP-type=0xfe%06x%08x\n"), |
2400 |
aEapType.get_vendor_id(), |
|
2401 |
aEapType.get_vendor_type())); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2402 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2403 |
// Unsupported EAP type |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2404 |
User::Leave(KErrNotSupported); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2405 |
} |
36 | 2406 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2407 |
RDbView view; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2408 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2409 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2410 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2411 |
User::LeaveIfError(view.FirstL()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2412 |
view.UpdateL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2413 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2414 |
TInt enabledEAPCount = aEnabledEAPArrary.Count(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2415 |
TInt disabledEAPCount = aDisabledEAPArrary.Count(); |
36 | 2416 |
|
26 | 2417 |
HBufC8 *acceptedDbText = HBufC8::NewLC( KEapExpandedTypeLength * enabledEAPCount ); // 8 bytes (64 bits) for an EAP type. |
2418 |
HBufC8 *unacceptedDbText = HBufC8::NewLC( KEapExpandedTypeLength * disabledEAPCount ); // 8 bytes (64 bits) for an EAP type. |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2419 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2420 |
TPtr8 acceptedPtr(acceptedDbText->Des()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2421 |
TPtr8 unacceptedPtr(unacceptedDbText->Des()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2422 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2423 |
// Fill in accepted tunneled type. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2424 |
for(TInt i = 0 ; i< enabledEAPCount; i++) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2425 |
{ |
26 | 2426 |
EAP_TRACE_DEBUG_SYMBIAN( |
2427 |
(_L("EapTlsPeapUtils::SetTunnelingExpandedEapDataL(): enabled EAP-type=0xfe%06x%08x\n"), |
|
2428 |
aEnabledEAPArrary[i]->GetVendorId(), |
|
2429 |
aEnabledEAPArrary[i]->GetVendorType())); |
|
2430 |
||
2431 |
acceptedPtr.Append(aEnabledEAPArrary[i]->GetValue()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2432 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2433 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2434 |
// Fill in unaccepted tunneled type. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2435 |
for(TInt i = 0 ; i< disabledEAPCount; i++) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2436 |
{ |
26 | 2437 |
EAP_TRACE_DEBUG_SYMBIAN( |
2438 |
(_L("EapTlsPeapUtils::SetTunnelingExpandedEapDataL(): disabled EAP-type=0xfe%06x%08x\n"), |
|
2439 |
aDisabledEAPArrary[i]->GetVendorId(), |
|
2440 |
aDisabledEAPArrary[i]->GetVendorType())); |
|
2441 |
||
2442 |
unacceptedPtr.Append(aDisabledEAPArrary[i]->GetValue()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2443 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2444 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2445 |
// Save the strings in the DB. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2446 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2447 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2448 |
CDbColSet* colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2449 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2450 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2451 |
// Validate length of strings |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2452 |
if(acceptedPtr.Length() > KMaxTunneledTypeStringLengthInDB |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2453 |
|| unacceptedPtr.Length() > KMaxTunneledTypeStringLengthInDB) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2454 |
{ |
26 | 2455 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::SetTunnelingExpandedEapDataL - Too long Tunneled EAP type string \n") ) ); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2456 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2457 |
User::Leave(KErrArgument); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2458 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2459 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2460 |
view.SetColL(colSet->ColNo(cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal), acceptedPtr); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2461 |
view.SetColL(colSet->ColNo(cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal), unacceptedPtr); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2462 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2463 |
CleanupStack::PopAndDestroy( colSet ); // Delete colSet. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2464 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2465 |
view.PutL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2466 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2467 |
EAP_TRACE_DATA_DEBUG_SYMBIAN(("EapTlsPeapUtils::SetTunnelingExpandedEapDataL- Enabled extended EAP type data added to DB:", |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2468 |
acceptedPtr.Ptr(), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2469 |
acceptedPtr.Size() ) ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2470 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2471 |
EAP_TRACE_DATA_DEBUG_SYMBIAN(("EapTlsPeapUtils::SetTunnelingExpandedEapDataL- Disabled extended EAP type data added to DB:", |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2472 |
unacceptedPtr.Ptr(), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2473 |
unacceptedPtr.Size() ) ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2474 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2475 |
CleanupStack::PopAndDestroy(unacceptedDbText); // Delete unacceptedDbText |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2476 |
CleanupStack::PopAndDestroy(acceptedDbText); // Delete acceptedDbText |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2477 |
CleanupStack::PopAndDestroy(&view); // Close view |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2478 |
CleanupStack::PopAndDestroy(buf); // Delete buf |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2479 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2480 |
|
26 | 2481 |
// --------------------------------------------------------- |
2482 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2483 |
// Retrieves the tunneled EAP type (expanded) from the database . |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2484 |
void EapTlsPeapUtils::GetTunnelingExpandedEapDataL( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2485 |
RDbNamedDatabase& aDatabase, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2486 |
eap_am_tools_symbian_c * const /*aTools*/, |
26 | 2487 |
RPointerArray<TEapExpandedType> &aEnabledEAPArrary, |
2488 |
RPointerArray<TEapExpandedType> &aDisabledEAPArrary, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2489 |
const TIndexType aIndexType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2490 |
const TInt aIndex, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2491 |
const eap_type_value_e aTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2492 |
const eap_type_value_e aEapType) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2493 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2494 |
EAP_TRACE_DEBUG_SYMBIAN( |
26 | 2495 |
(_L("EapTlsPeapUtils::GetTunnelingExpandedEapDataL(): - Start - aIndexType=%d, aIndex=%d, aTunnelingType=0xfe%06x%08x, aEapType=0xfe%06x%08x\n"), |
2496 |
aIndexType, |
|
2497 |
aIndex, |
|
2498 |
aTunnelingType.get_vendor_id(), |
|
2499 |
aTunnelingType.get_vendor_type(), |
|
2500 |
aEapType.get_vendor_id(), |
|
2501 |
aEapType.get_vendor_type())); |
|
2502 |
||
2503 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::GetTunnelingExpandedEapDataL()\n")); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2504 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2505 |
HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2506 |
TPtr sqlStatement = buf->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2507 |
|
26 | 2508 |
_LIT(KSQLQueryRow, "SELECT %S, %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2509 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2510 |
if (aEapType == eap_type_peap) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2511 |
{ |
26 | 2512 |
sqlStatement.Format(KSQLQueryRow, |
2513 |
&cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2514 |
&cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal, |
26 | 2515 |
&KPeapDatabaseTableName, |
2516 |
&KServiceType, |
|
2517 |
aIndexType, |
|
2518 |
&KServiceIndex, |
|
2519 |
aIndex, |
|
2520 |
&KTunnelingTypeVendorId, |
|
2521 |
aTunnelingType.get_vendor_id(), |
|
2522 |
&KTunnelingType, |
|
2523 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2524 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2525 |
#if defined(USE_TTLS_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2526 |
else if (aEapType == eap_type_ttls) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2527 |
{ |
26 | 2528 |
sqlStatement.Format(KSQLQueryRow, |
2529 |
&cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2530 |
&cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal, |
26 | 2531 |
&KTtlsDatabaseTableName, |
2532 |
&KServiceType, |
|
2533 |
aIndexType, |
|
2534 |
&KServiceIndex, |
|
2535 |
aIndex, |
|
2536 |
&KTunnelingTypeVendorId, |
|
2537 |
aTunnelingType.get_vendor_id(), |
|
2538 |
&KTunnelingType, |
|
2539 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2540 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2541 |
#endif |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2542 |
#if defined(USE_FAST_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2543 |
else if (aEapType == eap_type_fast) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2544 |
{ |
26 | 2545 |
sqlStatement.Format(KSQLQueryRow, |
2546 |
&cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2547 |
&cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal, |
26 | 2548 |
&KFastGeneralSettingsDBTableName, |
2549 |
&KServiceType, |
|
2550 |
aIndexType, |
|
2551 |
&KServiceIndex, |
|
2552 |
aIndex, |
|
2553 |
&KTunnelingTypeVendorId, |
|
2554 |
aTunnelingType.get_vendor_id(), |
|
2555 |
&KTunnelingType, |
|
2556 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2557 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2558 |
#endif |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2559 |
|
36 | 2560 |
else if (aEapType == eap_expanded_type_ttls_plain_pap.get_type() ) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2561 |
{ |
26 | 2562 |
sqlStatement.Format(KSQLQueryRow, |
2563 |
&cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal, |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2564 |
&cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal, |
26 | 2565 |
&KTtlsDatabaseTableName, |
2566 |
&KServiceType, |
|
2567 |
aIndexType, |
|
2568 |
&KServiceIndex, |
|
2569 |
aIndex, |
|
2570 |
&KTunnelingTypeVendorId, |
|
2571 |
aTunnelingType.get_vendor_id(), |
|
2572 |
&KTunnelingType, |
|
2573 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2574 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2575 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2576 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2577 |
{ |
26 | 2578 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::GetTunnelingExpandedEapDataL(): - Unsupported EAP-type=0xfe%06x%08x\n"), |
2579 |
aEapType.get_vendor_id(), |
|
2580 |
aEapType.get_vendor_type())); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2581 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2582 |
// Unsupported EAP type |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2583 |
User::Leave(KErrNotSupported); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2584 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2585 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2586 |
RDbView view; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2587 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2588 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2589 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2590 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2591 |
User::LeaveIfError(view.FirstL()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2592 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2593 |
view.GetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2594 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2595 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2596 |
CDbColSet* colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2597 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2598 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2599 |
TPtrC8 acceptedEAPData = view.ColDes8(colSet->ColNo(cf_str_PEAP_accepted_tunneled_client_types_hex_data_literal)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2600 |
TPtrC8 unacceptedEAPData = view.ColDes8(colSet->ColNo(cf_str_PEAP_unaccepted_tunneled_client_types_hex_data_literal)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2601 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2602 |
CleanupStack::PopAndDestroy( colSet ); // Delete colSet. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2603 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2604 |
EAP_TRACE_DATA_DEBUG_SYMBIAN(("EapTlsPeapUtils::GetTunnelingExpandedEapDataL- Enabled extended EAP type data from DB:", |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2605 |
acceptedEAPData.Ptr(), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2606 |
acceptedEAPData.Size() ) ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2607 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2608 |
EAP_TRACE_DATA_DEBUG_SYMBIAN(("EapTlsPeapUtils::GetTunnelingExpandedEapDataL- Disabled extended EAP type data from DB:", |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2609 |
unacceptedEAPData.Ptr(), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2610 |
unacceptedEAPData.Size() ) ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2611 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2612 |
aEnabledEAPArrary.ResetAndDestroy(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2613 |
aDisabledEAPArrary.ResetAndDestroy(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2614 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2615 |
TUint acceptedLength = acceptedEAPData.Length(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2616 |
TUint unacceptedLength = unacceptedEAPData.Length(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2617 |
|
26 | 2618 |
TEapExpandedType *expandedEAPTmp = 0; |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2619 |
TUint index = 0; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2620 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2621 |
// For accepted or enabled tunneled EAP types. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2622 |
while(index < acceptedLength) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2623 |
{ |
26 | 2624 |
expandedEAPTmp = new TEapExpandedType; |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2625 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2626 |
if (expandedEAPTmp == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2627 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2628 |
aEnabledEAPArrary.ResetAndDestroy(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2629 |
aDisabledEAPArrary.ResetAndDestroy(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2630 |
User::LeaveIfError(KErrNoMemory); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2631 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2632 |
|
26 | 2633 |
*expandedEAPTmp = acceptedEAPData.Mid(index, KEapExpandedTypeLength); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2634 |
|
26 | 2635 |
EAP_TRACE_DEBUG_SYMBIAN( |
2636 |
(_L("EapTlsPeapUtils::GetTunnelingExpandedEapDataL(): enabled EAP-type=0xfe%06x%08x\n"), |
|
2637 |
expandedEAPTmp->GetVendorId(), |
|
2638 |
expandedEAPTmp->GetVendorType())); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2639 |
|
36 | 2640 |
aEnabledEAPArrary.AppendL(expandedEAPTmp); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2641 |
|
26 | 2642 |
index = index + KEapExpandedTypeLength; |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2643 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2644 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2645 |
index = 0; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2646 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2647 |
// For unaccepted or disabled tunneled EAP types. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2648 |
while(index < unacceptedLength) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2649 |
{ |
26 | 2650 |
expandedEAPTmp = new TEapExpandedType; |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2651 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2652 |
if (expandedEAPTmp == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2653 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2654 |
aEnabledEAPArrary.ResetAndDestroy(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2655 |
aDisabledEAPArrary.ResetAndDestroy(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2656 |
User::LeaveIfError(KErrNoMemory); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2657 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2658 |
|
26 | 2659 |
*expandedEAPTmp = unacceptedEAPData.Mid(index, KEapExpandedTypeLength); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2660 |
|
26 | 2661 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::SetTunnelingExpandedEapDataL(): disabled EAP-type=0xfe%06x%08x\n"), |
2662 |
expandedEAPTmp->GetVendorId(), |
|
2663 |
expandedEAPTmp->GetVendorType())); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2664 |
|
36 | 2665 |
aDisabledEAPArrary.AppendL(expandedEAPTmp); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2666 |
|
26 | 2667 |
index = index + KEapExpandedTypeLength; |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2668 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2669 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2670 |
CleanupStack::PopAndDestroy(&view); // Close view |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2671 |
CleanupStack::PopAndDestroy(buf); // Delete buf |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2672 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2673 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2674 |
//-------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2675 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2676 |
TBool EapTlsPeapUtils::CipherSuiteUseRSAKeys(tls_cipher_suites_e aCipherSuite) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2677 |
{ |
26 | 2678 |
EAP_TRACE_DEBUG_SYMBIAN( |
2679 |
(_L("EapTlsPeapUtils::CipherSuiteUseRSAKeys(): aCipherSuite=%d\n"), |
|
2680 |
aCipherSuite)); |
|
2681 |
||
2682 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::CipherSuiteUseRSAKeys()\n")); |
|
2683 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2684 |
if (aCipherSuite == tls_cipher_suites_TLS_RSA_WITH_3DES_EDE_CBC_SHA |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2685 |
|| aCipherSuite == tls_cipher_suites_TLS_RSA_WITH_AES_128_CBC_SHA |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2686 |
|| aCipherSuite == tls_cipher_suites_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2687 |
|| aCipherSuite == tls_cipher_suites_TLS_DHE_RSA_WITH_AES_128_CBC_SHA |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2688 |
|| aCipherSuite == tls_cipher_suites_TLS_RSA_WITH_RC4_128_MD5 |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2689 |
|| aCipherSuite == tls_cipher_suites_TLS_RSA_WITH_RC4_128_SHA) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2690 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2691 |
return ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2692 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2693 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2694 |
return EFalse; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2695 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2696 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2697 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2698 |
//-------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2699 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2700 |
TBool EapTlsPeapUtils::CipherSuiteUseDSAKeys(tls_cipher_suites_e aCipherSuite) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2701 |
{ |
26 | 2702 |
EAP_TRACE_DEBUG_SYMBIAN( |
2703 |
(_L("EapTlsPeapUtils::CipherSuiteUseDSAKeys(): aCipherSuite=%d\n"), |
|
2704 |
aCipherSuite)); |
|
2705 |
||
2706 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::CipherSuiteUseDSAKeys()\n")); |
|
2707 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2708 |
if (aCipherSuite == tls_cipher_suites_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2709 |
|| aCipherSuite == tls_cipher_suites_TLS_DHE_DSS_WITH_AES_128_CBC_SHA) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2710 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2711 |
return ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2712 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2713 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2714 |
return EFalse; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2715 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2716 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2717 |
//-------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2718 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2719 |
TBool EapTlsPeapUtils::CipherSuiteIsEphemeralDHKeyExchange(tls_cipher_suites_e aCipherSuite) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2720 |
{ |
26 | 2721 |
EAP_TRACE_DEBUG_SYMBIAN( |
2722 |
(_L("EapTlsPeapUtils::CipherSuiteIsEphemeralDHKeyExchange(): aCipherSuite=%d\n"), |
|
2723 |
aCipherSuite)); |
|
2724 |
||
2725 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::CipherSuiteIsEphemeralDHKeyExchange()\n")); |
|
2726 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2727 |
if (aCipherSuite == tls_cipher_suites_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2728 |
|| aCipherSuite == tls_cipher_suites_TLS_DHE_DSS_WITH_AES_128_CBC_SHA |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2729 |
|| aCipherSuite == tls_cipher_suites_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2730 |
|| aCipherSuite == tls_cipher_suites_TLS_DHE_RSA_WITH_AES_128_CBC_SHA) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2731 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2732 |
return ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2733 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2734 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2735 |
return EFalse; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2736 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2737 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2738 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2739 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2740 |
// EapTlsPeapUtils::SetConfigurationL() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2741 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2742 |
// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2743 |
void EapTlsPeapUtils::SetConfigurationL( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2744 |
RDbNamedDatabase& aDatabase, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2745 |
const EAPSettings& aSettings, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2746 |
const TIndexType aIndexType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2747 |
const TInt aIndex, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2748 |
const eap_type_value_e aTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2749 |
const eap_type_value_e aEapType) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2750 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2751 |
EAP_TRACE_DEBUG_SYMBIAN( |
26 | 2752 |
(_L("EapTlsPeapUtils::SetConfigurationL(): -Start- aIndexType=%d, aIndex=%d, aTunnelingType=0xfe%06x%08x, aEapType=0xfe%06x%08x\n"), |
2753 |
aIndexType, |
|
2754 |
aIndex, |
|
2755 |
aTunnelingType.get_vendor_id(), |
|
2756 |
aTunnelingType.get_vendor_type(), |
|
2757 |
aEapType.get_vendor_id(), |
|
2758 |
aEapType.get_vendor_type())); |
|
2759 |
||
2760 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::SetConfigurationL()\n")); |
|
2761 |
||
2762 |
EAP_TRACE_DEBUG_SYMBIAN((_L("*************************** EapTlsPeapUtils::SetConfigurationL(): Set the below values: ***************************\n")) ); |
|
2763 |
||
2764 |
EAP_TRACE_SETTINGS(&aSettings); |
|
2765 |
||
2766 |
EAP_TRACE_DEBUG_SYMBIAN((_L("*************************** EapTlsPeapUtils::SetConfigurationL(): Set the above values: ***************************\n")) ); |
|
2767 |
||
2768 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2769 |
// Validate length of inputs. |
26 | 2770 |
if(aSettings.iUsername.Length() > KMaxUsernameLengthInDB |
2771 |
|| aSettings.iRealm.Length() > KMaxRealmLengthInDB ) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2772 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2773 |
// Some inputs are too long. Can not be stored in DB. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2774 |
|
26 | 2775 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::SetConfigurationL(): Too long arguments\n"))); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2776 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2777 |
User::Leave(KErrArgument); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2778 |
} |
26 | 2779 |
|
2780 |
#ifdef USE_FAST_EAP_TYPE |
|
2781 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2782 |
// Validate length of PAC Group Ref. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2783 |
if(aSettings.iPACGroupReference.Length() > KMaxPACGroupRefCollectionLengthInDB) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2784 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2785 |
// Too long PAC Group Reference. Can not be stored in DB. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2786 |
|
26 | 2787 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::SetConfigurationL(): Too long PAC Group Ref!\n"))); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2788 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2789 |
User::Leave(KErrArgument); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2790 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2791 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2792 |
#endif //#ifdef USE_FAST_EAP_TYPE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2793 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2794 |
// Check if the settings are for the correct type |
26 | 2795 |
if (aSettings.iEAPExpandedType != (*EapExpandedTypeTls.GetType()) |
2796 |
&& aSettings.iEAPExpandedType != (*EapExpandedTypePeap.GetType()) |
|
2797 |
&& aSettings.iEAPExpandedType != (*EapExpandedTypeTtls.GetType()) |
|
2798 |
#ifdef USE_FAST_EAP_TYPE |
|
2799 |
&& aSettings.iEAPExpandedType != (*EapExpandedTypeFast.GetType()) |
|
34 | 2800 |
#endif //#ifdef USE_FAST_EAP_TYPE |
26 | 2801 |
&& aSettings.iEAPExpandedType != (*EapExpandedTypeTtlsPap.GetType()) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2802 |
) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2803 |
{ |
26 | 2804 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::SetConfigurationL(): LEAVE - Unsupported EAP type\n")) ); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2805 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2806 |
User::Leave(KErrNotSupported); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2807 |
} |
26 | 2808 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2809 |
HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2810 |
TPtr sqlStatement = buf->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2811 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2812 |
TPtrC settings; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2813 |
TPtrC usercerts; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2814 |
TPtrC cacerts; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2815 |
TPtrC ciphersuites; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2816 |
TPtrC maxSessionTime; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2817 |
TPtrC lastFullAuthTime; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2818 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2819 |
#ifdef USE_FAST_EAP_TYPE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2820 |
TPtrC fastSpecialSettings; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2821 |
#endif |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2822 |
|
26 | 2823 |
if (aEapType == eap_type_tls) |
2824 |
{ |
|
2825 |
settings.Set(KTlsDatabaseTableName); |
|
2826 |
usercerts.Set(KTlsAllowedUserCertsDatabaseTableName); |
|
2827 |
cacerts.Set(KTlsAllowedCACertsDatabaseTableName); |
|
2828 |
ciphersuites.Set(KTlsAllowedCipherSuitesDatabaseTableName); |
|
2829 |
maxSessionTime.Set(cf_str_EAP_TLS_max_session_validity_time_literal); |
|
2830 |
lastFullAuthTime.Set(KTLSLastFullAuthTime); |
|
2831 |
} |
|
2832 |
else if (aEapType == eap_type_peap) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2833 |
{ |
26 | 2834 |
settings.Set(KPeapDatabaseTableName); |
2835 |
usercerts.Set(KPeapAllowedUserCertsDatabaseTableName); |
|
2836 |
cacerts.Set(KPeapAllowedCACertsDatabaseTableName); |
|
2837 |
ciphersuites.Set(KPeapAllowedCipherSuitesDatabaseTableName); |
|
2838 |
maxSessionTime.Set(cf_str_EAP_PEAP_max_session_validity_time_literal); |
|
2839 |
lastFullAuthTime.Set(KPEAPLastFullAuthTime); |
|
2840 |
} |
|
2841 |
else if (aEapType == eap_type_ttls) |
|
2842 |
{ |
|
2843 |
settings.Set(KTtlsDatabaseTableName); |
|
2844 |
usercerts.Set(KTtlsAllowedUserCertsDatabaseTableName); |
|
2845 |
cacerts.Set(KTtlsAllowedCACertsDatabaseTableName); |
|
2846 |
ciphersuites.Set(KTtlsAllowedCipherSuitesDatabaseTableName); |
|
2847 |
maxSessionTime.Set(cf_str_EAP_TTLS_max_session_validity_time_literal); |
|
2848 |
lastFullAuthTime.Set(KTTLSLastFullAuthTime); |
|
2849 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2850 |
#ifdef USE_FAST_EAP_TYPE |
26 | 2851 |
else if (aEapType == eap_type_fast) |
2852 |
{ |
|
2853 |
settings.Set(KFastGeneralSettingsDBTableName); // This is general settings for FAST. |
|
2854 |
fastSpecialSettings.Set(KFastSpecialSettingsDBTableName); |
|
2855 |
||
2856 |
usercerts.Set(KFastAllowedUserCertsDatabaseTableName); |
|
2857 |
cacerts.Set(KFastAllowedCACertsDatabaseTableName); |
|
2858 |
ciphersuites.Set(KFastAllowedCipherSuitesDatabaseTableName); |
|
2859 |
maxSessionTime.Set(cf_str_EAP_FAST_max_session_validity_time_literal); |
|
2860 |
lastFullAuthTime.Set(KFASTLastFullAuthTime); |
|
2861 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2862 |
#endif |
36 | 2863 |
else if (aEapType == eap_expanded_type_ttls_plain_pap.get_type()) |
26 | 2864 |
{ |
2865 |
settings.Set( KTtlsDatabaseTableName ); |
|
2866 |
maxSessionTime.Set( cf_str_EAP_TLS_PEAP_ttls_pap_max_session_validity_time_literal ); |
|
2867 |
lastFullAuthTime.Set( KTTLSPAPLastFullAuthTime ); |
|
2868 |
} |
|
2869 |
else |
|
2870 |
{ |
|
2871 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: SetConfigurationL(): LEAVE - Unsupported EAP-type=0xfe%06x%08x\n"), |
|
2872 |
aEapType.get_vendor_id(), |
|
2873 |
aEapType.get_vendor_type()) ); |
|
2874 |
||
2875 |
// Should never happen |
|
2876 |
User::Leave(KErrArgument); |
|
2877 |
} |
|
2878 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2879 |
RDbView view; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2880 |
|
26 | 2881 |
_LIT(KSQL, "SELECT * FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2882 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2883 |
////////////////////////////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2884 |
// This is for settings for all EAP types. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2885 |
// For EAP-FAST it is General settings. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2886 |
////////////////////////////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2887 |
|
26 | 2888 |
sqlStatement.Format(KSQL, |
2889 |
&settings, |
|
2890 |
&KServiceType, |
|
2891 |
aIndexType, |
|
2892 |
&KServiceIndex, |
|
2893 |
aIndex, |
|
2894 |
&KTunnelingTypeVendorId, |
|
2895 |
aTunnelingType.get_vendor_id(), |
|
2896 |
&KTunnelingType, |
|
2897 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2898 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2899 |
// Evaluate view |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2900 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2901 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2902 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2903 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2904 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2905 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2906 |
view.FirstL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2907 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2908 |
view.UpdateL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2909 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2910 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2911 |
CDbColSet* colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2912 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2913 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2914 |
// Database view is ready for setting now. Set items one by one, if needed. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2915 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2916 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2917 |
////////////////////////////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2918 |
// This is only for plain PAP settings. // |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2919 |
////////////////////////////////////////// |
36 | 2920 |
if ( aEapType == eap_expanded_type_ttls_plain_pap.get_type() ) |
26 | 2921 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2922 |
// Username |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2923 |
if ( aSettings.iUsernamePresent ) |
26 | 2924 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2925 |
// Validate length. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2926 |
if( aSettings.iUsername.Length() > KMaxPapUserNameLengthInDb ) |
26 | 2927 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2928 |
// Username too long. Can not be stored in DB. |
26 | 2929 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::SetConfigurationL: Too long Username. Length=%d, max length=%d \n" ), |
2930 |
aSettings.iUsername.Length(), |
|
2931 |
KMaxPapUserNameLengthInDb) ); |
|
2932 |
||
2933 |
CleanupStack::PopAndDestroy(colSet); |
|
2934 |
CleanupStack::PopAndDestroy(&view); |
|
2935 |
CleanupStack::PopAndDestroy(buf); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2936 |
User::Leave( KErrArgument ); |
26 | 2937 |
} |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2938 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2939 |
// Length is ok. Set the value in DB. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2940 |
view.SetColL( colSet->ColNo( cf_str_EAP_TLS_PEAP_ttls_pap_username_literal ), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2941 |
aSettings.iUsername); |
26 | 2942 |
} |
2943 |
||
2944 |
// Password existence. |
|
2945 |
if (aSettings.iPasswordExistPresent |
|
2946 |
&& !aSettings.iPasswordExist) |
|
2947 |
{ |
|
2948 |
// Clear password from database. |
|
2949 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_ttls_pap_password_literal), KNullPasswordData); |
|
2950 |
view.SetColNullL(colSet->ColNo(cf_str_EAP_TLS_PEAP_ttls_pap_password_literal)); |
|
2951 |
} |
|
2952 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2953 |
// Password |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2954 |
if ( aSettings.iPasswordPresent ) |
26 | 2955 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2956 |
// Validate length. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2957 |
if ( aSettings.iPassword.Length() > KMaxPapPasswordLengthInDb ) |
26 | 2958 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2959 |
// Password too long. Can not be stored in DB. |
26 | 2960 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::SetConfigurationL: Too long Password. Length=%d, max length=%d\n" ), |
2961 |
aSettings.iPassword.Length(), |
|
2962 |
KMaxPapPasswordLengthInDb) ); |
|
2963 |
||
2964 |
CleanupStack::PopAndDestroy(colSet); |
|
2965 |
CleanupStack::PopAndDestroy(&view); |
|
2966 |
CleanupStack::PopAndDestroy(buf); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2967 |
User::Leave( KErrArgument ); |
26 | 2968 |
} |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2969 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2970 |
// Length is ok. Set the value in DB. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2971 |
view.SetColL( colSet->ColNo( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2972 |
cf_str_EAP_TLS_PEAP_ttls_pap_password_literal ), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2973 |
aSettings.iPassword ); |
26 | 2974 |
} |
2975 |
||
2976 |
// Password prompt |
|
2977 |
if ( aSettings.iShowPassWordPromptPresent ) |
|
2978 |
{ |
|
2979 |
if ( aSettings.iShowPassWordPrompt ) |
|
2980 |
{ |
|
2981 |
view.SetColL( colSet->ColNo( |
|
2982 |
cf_str_EAP_TLS_PEAP_ttls_pap_password_prompt_literal ), |
|
2983 |
EPapPasswordPromptOn ); |
|
2984 |
} |
|
2985 |
else |
|
2986 |
{ |
|
2987 |
view.SetColL( colSet->ColNo( |
|
2988 |
cf_str_EAP_TLS_PEAP_ttls_pap_password_prompt_literal ), |
|
2989 |
EPapPasswordPromptOff ); |
|
2990 |
} |
|
2991 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2992 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2993 |
// Session validity time |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2994 |
if ( aSettings.iSessionValidityTimePresent ) |
26 | 2995 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2996 |
// User or device management wants to store the session validity time. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2997 |
// Convert the time to micro seconds and save. |
26 | 2998 |
TInt64 validityInMicro = (aSettings.iSessionValidityTime) * KMicroSecsInAMinute; |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2999 |
view.SetColL( colSet->ColNo( maxSessionTime ), validityInMicro ); |
26 | 3000 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3001 |
// If max session validity time is supplied and non-zero, set password prompting ON. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3002 |
// It doesn't matter even if the password is supplied. If max session validity is supplied, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3003 |
// it means user needs to provide a password hence prompt should appear. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3004 |
if( validityInMicro != 0) |
26 | 3005 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3006 |
view.SetColL( colSet->ColNo( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3007 |
cf_str_EAP_TLS_PEAP_ttls_pap_password_prompt_literal ), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3008 |
EPapPasswordPromptOn ); |
26 | 3009 |
} |
3010 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3011 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3012 |
// Last full authentication time should be made zero when EAP configurations are modified. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3013 |
// This makes sure that the next authentication with this EAP would be full authentication |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3014 |
// instead of reauthentication even if the session is still valid. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3015 |
view.SetColL( colSet->ColNo( lastFullAuthTime ), default_FullAuthTime ); |
26 | 3016 |
|
3017 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils: Session Validity: Resetting Full Auth Time since settings are modified\n"))); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3018 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3019 |
view.PutL(); |
26 | 3020 |
|
3021 |
CleanupStack::PopAndDestroy(colSet); |
|
3022 |
CleanupStack::PopAndDestroy(&view); |
|
3023 |
CleanupStack::PopAndDestroy(buf); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3024 |
|
26 | 3025 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::SetConfigurationL(): Return PAP\n") ) ); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3026 |
return; |
36 | 3027 |
} // if ( aEapVendorType == eap_expanded_type_ttls_plain_pap.get_type() ) |
26 | 3028 |
|
3029 |
||
3030 |
if (aSettings.iUseAutomaticCACertificatePresent) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3031 |
{ |
26 | 3032 |
// This is to set the automatic or manual status. |
3033 |
TUint useAutomaticCACertificateStatus; |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3034 |
|
26 | 3035 |
if (aSettings.iUseAutomaticCACertificate) |
3036 |
{ |
|
3037 |
useAutomaticCACertificateStatus = EEapDbTrue; |
|
3038 |
} |
|
3039 |
else |
|
3040 |
{ |
|
3041 |
useAutomaticCACertificateStatus = EEapDbFalse; |
|
3042 |
} |
|
3043 |
||
3044 |
// Set the value. |
|
3045 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_automatic_ca_certificate_literal), useAutomaticCACertificateStatus); |
|
3046 |
} |
|
3047 |
||
3048 |
||
3049 |
if (aSettings.iUseAutomaticUsernamePresent) |
|
3050 |
{ |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3051 |
// This is to set the automatic or manual status. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3052 |
TUint useManualUsernameStatus; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3053 |
|
26 | 3054 |
if (aSettings.iUseAutomaticUsername) |
3055 |
{ |
|
3056 |
useManualUsernameStatus = EEapDbFalse; |
|
3057 |
} |
|
3058 |
else |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3059 |
{ |
26 | 3060 |
useManualUsernameStatus = EEapDbTrue; |
3061 |
} |
|
3062 |
||
3063 |
// Set the value. |
|
3064 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_username_literal), useManualUsernameStatus); |
|
3065 |
} |
|
3066 |
||
3067 |
||
3068 |
if (aSettings.iUseAutomaticRealmPresent) |
|
3069 |
{ |
|
3070 |
// This is to set the automatic or manual status. |
|
3071 |
TUint useManualRealmStatus; |
|
3072 |
||
3073 |
if (aSettings.iUseAutomaticRealm) |
|
3074 |
{ |
|
3075 |
useManualRealmStatus = EEapDbFalse; |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3076 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3077 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3078 |
{ |
26 | 3079 |
useManualRealmStatus = EEapDbTrue; |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3080 |
} |
26 | 3081 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3082 |
// Set the value. |
26 | 3083 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_realm_literal), useManualRealmStatus); |
3084 |
} |
|
3085 |
||
3086 |
||
3087 |
// Manual username |
|
3088 |
if (aSettings.iUsernamePresent) |
|
3089 |
{ |
|
3090 |
// Check if length of username is less than the max length. |
|
3091 |
if(aSettings.iUsername.Length() > KMaxUsernameLengthInDB) |
|
3092 |
{ |
|
3093 |
// Username too long. Can not be stored in DB. |
|
3094 |
||
3095 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::SetConfigurationL(): Too long Username. Length=%d \n"), |
|
3096 |
aSettings.iUsername.Length())); |
|
3097 |
||
3098 |
User::Leave(KErrArgument); |
|
3099 |
} |
|
3100 |
||
3101 |
// Set the value in DB. Value could be empty. It doesn't matter. |
|
3102 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_manual_username_literal), aSettings.iUsername); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3103 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3104 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3105 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3106 |
// Manual realm |
26 | 3107 |
if (aSettings.iRealmPresent) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3108 |
{ |
26 | 3109 |
// Check if length of realm is less than the max length. |
3110 |
if(aSettings.iRealm.Length() > KMaxRealmLengthInDB) |
|
3111 |
{ |
|
3112 |
// Realm too long. Can not be stored in DB. |
|
3113 |
||
3114 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::SetConfigurationL(): Too long Realm. Length=%d \n"), |
|
3115 |
aSettings.iRealm.Length())); |
|
3116 |
||
3117 |
User::Leave(KErrArgument); |
|
3118 |
} |
|
3119 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3120 |
// Set the value in DB. Value could be empty. It doesn't matter. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3121 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_manual_realm_literal), aSettings.iRealm); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3122 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3123 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3124 |
// Verify server realm |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3125 |
if (aSettings.iVerifyServerRealmPresent) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3126 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3127 |
if (aSettings.iVerifyServerRealm) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3128 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3129 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_verify_certificate_realm_literal), |
26 | 3130 |
EEapDbTrue); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3131 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3132 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3133 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3134 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_verify_certificate_realm_literal), |
26 | 3135 |
EEapDbFalse); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3136 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3137 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3138 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3139 |
// Require client authentication |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3140 |
if (aSettings.iRequireClientAuthenticationPresent) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3141 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3142 |
if (aSettings.iRequireClientAuthentication) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3143 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3144 |
view.SetColL(colSet->ColNo(cf_str_TLS_server_authenticates_client_policy_in_client_literal), |
26 | 3145 |
EEapDbTrue); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3146 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3147 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3148 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3149 |
view.SetColL(colSet->ColNo(cf_str_TLS_server_authenticates_client_policy_in_client_literal), |
26 | 3150 |
EEapDbFalse); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3151 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3152 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3153 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3154 |
// Session validity time |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3155 |
if (aSettings.iSessionValidityTimePresent) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3156 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3157 |
// User or device management wants to store the session validity time. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3158 |
// Convert the time to micro seconds and save. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3159 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3160 |
TInt64 validityInMicro = (aSettings.iSessionValidityTime) * KMicroSecsInAMinute; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3161 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3162 |
view.SetColL(colSet->ColNo(maxSessionTime), validityInMicro); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3163 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3164 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3165 |
// Last full authentication time should be made zero when EAP configurations are modified. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3166 |
// This makes sure that the next authentication with this EAP would be full authentication |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3167 |
// instead of reauthentication even if the session is still valid. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3168 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3169 |
view.SetColL(colSet->ColNo(lastFullAuthTime), default_FullAuthTime); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3170 |
|
26 | 3171 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils: Session Validity: Resetting Full Auth Time since settings are modified\n"))); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3172 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3173 |
// PEAP versions |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3174 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3175 |
if (aSettings.iPEAPVersionsPresent |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3176 |
&& (aEapType == eap_type_peap |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3177 |
|| aEapType == eap_type_ttls |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3178 |
#ifdef USE_FAST_EAP_TYPE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3179 |
|| aEapType == eap_type_fast |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3180 |
#endif |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3181 |
)) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3182 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3183 |
TBuf8<KMaxPEAPVersionsStringLengthInDB> acceptedPEAPVersions; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3184 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3185 |
if (aSettings.iPEAPv0Allowed) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3186 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3187 |
TInt tmp(0); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3188 |
acceptedPEAPVersions.Append(reinterpret_cast<const TUint8*>(&tmp), sizeof(TInt)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3189 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3190 |
if (aSettings.iPEAPv1Allowed) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3191 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3192 |
TInt tmp(1); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3193 |
acceptedPEAPVersions.Append(reinterpret_cast<const TUint8*>(&tmp), sizeof(TInt)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3194 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3195 |
if (aSettings.iPEAPv2Allowed) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3196 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3197 |
TInt tmp(2); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3198 |
acceptedPEAPVersions.Append(reinterpret_cast<const TUint8*>(&tmp), sizeof(TInt)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3199 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3200 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_accepted_PEAP_versions_literal), acceptedPEAPVersions); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3201 |
} |
26 | 3202 |
|
3203 |
if (aSettings.iUseIdentityPrivacyPresent) |
|
3204 |
{ |
|
3205 |
// This is to set the automatic or manual status. |
|
3206 |
TUint UseIdentityPrivacy = 0ul; |
|
3207 |
||
3208 |
if (aSettings.iUseIdentityPrivacy) |
|
3209 |
{ |
|
3210 |
UseIdentityPrivacy = EEapDbTrue; |
|
3211 |
} |
|
3212 |
else |
|
3213 |
{ |
|
3214 |
UseIdentityPrivacy = EEapDbFalse; |
|
3215 |
} |
|
3216 |
||
3217 |
view.SetColL(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_identity_privacy_literal), UseIdentityPrivacy); |
|
3218 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3219 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3220 |
view.PutL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3221 |
|
26 | 3222 |
CleanupStack::PopAndDestroy(colSet); |
3223 |
CleanupStack::PopAndDestroy(&view); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3224 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3225 |
#ifdef USE_FAST_EAP_TYPE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3226 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3227 |
/////////////////////////////////////////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3228 |
// This is only for EAP-FAST specific, Special settings. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3229 |
/////////////////////////////////////////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3230 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3231 |
if(aEapType == eap_type_fast) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3232 |
{ |
26 | 3233 |
sqlStatement.Format(KSQL, |
3234 |
&fastSpecialSettings, |
|
3235 |
&KServiceType, |
|
3236 |
aIndexType, |
|
3237 |
&KServiceIndex, |
|
3238 |
aIndex, |
|
3239 |
&KTunnelingTypeVendorId, |
|
3240 |
aTunnelingType.get_vendor_id(), |
|
3241 |
&KTunnelingType, |
|
3242 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3243 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3244 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3245 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3246 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3247 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3248 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3249 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3250 |
view.FirstL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3251 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3252 |
view.UpdateL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3253 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3254 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3255 |
colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3256 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3257 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3258 |
// Database view is ready for setting now. Set items one by one, if needed. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3259 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3260 |
// For provisioning modes. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3261 |
if (aSettings.iAuthProvModeAllowedPresent) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3262 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3263 |
if (aSettings.iAuthProvModeAllowed) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3264 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3265 |
view.SetColL(colSet->ColNo(cf_str_EAP_FAST_allow_server_authenticated_provisioning_mode_literal), |
26 | 3266 |
EEapDbTrue); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3267 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3268 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3269 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3270 |
view.SetColL(colSet->ColNo(cf_str_EAP_FAST_allow_server_authenticated_provisioning_mode_literal), |
26 | 3271 |
EEapDbFalse); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3272 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3273 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3274 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3275 |
if (aSettings.iUnauthProvModeAllowedPresent) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3276 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3277 |
if (aSettings.iUnauthProvModeAllowed) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3278 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3279 |
view.SetColL(colSet->ColNo(cf_str_EAP_FAST_allow_server_unauthenticated_provisioning_mode_ADHP_literal), |
26 | 3280 |
EEapDbTrue); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3281 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3282 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3283 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3284 |
view.SetColL(colSet->ColNo(cf_str_EAP_FAST_allow_server_unauthenticated_provisioning_mode_ADHP_literal), |
26 | 3285 |
EEapDbFalse); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3286 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3287 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3288 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3289 |
// For the warnings and prompts |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3290 |
if (aSettings.iWarnADHPNoPACPresent) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3291 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3292 |
if (aSettings.iWarnADHPNoPAC) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3293 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3294 |
view.SetColL(colSet->ColNo(KFASTWarnADHPNoPAC), |
26 | 3295 |
EEapDbTrue); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3296 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3297 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3298 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3299 |
view.SetColL(colSet->ColNo(KFASTWarnADHPNoPAC), |
26 | 3300 |
EEapDbFalse); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3301 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3302 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3303 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3304 |
if (aSettings.iWarnADHPNoMatchingPACPresent) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3305 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3306 |
if (aSettings.iWarnADHPNoMatchingPAC) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3307 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3308 |
view.SetColL(colSet->ColNo(KFASTWarnADHPNoMatchingPAC), |
26 | 3309 |
EEapDbTrue); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3310 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3311 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3312 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3313 |
view.SetColL(colSet->ColNo(KFASTWarnADHPNoMatchingPAC), |
26 | 3314 |
EEapDbFalse); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3315 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3316 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3317 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3318 |
if (aSettings.iWarnNotDefaultServerPresent) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3319 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3320 |
if (aSettings.iWarnADHPNoMatchingPAC) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3321 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3322 |
view.SetColL(colSet->ColNo(KFASTWarnNotDefaultServer), |
26 | 3323 |
EEapDbTrue); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3324 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3325 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3326 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3327 |
view.SetColL(colSet->ColNo(KFASTWarnNotDefaultServer), |
26 | 3328 |
EEapDbFalse); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3329 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3330 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3331 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3332 |
// For PAC group reference. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3333 |
if (aSettings.iPACGroupReferencePresent) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3334 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3335 |
// The length of iPACGroupReference is already checked for max length. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3336 |
// So just store it in the DB. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3337 |
view.SetColL(colSet->ColNo(KFASTPACGroupImportReferenceCollection), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3338 |
aSettings.iPACGroupReference); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3339 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3340 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3341 |
view.PutL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3342 |
|
26 | 3343 |
CleanupStack::PopAndDestroy(colSet); |
3344 |
CleanupStack::PopAndDestroy(&view); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3345 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3346 |
} // End: if(aEapType == eap_type_fast) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3347 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3348 |
#endif // #ifdef USE_FAST_EAP_TYPE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3349 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3350 |
////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3351 |
// Cipher suites |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3352 |
////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3353 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3354 |
if (aSettings.iCipherSuitesPresent) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3355 |
{ |
26 | 3356 |
sqlStatement.Format(KSQL, |
3357 |
&ciphersuites, |
|
3358 |
&KServiceType, |
|
3359 |
aIndexType, |
|
3360 |
&KServiceIndex, |
|
3361 |
aIndex, |
|
3362 |
&KTunnelingTypeVendorId, |
|
3363 |
aTunnelingType.get_vendor_id(), |
|
3364 |
&KTunnelingType, |
|
3365 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3366 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3367 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3368 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3369 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3370 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3371 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3372 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3373 |
// Delete old rows |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3374 |
if (view.FirstL()) |
34 | 3375 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3376 |
do { |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3377 |
view.DeleteL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3378 |
} while (view.NextL() != EFalse); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3379 |
} |
34 | 3380 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3381 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3382 |
colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3383 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3384 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3385 |
// Database view is ready for setting now. Set items one by one, if needed. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3386 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3387 |
for (TInt i = 0; i < aSettings.iCipherSuites.Count(); i++) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3388 |
{ |
34 | 3389 |
view.InsertL(); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3390 |
view.SetColL(colSet->ColNo(KServiceType), static_cast<TUint>(aIndexType)); |
34 | 3391 |
view.SetColL(colSet->ColNo(KServiceIndex), static_cast<TUint>(aIndex)); |
26 | 3392 |
view.SetColL(colSet->ColNo(KTunnelingTypeVendorId), aTunnelingType.get_vendor_id()); |
3393 |
view.SetColL(colSet->ColNo(KTunnelingType), aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3394 |
view.SetColL(colSet->ColNo(KCipherSuite), aSettings.iCipherSuites[i]); |
34 | 3395 |
view.PutL(); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3396 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3397 |
|
26 | 3398 |
CleanupStack::PopAndDestroy(colSet); |
3399 |
CleanupStack::PopAndDestroy(&view); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3400 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3401 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3402 |
///////////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3403 |
// User + CA Certificates |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3404 |
///////////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3405 |
|
26 | 3406 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::SetConfigurationL(): aSettings.iCertificatesPresent=%d \n"), aSettings.iCertificatesPresent ) ); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3407 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3408 |
if (aSettings.iCertificatesPresent) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3409 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3410 |
// Needed for getting the Symbian's subject key id. |
26 | 3411 |
//CEapTlsPeapCertFetcher* certFetcher = CEapTlsPeapCertFetcher::NewL(); |
3412 |
//CleanupStack::PushL(certFetcher); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3413 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3414 |
TBuf8<KKeyIdentifierLength> symbianSubjectKeyID; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3415 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3416 |
// For USER certificate. |
26 | 3417 |
sqlStatement.Format(KSQL, |
3418 |
&usercerts, |
|
3419 |
&KServiceType, |
|
3420 |
aIndexType, |
|
3421 |
&KServiceIndex, |
|
3422 |
aIndex, |
|
3423 |
&KTunnelingTypeVendorId, |
|
3424 |
aTunnelingType.get_vendor_id(), |
|
3425 |
&KTunnelingType, |
|
3426 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3427 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3428 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3429 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3430 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3431 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3432 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3433 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3434 |
// Delete old rows |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3435 |
if (view.FirstL()) |
34 | 3436 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3437 |
do { |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3438 |
view.DeleteL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3439 |
} while (view.NextL() != EFalse); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3440 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3441 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3442 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3443 |
colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3444 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3445 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3446 |
// Database view is ready for setting now. Set items one by one, if needed. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3447 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3448 |
TInt i(0); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3449 |
|
26 | 3450 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::SetConfigurationL(): aSettings.iCertificates.Count()=%d \n"), aSettings.iCertificates.Count() ) ); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3451 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3452 |
for (i = 0; i < aSettings.iCertificates.Count(); i++) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3453 |
{ |
26 | 3454 |
if (aSettings.iCertificates[i]->GetIsEnabledPresent() |
3455 |
&& aSettings.iCertificates[i]->GetIsEnabled() |
|
3456 |
&& aSettings.iCertificates[i]->GetCertType() == EapCertificateEntry::EUser) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3457 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3458 |
// Validate the length and save other certificate details to the DB. |
26 | 3459 |
if(aSettings.iCertificates[i]->GetSubjectName()->Length() > KKeyIdentifierLength |
3460 |
|| aSettings.iCertificates[i]->GetIssuerName()->Length() > KGeneralStringMaxLength |
|
3461 |
|| aSettings.iCertificates[i]->GetSerialNumber()->Length() > KGeneralStringMaxLength |
|
3462 |
|| aSettings.iCertificates[i]->GetSubjectKeyId().Length() > KGeneralStringMaxLength |
|
3463 |
|| aSettings.iCertificates[i]->GetThumbprint()->Length() > KThumbprintMaxLength) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3464 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3465 |
// Too long data. Can not be stored in DB. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3466 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3467 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::SetConfigurationL : Too long USER cert details.\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3468 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3469 |
User::Leave(KErrArgument); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3470 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3471 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3472 |
EAP_TRACE_DATA_DEBUG_SYMBIAN(("THIS IS SubjectKeyID:", |
26 | 3473 |
aSettings.iCertificates[i]->GetSubjectKeyId().Ptr(), |
3474 |
aSettings.iCertificates[i]->GetSubjectKeyId().Length())); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3475 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3476 |
// The cert label column is left empty |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3477 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3478 |
view.InsertL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3479 |
view.SetColL(colSet->ColNo(KServiceType), static_cast<TUint>(aIndexType)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3480 |
view.SetColL(colSet->ColNo(KServiceIndex), static_cast<TUint>(aIndex)); |
26 | 3481 |
view.SetColL(colSet->ColNo(KTunnelingTypeVendorId), aTunnelingType.get_vendor_id()); |
3482 |
view.SetColL(colSet->ColNo(KTunnelingType), aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3483 |
|
26 | 3484 |
view.SetColL(colSet->ColNo(KSubjectName), *(aSettings.iCertificates[i]->GetSubjectName())); |
3485 |
view.SetColL(colSet->ColNo(KIssuerName), *(aSettings.iCertificates[i]->GetIssuerName())); |
|
3486 |
view.SetColL(colSet->ColNo(KSerialNumber), *(aSettings.iCertificates[i]->GetSerialNumber())); |
|
3487 |
view.SetColL(colSet->ColNo(KActualSubjectKeyIdentifier), aSettings.iCertificates[i]->GetSubjectKeyId()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3488 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3489 |
// Special for thumb print (finger print). Need to convert it to 8 bits before storing in DB |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3490 |
TBuf8<KThumbprintMaxLength> thumbPrint8Bit; |
26 | 3491 |
thumbPrint8Bit.Copy(*(aSettings.iCertificates[i]->GetThumbprint())); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3492 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3493 |
view.SetColL(colSet->ColNo(KThumbprint), thumbPrint8Bit); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3494 |
|
26 | 3495 |
view.SetColL(colSet->ColNo(KSubjectKeyIdentifier), aSettings.iCertificates[i]->GetSubjectKeyId()); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3496 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3497 |
view.PutL(); |
26 | 3498 |
} |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3499 |
} |
26 | 3500 |
|
3501 |
CleanupStack::PopAndDestroy(colSet); |
|
3502 |
CleanupStack::PopAndDestroy(&view); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3503 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3504 |
// Do the same for CA certificates. |
26 | 3505 |
sqlStatement.Format(KSQL, |
3506 |
&cacerts, |
|
3507 |
&KServiceType, |
|
3508 |
aIndexType, |
|
3509 |
&KServiceIndex, |
|
3510 |
aIndex, |
|
3511 |
&KTunnelingTypeVendorId, |
|
3512 |
aTunnelingType.get_vendor_id(), |
|
3513 |
&KTunnelingType, |
|
3514 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3515 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3516 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3517 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3518 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3519 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3520 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3521 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3522 |
// Delete old rows |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3523 |
if (view.FirstL()) |
34 | 3524 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3525 |
do { |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3526 |
view.DeleteL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3527 |
} while (view.NextL() != EFalse); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3528 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3529 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3530 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3531 |
colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3532 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3533 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3534 |
for (i = 0; i < aSettings.iCertificates.Count(); i++) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3535 |
{ |
26 | 3536 |
if (aSettings.iCertificates[i]->GetIsEnabledPresent() |
3537 |
&& aSettings.iCertificates[i]->GetIsEnabled() |
|
3538 |
&& aSettings.iCertificates[i]->GetCertType() == EapCertificateEntry::ECA) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3539 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3540 |
// Validate the length and save other certificate details to the DB. |
26 | 3541 |
if(aSettings.iCertificates[i]->GetSubjectName()->Length() > KKeyIdentifierLength |
3542 |
|| aSettings.iCertificates[i]->GetIssuerName()->Length() > KGeneralStringMaxLength |
|
3543 |
|| aSettings.iCertificates[i]->GetSerialNumber()->Length() > KGeneralStringMaxLength |
|
3544 |
|| aSettings.iCertificates[i]->GetSubjectKeyId().Length() > KGeneralStringMaxLength |
|
3545 |
|| aSettings.iCertificates[i]->GetThumbprint()->Length() > KThumbprintMaxLength) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3546 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3547 |
// Too long data. Can not be stored in DB. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3548 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3549 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::SetConfigurationL:Too long CA cert details.\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3550 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3551 |
User::Leave(KErrArgument); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3552 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3553 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3554 |
// The cert label column is left empty |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3555 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3556 |
view.InsertL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3557 |
view.SetColL(colSet->ColNo(KServiceType), static_cast<TUint>(aIndexType)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3558 |
view.SetColL(colSet->ColNo(KServiceIndex), static_cast<TUint>(aIndex)); |
26 | 3559 |
view.SetColL(colSet->ColNo(KTunnelingTypeVendorId), aTunnelingType.get_vendor_id()); |
3560 |
view.SetColL(colSet->ColNo(KTunnelingType), aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3561 |
|
26 | 3562 |
view.SetColL(colSet->ColNo(KSubjectName), *(aSettings.iCertificates[i]->GetSubjectName())); |
3563 |
view.SetColL(colSet->ColNo(KIssuerName), *(aSettings.iCertificates[i]->GetIssuerName())); |
|
3564 |
view.SetColL(colSet->ColNo(KSerialNumber), *(aSettings.iCertificates[i]->GetSerialNumber())); |
|
3565 |
view.SetColL(colSet->ColNo(KActualSubjectKeyIdentifier), aSettings.iCertificates[i]->GetSubjectKeyId()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3566 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3567 |
// Special for thumb print (finger print). Need to convert it to 8 bits before storing in DB |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3568 |
TBuf8<KThumbprintMaxLength> thumbPrint8Bit; |
26 | 3569 |
thumbPrint8Bit.Copy(*(aSettings.iCertificates[i]->GetThumbprint())); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3570 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3571 |
view.SetColL(colSet->ColNo(KThumbprint), thumbPrint8Bit); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3572 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3573 |
// Get the "symbian's subject key id" using symbian API. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3574 |
// We use this subject key id for authentication. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3575 |
|
26 | 3576 |
view.SetColL(colSet->ColNo(KSubjectKeyIdentifier), aSettings.iCertificates[i]->GetSubjectKeyId()); |
3577 |
||
3578 |
EAP_TRACE_DATA_DEBUG_SYMBIAN( ( "EapTlsPeapUtils::SetConfigurationL(): Adding CA cert to DB, Supplied (Actual) SubjectKeyID:", |
|
3579 |
aSettings.iCertificates[i]->GetSubjectKeyId().Ptr(), |
|
3580 |
aSettings.iCertificates[i]->GetSubjectKeyId().Length() ) ); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3581 |
|
26 | 3582 |
EAP_TRACE_SETTINGS(aSettings.iCertificates[i]); |
3583 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3584 |
view.PutL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3585 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3586 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3587 |
|
26 | 3588 |
CleanupStack::PopAndDestroy(colSet); |
3589 |
CleanupStack::PopAndDestroy(&view); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3590 |
|
26 | 3591 |
//CleanupStack::PopAndDestroy(certFetcher); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3592 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3593 |
} // End of if (aSettings.iCertificatesPresent) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3594 |
|
26 | 3595 |
CleanupStack::PopAndDestroy(buf); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3596 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3597 |
///////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3598 |
// Encapsulated types |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3599 |
///////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3600 |
|
26 | 3601 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::SetConfigurationL(): aSettings.iEnabledEncapsulatedEAPExpandedTypesPresent=%d \n"), aSettings.iEnabledEncapsulatedEAPExpandedTypesPresent ) ); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3602 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3603 |
// Encapsulated types are only for EAP-PEAP, EAP-TTLS and EAP-FAST. Not for EAP-TLS. |
26 | 3604 |
// This is just to be on safe side. In case if iEnabledEncapsulatedEAPExpandedTypesPresent is set true for EAP-TLS by the caller. |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3605 |
if ( aEapType != eap_type_peap |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3606 |
&& aEapType != eap_type_ttls |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3607 |
#ifdef USE_FAST_EAP_TYPE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3608 |
&& aEapType != eap_type_fast |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3609 |
#endif |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3610 |
) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3611 |
{ |
26 | 3612 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::SetConfigurationL(): End - Since no encapsulated type for the EAP-type=0xfe%06x%08x\n"), |
3613 |
aEapType.get_vendor_id(), |
|
3614 |
aEapType.get_vendor_type() ) ); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3615 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3616 |
return; // No need to proceed. No encapsulated type for EAP-TLS.. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3617 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3618 |
|
26 | 3619 |
if (aSettings.iEnabledEncapsulatedEAPExpandedTypesPresent) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3620 |
{ |
26 | 3621 |
RPointerArray<TEapExpandedType> enabledEAPTypes; |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3622 |
// This is just for dummy. All EAP types available here are enabled as default. |
26 | 3623 |
RPointerArray<TEapExpandedType> disabledEAPTypes; |
3624 |
TEapExpandedType* expandedEAPTmp = 0; |
|
3625 |
||
3626 |
for (TInt i = 0; i < aSettings.iEnabledEncapsulatedEAPExpandedTypes.Count(); i++) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3627 |
{ |
26 | 3628 |
expandedEAPTmp = new TEapExpandedType; |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3629 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3630 |
if (expandedEAPTmp == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3631 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3632 |
enabledEAPTypes.ResetAndDestroy(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3633 |
disabledEAPTypes.ResetAndDestroy(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3634 |
enabledEAPTypes.Close(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3635 |
disabledEAPTypes.Close(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3636 |
User::Leave(KErrNoMemory); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3637 |
} |
26 | 3638 |
|
3639 |
// Now copy the 8 byte string to expandedEAPTmp. |
|
3640 |
*expandedEAPTmp = aSettings.iEnabledEncapsulatedEAPExpandedTypes[i].GetValue(); |
|
3641 |
||
3642 |
EAP_TRACE_DATA_DEBUG_SYMBIAN( |
|
3643 |
("EapTlsPeapUtils::SetConfigurationL: Expanded EAP type string", |
|
3644 |
expandedEAPTmp->GetValue().Ptr(), |
|
3645 |
expandedEAPTmp->GetValue().Size() ) ); |
|
3646 |
||
3647 |
TInt error = enabledEAPTypes.Append(expandedEAPTmp); |
|
3648 |
if (error != KErrNone) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3649 |
{ |
26 | 3650 |
delete expandedEAPTmp; |
3651 |
expandedEAPTmp = 0; |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3652 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3653 |
} |
26 | 3654 |
|
3655 |
TRAPD(error, SetTunnelingExpandedEapDataL( |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3656 |
aDatabase, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3657 |
0, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3658 |
enabledEAPTypes, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3659 |
disabledEAPTypes, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3660 |
aIndexType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3661 |
aIndex, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3662 |
aTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3663 |
aEapType)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3664 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3665 |
if( error != KErrNone ) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3666 |
{ |
26 | 3667 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::SetConfigurationL(): ########### Setting Expanded Tunneling types in the DB failed ############ \n") ) ); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3668 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3669 |
enabledEAPTypes.ResetAndDestroy(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3670 |
disabledEAPTypes.ResetAndDestroy(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3671 |
enabledEAPTypes.Close(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3672 |
disabledEAPTypes.Close(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3673 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3674 |
User::Leave(KErrArgument); // There could be some problem in the encapsulated EAP type argument. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3675 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3676 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3677 |
enabledEAPTypes.ResetAndDestroy(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3678 |
disabledEAPTypes.ResetAndDestroy(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3679 |
enabledEAPTypes.Close(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3680 |
disabledEAPTypes.Close(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3681 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3682 |
} |
26 | 3683 |
|
3684 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::SetConfigurationL(): End \n") ) ); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3685 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3686 |
} // EapTlsPeapUtils::SetConfigurationL() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3687 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3688 |
|
26 | 3689 |
// ---------------------------------------------------------------------- |
3690 |
||
3691 |
TInt EapTlsPeapUtils::FilterEapMethods( |
|
3692 |
RPointerArray<TEapExpandedType> * const aEAPTypes, |
|
3693 |
RPointerArray<TEapExpandedType> * const aPlugins) |
|
3694 |
{ |
|
3695 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::FilterEapMethods(): aEAPTypes->Count()=%d, aPlugins->Count()=%d\n"), |
|
3696 |
aEAPTypes->Count(), |
|
3697 |
aPlugins->Count())); |
|
3698 |
||
3699 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::FilterEapMethods()\n")); |
|
3700 |
||
3701 |
for (TInt act_ind = 0; act_ind < aEAPTypes->Count(); ++act_ind) |
|
3702 |
{ |
|
3703 |
const TEapExpandedType * eap_type = (*aEAPTypes)[act_ind]; |
|
3704 |
if (eap_type == 0) |
|
3705 |
{ |
|
3706 |
return KErrNoMemory; |
|
3707 |
} |
|
3708 |
||
3709 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::FilterEapMethods(): aEAPTypes[%d] EAP-type=0xfe%06x%08x\n"), |
|
3710 |
act_ind, |
|
3711 |
eap_type->GetVendorId(), |
|
3712 |
eap_type->GetVendorType())); |
|
3713 |
||
3714 |
bool exists(false); |
|
3715 |
||
3716 |
for (TInt plugin_ind = 0; plugin_ind < aPlugins->Count(); ++plugin_ind) |
|
3717 |
{ |
|
3718 |
const TEapExpandedType * plugin_type = (*aPlugins)[plugin_ind]; |
|
3719 |
if (plugin_type == 0) |
|
3720 |
{ |
|
3721 |
return KErrNoMemory; |
|
3722 |
} |
|
3723 |
||
3724 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::FilterEapMethods(): aPlugins[%d] EAP-type=0xfe%06x%08x\n"), |
|
3725 |
plugin_ind, |
|
3726 |
plugin_type->GetVendorId(), |
|
3727 |
plugin_type->GetVendorType())); |
|
3728 |
||
3729 |
if (*eap_type == *plugin_type) |
|
3730 |
{ |
|
3731 |
// OK, this active EAP-method have implementation. |
|
3732 |
exists = true; |
|
3733 |
||
3734 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::FilterEapMethods(): Removes from aPlugins EAP-type=0xfe%06x%08x\n"), |
|
3735 |
eap_type->GetVendorId(), |
|
3736 |
eap_type->GetVendorType())); |
|
3737 |
||
3738 |
// Remove this plugin EAP-method because it is in the list of EAP-methods. |
|
3739 |
delete (*aPlugins)[plugin_ind]; |
|
3740 |
aPlugins->Remove(plugin_ind); |
|
3741 |
||
3742 |
break; |
|
3743 |
} |
|
3744 |
} // for() |
|
3745 |
||
3746 |
if (exists == false) |
|
3747 |
{ |
|
3748 |
// Remove this EAP-method because there are no implementation. |
|
3749 |
||
3750 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::FilterEapMethods(): Removes from aEAPTypes EAP-type=0xfe%06x%08x\n"), |
|
3751 |
eap_type->GetVendorId(), |
|
3752 |
eap_type->GetVendorType())); |
|
3753 |
||
3754 |
delete (*aEAPTypes)[act_ind]; |
|
3755 |
aEAPTypes->Remove(act_ind); |
|
3756 |
||
3757 |
--act_ind; |
|
3758 |
} |
|
3759 |
} // for() |
|
3760 |
||
3761 |
return KErrNone; |
|
3762 |
} |
|
3763 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3764 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3765 |
// EapTlsPeapUtils::GetConfigurationL() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3766 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3767 |
// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3768 |
void EapTlsPeapUtils::GetConfigurationL( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3769 |
RDbNamedDatabase& aDatabase, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3770 |
EAPSettings& aSettings, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3771 |
const TIndexType aIndexType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3772 |
const TInt aIndex, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3773 |
const eap_type_value_e aTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3774 |
const eap_type_value_e aEapType) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3775 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3776 |
EAP_TRACE_DEBUG_SYMBIAN( |
26 | 3777 |
(_L("EapTlsPeapUtils::GetConfigurationL(): -Start- aIndexType=%d, aIndex=%d, aTunnelingType=0xfe%06x%08x, aEapType=0xfe%06x%08x\n"), |
3778 |
aIndexType, |
|
3779 |
aIndex, |
|
3780 |
aTunnelingType.get_vendor_id(), |
|
3781 |
aTunnelingType.get_vendor_type(), |
|
3782 |
aEapType.get_vendor_id(), |
|
3783 |
aEapType.get_vendor_type())); |
|
3784 |
||
3785 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::GetConfigurationL()\n")); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3786 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3787 |
HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3788 |
TPtr sqlStatement = buf->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3789 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3790 |
TPtrC settings; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3791 |
TPtrC usercerts; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3792 |
TPtrC cacerts; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3793 |
TPtrC ciphersuites; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3794 |
TPtrC maxSessionTime; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3795 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3796 |
#ifdef USE_FAST_EAP_TYPE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3797 |
TPtrC fastSpecialSettings; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3798 |
#endif |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3799 |
|
26 | 3800 |
if (aEapType == eap_type_tls) |
3801 |
{ |
|
3802 |
settings.Set(KTlsDatabaseTableName); |
|
3803 |
usercerts.Set(KTlsAllowedUserCertsDatabaseTableName); |
|
3804 |
cacerts.Set(KTlsAllowedCACertsDatabaseTableName); |
|
3805 |
ciphersuites.Set(KTlsAllowedCipherSuitesDatabaseTableName); |
|
3806 |
maxSessionTime.Set(cf_str_EAP_TLS_max_session_validity_time_literal); |
|
3807 |
} |
|
3808 |
else if (aEapType == eap_type_peap) |
|
3809 |
{ |
|
3810 |
settings.Set(KPeapDatabaseTableName); |
|
3811 |
usercerts.Set(KPeapAllowedUserCertsDatabaseTableName); |
|
3812 |
cacerts.Set(KPeapAllowedCACertsDatabaseTableName); |
|
3813 |
ciphersuites.Set(KPeapAllowedCipherSuitesDatabaseTableName); |
|
3814 |
maxSessionTime.Set(cf_str_EAP_PEAP_max_session_validity_time_literal); |
|
3815 |
} |
|
3816 |
else if (aEapType == eap_type_ttls) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3817 |
{ |
26 | 3818 |
settings.Set(KTtlsDatabaseTableName); |
3819 |
usercerts.Set(KTtlsAllowedUserCertsDatabaseTableName); |
|
3820 |
cacerts.Set(KTtlsAllowedCACertsDatabaseTableName); |
|
3821 |
ciphersuites.Set(KTtlsAllowedCipherSuitesDatabaseTableName); |
|
3822 |
maxSessionTime.Set(cf_str_EAP_TTLS_max_session_validity_time_literal); |
|
3823 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3824 |
#ifdef USE_FAST_EAP_TYPE |
26 | 3825 |
else if (aEapType == eap_type_fast) |
3826 |
{ |
|
3827 |
settings.Set(KFastGeneralSettingsDBTableName); // This is general settings for FAST. |
|
3828 |
fastSpecialSettings.Set(KFastSpecialSettingsDBTableName); |
|
3829 |
||
3830 |
usercerts.Set(KFastAllowedUserCertsDatabaseTableName); |
|
3831 |
cacerts.Set(KFastAllowedCACertsDatabaseTableName); |
|
3832 |
ciphersuites.Set(KFastAllowedCipherSuitesDatabaseTableName); |
|
3833 |
maxSessionTime.Set(cf_str_EAP_FAST_max_session_validity_time_literal); |
|
3834 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3835 |
#endif |
36 | 3836 |
else if (aEapType == eap_expanded_type_ttls_plain_pap.get_type()) |
26 | 3837 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3838 |
settings.Set( KTtlsDatabaseTableName ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3839 |
maxSessionTime.Set( cf_str_EAP_TLS_PEAP_ttls_pap_max_session_validity_time_literal ); |
26 | 3840 |
} |
3841 |
else |
|
3842 |
{ |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3843 |
// Should never happen |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3844 |
User::Leave(KErrArgument); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3845 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3846 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3847 |
RDbView view; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3848 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3849 |
// Form the query |
26 | 3850 |
_LIT(KSQL, "SELECT * FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3851 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3852 |
////////////////////////////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3853 |
// This is for settings for all EAP types. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3854 |
// For EAP-FAST it is General settings. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3855 |
////////////////////////////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3856 |
|
26 | 3857 |
sqlStatement.Format(KSQL, |
3858 |
&settings, |
|
3859 |
&KServiceType, |
|
3860 |
aIndexType, |
|
3861 |
&KServiceIndex, |
|
3862 |
aIndex, |
|
3863 |
&KTunnelingTypeVendorId, |
|
3864 |
aTunnelingType.get_vendor_id(), |
|
3865 |
&KTunnelingType, |
|
3866 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3867 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3868 |
// Evaluate view |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3869 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3870 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3871 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3872 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3873 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3874 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3875 |
// Get the first (and only) row |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3876 |
view.FirstL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3877 |
view.GetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3878 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3879 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3880 |
CDbColSet* colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3881 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3882 |
|
26 | 3883 |
aSettings.iEAPExpandedType.SetValue( |
3884 |
aEapType.get_vendor_id(), |
|
3885 |
aEapType.get_vendor_type()); |
|
3886 |
||
3887 |
EAP_TRACE_DATA_DEBUG_SYMBIAN( |
|
3888 |
(EAPL("EapTlsPeapUtils::GetConfigurationL(): aSettings.iEAPExpandedType"), |
|
3889 |
aSettings.iEAPExpandedType.GetValue().Ptr(), |
|
3890 |
aSettings.iEAPExpandedType.GetValue().Length())); |
|
3891 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3892 |
////////////////////////////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3893 |
// This is only for plain PAP settings. // |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3894 |
////////////////////////////////////////// |
36 | 3895 |
if ( aEapType == eap_expanded_type_ttls_plain_pap.get_type() ) |
26 | 3896 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3897 |
// Username |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3898 |
TPtrC username = view.ColDes( colSet->ColNo( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3899 |
cf_str_EAP_TLS_PEAP_ttls_pap_username_literal ) ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3900 |
aSettings.iUsername.Copy( username ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3901 |
aSettings.iUsernamePresent = ETrue; |
26 | 3902 |
|
3903 |
// Password existence. |
|
3904 |
aSettings.iPasswordExistPresent = ETrue; |
|
3905 |
aSettings.iPasswordExist = ! view.IsColNull(colSet->ColNo(cf_str_EAP_TLS_PEAP_ttls_pap_password_literal)); |
|
3906 |
||
34 | 3907 |
aSettings.iShowPassWordPromptPresent = ETrue; |
3908 |
||
3909 |
TUint aShow = view.ColUint( colSet->ColNo( cf_str_EAP_TLS_PEAP_ttls_pap_password_prompt_literal ) ); |
|
3910 |
if ( aShow == EPapPasswordPromptOn) |
|
3911 |
{ |
|
3912 |
aSettings.iShowPassWordPrompt = ETrue; |
|
3913 |
} |
|
3914 |
else |
|
3915 |
{ |
|
3916 |
aSettings.iShowPassWordPrompt = EFalse; |
|
3917 |
} |
|
3918 |
||
26 | 3919 |
#if defined(USE_EAP_PASSWORD_READ_FROM_DATABASE) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3920 |
// Password |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3921 |
TPtrC password = view.ColDes( colSet->ColNo( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3922 |
cf_str_EAP_TLS_PEAP_ttls_pap_password_literal ) ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3923 |
aSettings.iPassword.Copy( password ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3924 |
aSettings.iPasswordPresent = ETrue; |
26 | 3925 |
#else |
3926 |
EAP_TRACE_DEBUG_SYMBIAN((_L("WARNING: EapTlsPeapUtils::GetConfigurationL(): Password read is disabled\n"))); |
|
3927 |
#endif //#if defined(USE_EAP_PASSWORD_READ_FROM_DATABASE) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3928 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3929 |
// Session validity time |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3930 |
TInt64 maxSessionTimeMicro = view.ColInt64( colSet->ColNo( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3931 |
cf_str_EAP_TLS_PEAP_ttls_pap_max_session_validity_time_literal ) ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3932 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3933 |
// Convert the time to minutes. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3934 |
TInt64 maxSessionTimeMin = maxSessionTimeMicro / KMicroSecsInAMinute; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3935 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3936 |
aSettings.iSessionValidityTime = static_cast<TUint>( maxSessionTimeMin ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3937 |
aSettings.iSessionValidityTimePresent = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3938 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3939 |
CleanupStack::PopAndDestroy(3); // view, colset, buf |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3940 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3941 |
return; |
26 | 3942 |
} |
3943 |
||
3944 |
||
3945 |
{ |
|
3946 |
// For manual or automatic CA-certificate. |
|
3947 |
TUint useAutomaticCACertificate = view.ColUint(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_automatic_ca_certificate_literal)); |
|
3948 |
||
3949 |
aSettings.iUseAutomaticCACertificatePresent = ETrue; |
|
3950 |
||
3951 |
if(useAutomaticCACertificate == EEapDbTrue) |
|
3952 |
{ |
|
3953 |
aSettings.iUseAutomaticCACertificate = ETrue; |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3954 |
} |
26 | 3955 |
else |
3956 |
{ |
|
3957 |
aSettings.iUseAutomaticCACertificate = EFalse; |
|
3958 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3959 |
} |
26 | 3960 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3961 |
{ |
26 | 3962 |
// For manual or automatic username. |
3963 |
TUint useUsername = view.ColUint(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_username_literal)); |
|
3964 |
||
3965 |
aSettings.iUseAutomaticUsernamePresent = ETrue; |
|
3966 |
||
3967 |
if(useUsername == EEapDbTrue) |
|
3968 |
{ |
|
3969 |
aSettings.iUseAutomaticUsername = EFalse; |
|
3970 |
} |
|
3971 |
else |
|
3972 |
{ |
|
3973 |
aSettings.iUseAutomaticUsername = ETrue; |
|
3974 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3975 |
} |
26 | 3976 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3977 |
{ |
26 | 3978 |
// For manual or automatic realm. |
3979 |
TUint useRealm = view.ColUint(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_manual_realm_literal)); |
|
3980 |
||
3981 |
aSettings.iUseAutomaticRealmPresent = ETrue; |
|
3982 |
||
3983 |
if(useRealm == EEapDbTrue) |
|
3984 |
{ |
|
3985 |
aSettings.iUseAutomaticRealm = EFalse; |
|
3986 |
} |
|
3987 |
else |
|
3988 |
{ |
|
3989 |
aSettings.iUseAutomaticRealm = ETrue; |
|
3990 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3991 |
} |
26 | 3992 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3993 |
{ |
26 | 3994 |
// Username |
3995 |
TPtrC username = view.ColDes(colSet->ColNo(cf_str_EAP_TLS_PEAP_manual_username_literal)); |
|
3996 |
||
3997 |
aSettings.iUsernamePresent = ETrue; |
|
3998 |
||
3999 |
aSettings.iUsername.Copy(username); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4000 |
} |
26 | 4001 |
|
4002 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::GetConfigurationL(): Settings.iUsername=%S \n"), &(aSettings.iUsername) ) ); |
|
4003 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4004 |
{ |
26 | 4005 |
// Realm |
4006 |
TPtrC realm = view.ColDes(colSet->ColNo(cf_str_EAP_TLS_PEAP_manual_realm_literal)); |
|
4007 |
||
4008 |
aSettings.iRealmPresent = ETrue; |
|
4009 |
||
4010 |
aSettings.iRealm.Copy(realm); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4011 |
} |
26 | 4012 |
|
4013 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::GetConfigurationL(): aSettings.iRealm=%S \n"),&(aSettings.iRealm)) ); |
|
4014 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4015 |
{ |
26 | 4016 |
// Verify server realm |
4017 |
TInt verifyrealm = view.ColUint(colSet->ColNo(cf_str_EAP_TLS_PEAP_verify_certificate_realm_literal)); |
|
4018 |
if (verifyrealm == 0) |
|
4019 |
{ |
|
4020 |
aSettings.iVerifyServerRealm = EFalse; |
|
4021 |
} |
|
4022 |
else |
|
4023 |
{ |
|
4024 |
aSettings.iVerifyServerRealm = ETrue; |
|
4025 |
} |
|
4026 |
aSettings.iVerifyServerRealmPresent = ETrue; |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4027 |
} |
26 | 4028 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4029 |
{ |
26 | 4030 |
// Require client authentication |
4031 |
TInt requireclientauth = view.ColUint(colSet->ColNo(cf_str_TLS_server_authenticates_client_policy_in_client_literal)); |
|
4032 |
if (requireclientauth == 0) |
|
4033 |
{ |
|
4034 |
aSettings.iRequireClientAuthentication = EFalse; |
|
4035 |
} |
|
4036 |
else |
|
4037 |
{ |
|
4038 |
aSettings.iRequireClientAuthentication = ETrue; |
|
4039 |
} |
|
4040 |
aSettings.iRequireClientAuthenticationPresent = ETrue; |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4041 |
} |
26 | 4042 |
|
4043 |
{ |
|
4044 |
// Session validity time |
|
4045 |
TInt64 maxSessionTimeMicro = view.ColInt64(colSet->ColNo(maxSessionTime)); |
|
4046 |
||
4047 |
// Convert the time to minutes. |
|
4048 |
TInt64 maxSessionTimeMin = maxSessionTimeMicro / KMicroSecsInAMinute; |
|
4049 |
||
4050 |
aSettings.iSessionValidityTime = static_cast<TUint>(maxSessionTimeMin); |
|
4051 |
aSettings.iSessionValidityTimePresent = ETrue; |
|
4052 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4053 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4054 |
// PEAP versions |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4055 |
if (aEapType == eap_type_peap |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4056 |
|| aEapType == eap_type_ttls |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4057 |
#ifdef USE_FAST_EAP_TYPE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4058 |
|| aEapType == eap_type_fast |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4059 |
#endif |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4060 |
) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4061 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4062 |
TPtrC8 binaryValue = view.ColDes8(colSet->ColNo(cf_str_EAP_TLS_PEAP_accepted_PEAP_versions_literal)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4063 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4064 |
const TInt* allowedVersions = reinterpret_cast<const TInt *>(binaryValue.Ptr()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4065 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4066 |
TInt i; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4067 |
for (i = 0; i < static_cast<TInt>(binaryValue.Length() / sizeof(TInt)); i++) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4068 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4069 |
switch(allowedVersions[i]) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4070 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4071 |
case 0: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4072 |
aSettings.iPEAPv0Allowed = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4073 |
break; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4074 |
case 1: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4075 |
aSettings.iPEAPv1Allowed = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4076 |
break; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4077 |
case 2: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4078 |
aSettings.iPEAPv2Allowed = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4079 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4080 |
break; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4081 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4082 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4083 |
aSettings.iPEAPVersionsPresent = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4084 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4085 |
|
26 | 4086 |
{ |
4087 |
// Require client authentication |
|
4088 |
TInt UseIdentityPrivacy = view.ColUint(colSet->ColNo(cf_str_EAP_TLS_PEAP_use_identity_privacy_literal)); |
|
4089 |
if (UseIdentityPrivacy == 0) |
|
4090 |
{ |
|
4091 |
aSettings.iUseIdentityPrivacy = EFalse; |
|
4092 |
} |
|
4093 |
else |
|
4094 |
{ |
|
4095 |
aSettings.iUseIdentityPrivacy = ETrue; |
|
4096 |
} |
|
4097 |
aSettings.iUseIdentityPrivacyPresent = ETrue; |
|
4098 |
} |
|
4099 |
||
4100 |
CleanupStack::PopAndDestroy(colSet); |
|
4101 |
CleanupStack::PopAndDestroy(&view); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4102 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4103 |
#ifdef USE_FAST_EAP_TYPE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4104 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4105 |
/////////////////////////////////////////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4106 |
// This is only for EAP-FAST specific, Special settings. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4107 |
/////////////////////////////////////////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4108 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4109 |
if(aEapType == eap_type_fast) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4110 |
{ |
26 | 4111 |
sqlStatement.Format(KSQL, |
4112 |
&fastSpecialSettings, |
|
4113 |
&KServiceType, |
|
4114 |
aIndexType, |
|
4115 |
&KServiceIndex, |
|
4116 |
aIndex, |
|
4117 |
&KTunnelingTypeVendorId, |
|
4118 |
aTunnelingType.get_vendor_id(), |
|
4119 |
&KTunnelingType, |
|
4120 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4121 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4122 |
// Evaluate view |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4123 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4124 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4125 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4126 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4127 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4128 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4129 |
// Get the first (and only) row |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4130 |
view.FirstL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4131 |
view.GetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4132 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4133 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4134 |
CDbColSet* colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4135 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4136 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4137 |
// For provisioning modes. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4138 |
TUint authProvMode = view.ColUint(colSet->ColNo(cf_str_EAP_FAST_allow_server_authenticated_provisioning_mode_literal)); |
26 | 4139 |
if(authProvMode == EEapDbFalse) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4140 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4141 |
aSettings.iAuthProvModeAllowed = EFalse; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4142 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4143 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4144 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4145 |
aSettings.iAuthProvModeAllowed = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4146 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4147 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4148 |
aSettings.iAuthProvModeAllowedPresent = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4149 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4150 |
TUint unauthProvMode = view.ColUint(colSet->ColNo(cf_str_EAP_FAST_allow_server_unauthenticated_provisioning_mode_ADHP_literal)); |
26 | 4151 |
if(unauthProvMode == EEapDbFalse) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4152 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4153 |
aSettings.iUnauthProvModeAllowed = EFalse; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4154 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4155 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4156 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4157 |
aSettings.iUnauthProvModeAllowed = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4158 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4159 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4160 |
aSettings.iUnauthProvModeAllowedPresent = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4161 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4162 |
// For no PAC warning |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4163 |
TUint warn = view.ColUint(colSet->ColNo(KFASTWarnADHPNoPAC)); |
26 | 4164 |
if(warn == EEapDbFalse) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4165 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4166 |
aSettings.iWarnADHPNoPAC = EFalse; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4167 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4168 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4169 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4170 |
aSettings.iWarnADHPNoPAC = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4171 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4172 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4173 |
aSettings.iWarnADHPNoPACPresent = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4174 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4175 |
// For no matching PAC warning |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4176 |
warn = view.ColUint(colSet->ColNo(KFASTWarnADHPNoMatchingPAC)); |
26 | 4177 |
if(warn == EEapDbFalse) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4178 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4179 |
aSettings.iWarnADHPNoMatchingPAC = EFalse; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4180 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4181 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4182 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4183 |
aSettings.iWarnADHPNoMatchingPAC = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4184 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4185 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4186 |
aSettings.iWarnADHPNoMatchingPACPresent = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4187 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4188 |
// For no default server warning |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4189 |
warn = view.ColUint(colSet->ColNo(KFASTWarnNotDefaultServer)); |
26 | 4190 |
if(warn == EEapDbFalse) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4191 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4192 |
aSettings.iWarnNotDefaultServer = EFalse; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4193 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4194 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4195 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4196 |
aSettings.iWarnNotDefaultServer = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4197 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4198 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4199 |
aSettings.iWarnNotDefaultServerPresent = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4200 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4201 |
// For PAC group reference. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4202 |
TPtrC pacGroupRef = view.ColDes(colSet->ColNo(KFASTPACGroupImportReferenceCollection)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4203 |
if(pacGroupRef.Length()) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4204 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4205 |
aSettings.iPACGroupReference.Copy(pacGroupRef); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4206 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4207 |
aSettings.iPACGroupReferencePresent = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4208 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4209 |
|
26 | 4210 |
CleanupStack::PopAndDestroy(colSet); |
4211 |
CleanupStack::PopAndDestroy(&view); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4212 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4213 |
} // End: if(aEapType == eap_type_fast) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4214 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4215 |
#endif //#ifdef USE_FAST_EAP_TYPE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4216 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4217 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4218 |
////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4219 |
// Cipher suites |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4220 |
////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4221 |
|
26 | 4222 |
sqlStatement.Format(KSQL, |
4223 |
&ciphersuites, |
|
4224 |
&KServiceType, |
|
4225 |
aIndexType, |
|
4226 |
&KServiceIndex, |
|
4227 |
aIndex, |
|
4228 |
&KTunnelingTypeVendorId, |
|
4229 |
aTunnelingType.get_vendor_id(), |
|
4230 |
&KTunnelingType, |
|
4231 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4232 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4233 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4234 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4235 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4236 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4237 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4238 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4239 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4240 |
colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4241 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4242 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4243 |
if (view.FirstL()) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4244 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4245 |
do { |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4246 |
view.GetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4247 |
{ |
36 | 4248 |
aSettings.iCipherSuites.AppendL(view.ColUint(colSet->ColNo(KCipherSuite))); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4249 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4250 |
} while (view.NextL() != EFalse); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4251 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4252 |
|
26 | 4253 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::GetConfigurationL(): Total cipher suites appended=%d \n"), aSettings.iCipherSuites.Count()) ); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4254 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4255 |
aSettings.iCipherSuitesPresent = ETrue; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4256 |
|
26 | 4257 |
CleanupStack::PopAndDestroy(colSet); |
4258 |
CleanupStack::PopAndDestroy(&view); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4259 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4260 |
///////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4261 |
// User Certificates |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4262 |
///////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4263 |
|
26 | 4264 |
sqlStatement.Format(KSQL, |
4265 |
&usercerts, |
|
4266 |
&KServiceType, |
|
4267 |
aIndexType, |
|
4268 |
&KServiceIndex, |
|
4269 |
aIndex, |
|
4270 |
&KTunnelingTypeVendorId, |
|
4271 |
aTunnelingType.get_vendor_id(), |
|
4272 |
&KTunnelingType, |
|
4273 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4274 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4275 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4276 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4277 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4278 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4279 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4280 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4281 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4282 |
colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4283 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4284 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4285 |
if (view.FirstL()) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4286 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4287 |
do { |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4288 |
view.GetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4289 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4290 |
// This is big object. |
26 | 4291 |
EapCertificateEntry * certEntry = new (ELeave) EapCertificateEntry; |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4292 |
CleanupStack::PushL(certEntry); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4293 |
|
26 | 4294 |
certEntry->SetCertType(EapCertificateEntry::EUser); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4295 |
|
26 | 4296 |
certEntry->GetSubjectNameWritable()->Copy(view.ColDes(colSet->ColNo(KSubjectName))); |
4297 |
if(certEntry->GetSubjectName()->Length()) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4298 |
{ |
26 | 4299 |
certEntry->SetSubjectNamePresent(); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4300 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4301 |
|
26 | 4302 |
certEntry->GetIssuerNameWritable()->Copy(view.ColDes(colSet->ColNo(KIssuerName))); |
4303 |
if(certEntry->GetIssuerName()->Length()) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4304 |
{ |
26 | 4305 |
certEntry->SetIssuerNamePresent(); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4306 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4307 |
|
26 | 4308 |
certEntry->GetSerialNumberWritable()->Copy(view.ColDes(colSet->ColNo(KSerialNumber))); |
4309 |
if(certEntry->GetSerialNumber()->Length()) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4310 |
{ |
26 | 4311 |
certEntry->SetSerialNumberPresent(); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4312 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4313 |
|
26 | 4314 |
certEntry->GetSubjectKeyIdWritable()->Copy(view.ColDes8(colSet->ColNo(KActualSubjectKeyIdentifier))); // This is the subjectkey id we got in SetConfigurationL |
4315 |
if(certEntry->GetSubjectKeyId().Length()) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4316 |
{ |
26 | 4317 |
certEntry->SetSubjectKeyIdPresent(); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4318 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4319 |
|
26 | 4320 |
certEntry->GetThumbprintWritable()->Copy(view.ColDes8(colSet->ColNo(KThumbprint))); |
4321 |
if(certEntry->GetThumbprint()->Length()) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4322 |
{ |
26 | 4323 |
certEntry->SetThumbprintPresent(); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4324 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4325 |
|
26 | 4326 |
certEntry->SetIsEnabledPresent(); |
4327 |
certEntry->SetIsEnabled(ETrue); |
|
4328 |
||
4329 |
aSettings.iCertificates.AppendL(certEntry); |
|
4330 |
aSettings.iCertificatesPresent = ETrue; |
|
4331 |
||
4332 |
EAP_TRACE_DATA_DEBUG_SYMBIAN( ( "EapTlsPeapUtils::GetConfigurationL(): Filling User cert entry, SubjectKeyID:", |
|
4333 |
certEntry->GetSubjectKeyId().Ptr(), |
|
4334 |
certEntry->GetSubjectKeyId().Length() ) ); |
|
4335 |
||
4336 |
CleanupStack::Pop(certEntry); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4337 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4338 |
} while (view.NextL() != EFalse); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4339 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4340 |
|
26 | 4341 |
CleanupStack::PopAndDestroy(colSet); |
4342 |
CleanupStack::PopAndDestroy(&view); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4343 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4344 |
///////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4345 |
// CA Certificates |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4346 |
///////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4347 |
|
26 | 4348 |
sqlStatement.Format(KSQL, |
4349 |
&cacerts, |
|
4350 |
&KServiceType, |
|
4351 |
aIndexType, |
|
4352 |
&KServiceIndex, |
|
4353 |
aIndex, |
|
4354 |
&KTunnelingTypeVendorId, |
|
4355 |
aTunnelingType.get_vendor_id(), |
|
4356 |
&KTunnelingType, |
|
4357 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4358 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4359 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4360 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4361 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4362 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4363 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4364 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4365 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4366 |
colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4367 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4368 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4369 |
if (view.FirstL()) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4370 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4371 |
do { |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4372 |
view.GetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4373 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4374 |
// This is big object. |
26 | 4375 |
EapCertificateEntry * certEntry = new (ELeave) EapCertificateEntry; |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4376 |
CleanupStack::PushL(certEntry); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4377 |
|
26 | 4378 |
certEntry->SetCertType(EapCertificateEntry::ECA); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4379 |
|
26 | 4380 |
certEntry->GetSubjectNameWritable()->Copy(view.ColDes(colSet->ColNo(KSubjectName))); |
4381 |
if(certEntry->GetSubjectName()->Length()) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4382 |
{ |
26 | 4383 |
certEntry->SetSubjectNamePresent(); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4384 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4385 |
|
26 | 4386 |
certEntry->GetIssuerNameWritable()->Copy(view.ColDes(colSet->ColNo(KIssuerName))); |
4387 |
if(certEntry->GetIssuerName()->Length()) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4388 |
{ |
26 | 4389 |
certEntry->SetIssuerNamePresent(); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4390 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4391 |
|
26 | 4392 |
certEntry->GetSerialNumberWritable()->Copy(view.ColDes(colSet->ColNo(KSerialNumber))); |
4393 |
if(certEntry->GetSerialNumber()->Length()) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4394 |
{ |
26 | 4395 |
certEntry->SetSerialNumberPresent(); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4396 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4397 |
|
26 | 4398 |
certEntry->GetSubjectKeyIdWritable()->Copy(view.ColDes8(colSet->ColNo(KActualSubjectKeyIdentifier))); // This is the subjectkey id we got in SetConfigurationL |
4399 |
if(certEntry->GetSubjectKeyId().Length()) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4400 |
{ |
26 | 4401 |
certEntry->SetSubjectKeyIdPresent(); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4402 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4403 |
|
26 | 4404 |
certEntry->GetThumbprintWritable()->Copy(view.ColDes8(colSet->ColNo(KThumbprint))); |
4405 |
if(certEntry->GetThumbprint()->Length()) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4406 |
{ |
26 | 4407 |
certEntry->SetThumbprintPresent(); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4408 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4409 |
|
26 | 4410 |
certEntry->SetIsEnabledPresent(); |
4411 |
certEntry->SetIsEnabled(ETrue); |
|
4412 |
||
4413 |
aSettings.iCertificates.AppendL(certEntry); |
|
4414 |
aSettings.iCertificatesPresent = ETrue; |
|
4415 |
||
4416 |
EAP_TRACE_DATA_DEBUG_SYMBIAN( ( "EapTlsPeapUtils::GetConfigurationL(): Filling CA cert entry, SubjectKeyID:", |
|
4417 |
certEntry->GetSubjectKeyId().Ptr(), |
|
4418 |
certEntry->GetSubjectKeyId().Length() ) ); |
|
4419 |
||
4420 |
EAP_TRACE_SETTINGS(certEntry); |
|
4421 |
||
4422 |
CleanupStack::Pop(certEntry); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4423 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4424 |
} while (view.NextL() != EFalse); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4425 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4426 |
|
26 | 4427 |
CleanupStack::PopAndDestroy(colSet); |
4428 |
CleanupStack::PopAndDestroy(&view); |
|
4429 |
CleanupStack::PopAndDestroy(buf); |
|
4430 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4431 |
////////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4432 |
// Encapsulated types |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4433 |
////////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4434 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4435 |
// Encapsulated types are only for EAP-PEAP, EAP-TTLS and EAP-FAST. Not for EAP-TLS. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4436 |
if ( aEapType != eap_type_peap |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4437 |
&& aEapType != eap_type_ttls |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4438 |
#ifdef USE_FAST_EAP_TYPE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4439 |
&& aEapType != eap_type_fast |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4440 |
#endif |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4441 |
) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4442 |
{ |
26 | 4443 |
aSettings.iEnabledEncapsulatedEAPExpandedTypesPresent = EFalse; |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4444 |
|
26 | 4445 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::GetConfigurationL(): End - Since no encapsulated type for the EAP-type=0xfe%06x%08x\n"), |
4446 |
aEapType.get_vendor_id(), |
|
4447 |
aEapType.get_vendor_type())); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4448 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4449 |
return; // No need to proceed. Nothing more to provide. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4450 |
} |
26 | 4451 |
|
4452 |
RPointerArray<TEapExpandedType> enabledEAPTypes; |
|
4453 |
RPointerArray<TEapExpandedType> disabledEAPTypes; |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4454 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4455 |
TRAPD(error, GetTunnelingExpandedEapDataL( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4456 |
aDatabase, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4457 |
0, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4458 |
enabledEAPTypes, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4459 |
disabledEAPTypes, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4460 |
aIndexType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4461 |
aIndex, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4462 |
aTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4463 |
aEapType)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4464 |
|
26 | 4465 |
if( error != KErrNone ) |
4466 |
{ |
|
4467 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::GetConfigurationL(): ########### Getting Expanded Tunneling types from the DB failed ############ \n") ) ); |
|
4468 |
||
4469 |
enabledEAPTypes.ResetAndDestroy(); |
|
4470 |
disabledEAPTypes.ResetAndDestroy(); |
|
4471 |
enabledEAPTypes.Close(); |
|
4472 |
disabledEAPTypes.Close(); |
|
4473 |
||
4474 |
User::Leave(KErrGeneral); |
|
4475 |
} |
|
4476 |
||
4477 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4478 |
{ |
26 | 4479 |
RPointerArray<TEapExpandedType> aPlugins; |
4480 |
||
4481 |
// This works if we do not leave from the block. |
|
4482 |
PointerArrayResetAndDestroy<TEapExpandedType> aAutomaticPlugins(&aPlugins, EFalse); |
|
4483 |
||
4484 |
EapPluginTools aPluginTool; |
|
4485 |
||
4486 |
TEapExpandedType aSymbTunnelingType; |
|
4487 |
||
4488 |
error = CEapConversion::ConvertInternalTypeToExpandedEAPType( |
|
4489 |
&aEapType, |
|
4490 |
&aSymbTunnelingType); |
|
4491 |
||
4492 |
if (error == KErrNone) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4493 |
{ |
34 | 4494 |
TRAP(error, (aPluginTool.ListAllEapPluginsL(aIndexType, aSymbTunnelingType, aPlugins))); |
26 | 4495 |
if (error != KErrNone) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4496 |
{ |
26 | 4497 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::GetConfigurationL(): aPluginTool.ListAllEapPluginsL() failed, EAP-type=0xfe%06x%08x, index_type=%d, index=%d, error=%d.\n"), |
4498 |
aEapType.get_vendor_id(), |
|
4499 |
aEapType.get_vendor_type(), |
|
4500 |
aIndexType, |
|
4501 |
aIndex, |
|
4502 |
error)); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4503 |
} |
26 | 4504 |
} |
4505 |
||
4506 |
EAP_TRACE_DEBUG_SYMBIAN( |
|
4507 |
(_L("EapTlsPeapUtils::GetConfigurationL(): ListImplementationsL(): No: of available EAP plugin implementations=%d, enabledEAPTypes.Count()=%d, disabledEAPTypes.Count()=%d\n"), |
|
4508 |
aPlugins.Count(), |
|
4509 |
enabledEAPTypes.Count(), |
|
4510 |
disabledEAPTypes.Count())); |
|
4511 |
||
4512 |
if (error == KErrNone) |
|
4513 |
{ |
|
4514 |
// Filter out unimplemented enabled EAP-methods. |
|
4515 |
error = FilterEapMethods( |
|
4516 |
&enabledEAPTypes, |
|
4517 |
&aPlugins); |
|
4518 |
} |
|
4519 |
||
4520 |
if (error == KErrNone) |
|
4521 |
{ |
|
4522 |
// Filter out unimplemented disabled EAP-methods. |
|
4523 |
error = FilterEapMethods( |
|
4524 |
&disabledEAPTypes, |
|
4525 |
&aPlugins); |
|
4526 |
} |
|
4527 |
||
4528 |
if (error == KErrNone) |
|
4529 |
{ |
|
4530 |
// Add rest of the implemented EAP-methods to array of disabled EAP-methods. |
|
4531 |
EAP_TRACE_DEBUG_SYMBIAN( |
|
4532 |
(_L("EapTlsPeapUtils::GetConfigurationL(): ListImplementationsL(): Before adding disabled, No: of available EAP plugin implementations=%d, enabledEAPTypes.Count()=%d, disabledEAPTypes.Count()=%d\n"), |
|
4533 |
aPlugins.Count(), |
|
4534 |
enabledEAPTypes.Count(), |
|
4535 |
disabledEAPTypes.Count())); |
|
4536 |
||
4537 |
for (TInt plugin_ind = 0; plugin_ind < aPlugins.Count(); ++plugin_ind) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4538 |
{ |
26 | 4539 |
const TEapExpandedType * const plugin_type = aPlugins[plugin_ind]; |
4540 |
if (plugin_type == 0) |
|
4541 |
{ |
|
4542 |
error = KErrNoMemory; |
|
4543 |
break; |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4544 |
} |
26 | 4545 |
|
4546 |
TEapExpandedType * const disabled_eap_type = new TEapExpandedType; |
|
4547 |
if (disabled_eap_type != 0) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4548 |
{ |
26 | 4549 |
*disabled_eap_type = *plugin_type; |
4550 |
||
4551 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::GetConfigurationL(): Adds disabled EAP-type=0xfe%06x%08x\n"), |
|
4552 |
disabled_eap_type->GetVendorId(), |
|
4553 |
disabled_eap_type->GetVendorType())); |
|
4554 |
||
4555 |
error = disabledEAPTypes.Append( disabled_eap_type ); |
|
4556 |
if (error != KErrNone) |
|
4557 |
{ |
|
4558 |
break; |
|
4559 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4560 |
} |
26 | 4561 |
} // for() |
4562 |
||
4563 |
} |
|
4564 |
||
4565 |
EAP_TRACE_DEBUG_SYMBIAN( |
|
4566 |
(_L("EapTlsPeapUtils::GetConfigurationL(): ListImplementationsL(): After adding disabled, No: of available EAP plugin implementations=%d, enabledEAPTypes.Count()=%d, disabledEAPTypes.Count()=%d\n"), |
|
4567 |
aPlugins.Count(), |
|
4568 |
enabledEAPTypes.Count(), |
|
4569 |
disabledEAPTypes.Count())); |
|
4570 |
||
4571 |
} |
|
4572 |
||
4573 |
// This leave must be outside the previous block. |
|
4574 |
User::LeaveIfError(error); |
|
4575 |
||
4576 |
||
4577 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::GetConfigurationL(): No: of available tunneled types for this EAP=%d \n"), |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4578 |
enabledEAPTypes.Count())); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4579 |
|
26 | 4580 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::GetConfigurationL(): No: of disabled tunneled types for this EAP=%d \n"), |
4581 |
disabledEAPTypes.Count())); |
|
4582 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4583 |
// enabledEAPTypes contains the EAP types now (expanded). |
26 | 4584 |
// Fill aSettings.iEnabledEncapsulatedEAPExpandedTypes here. |
4585 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4586 |
{ |
26 | 4587 |
TEapExpandedType EapType; |
4588 |
||
4589 |
for (TInt i = 0; i < enabledEAPTypes.Count(); i++) |
|
4590 |
{ |
|
4591 |
error = EapType.SetValue( |
|
4592 |
enabledEAPTypes[i]->GetValue().Ptr(), |
|
4593 |
enabledEAPTypes[i]->GetValue().Length()); |
|
4594 |
if (error != KErrNone) |
|
4595 |
{ |
|
4596 |
enabledEAPTypes.ResetAndDestroy(); |
|
4597 |
disabledEAPTypes.ResetAndDestroy(); |
|
4598 |
enabledEAPTypes.Close(); |
|
4599 |
disabledEAPTypes.Close(); |
|
4600 |
||
4601 |
User::Leave(KErrNoMemory); |
|
4602 |
} |
|
4603 |
||
4604 |
error = aSettings.iEnabledEncapsulatedEAPExpandedTypes.Append(EapType); |
|
4605 |
if (error != KErrNone) |
|
4606 |
{ |
|
4607 |
enabledEAPTypes.ResetAndDestroy(); |
|
4608 |
disabledEAPTypes.ResetAndDestroy(); |
|
4609 |
enabledEAPTypes.Close(); |
|
4610 |
disabledEAPTypes.Close(); |
|
4611 |
||
4612 |
User::Leave(KErrNoMemory); |
|
4613 |
} |
|
4614 |
||
4615 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::GetConfigurationL(): enabled EAP-type=0xfe%06x%08x\n"), |
|
4616 |
EapType.GetVendorId(), |
|
4617 |
EapType.GetVendorType())); |
|
4618 |
} |
|
4619 |
||
4620 |
EAP_TRACE_DEBUG_SYMBIAN( |
|
4621 |
(_L("EapTlsPeapUtils::GetConfigurationL(): aSettings.iEnabledEncapsulatedEAPExpandedTypes.Count()=%d \n"), |
|
4622 |
aSettings.iEnabledEncapsulatedEAPExpandedTypes.Count())); |
|
4623 |
||
4624 |
aSettings.iEnabledEncapsulatedEAPExpandedTypesPresent = ETrue; |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4625 |
|
26 | 4626 |
} |
4627 |
||
4628 |
{ |
|
4629 |
TEapExpandedType EapType; |
|
4630 |
||
4631 |
for (TInt i = 0; i < disabledEAPTypes.Count(); i++) |
|
4632 |
{ |
|
4633 |
error = EapType.SetValue( |
|
4634 |
disabledEAPTypes[i]->GetValue().Ptr(), |
|
4635 |
disabledEAPTypes[i]->GetValue().Length()); |
|
4636 |
if (error != KErrNone) |
|
4637 |
{ |
|
4638 |
enabledEAPTypes.ResetAndDestroy(); |
|
4639 |
disabledEAPTypes.ResetAndDestroy(); |
|
4640 |
enabledEAPTypes.Close(); |
|
4641 |
disabledEAPTypes.Close(); |
|
4642 |
||
4643 |
User::Leave(KErrNoMemory); |
|
4644 |
} |
|
4645 |
||
4646 |
error = aSettings.iDisabledEncapsulatedEAPExpandedTypes.Append(EapType); |
|
4647 |
if (error != KErrNone) |
|
4648 |
{ |
|
4649 |
enabledEAPTypes.ResetAndDestroy(); |
|
4650 |
disabledEAPTypes.ResetAndDestroy(); |
|
4651 |
enabledEAPTypes.Close(); |
|
4652 |
disabledEAPTypes.Close(); |
|
4653 |
||
4654 |
User::Leave(KErrNoMemory); |
|
4655 |
} |
|
4656 |
||
4657 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::GetConfigurationL(): disabled EAP-type=0xfe%06x%08x\n"), |
|
4658 |
EapType.GetVendorId(), |
|
4659 |
EapType.GetVendorType())); |
|
4660 |
} |
|
4661 |
||
4662 |
EAP_TRACE_DEBUG_SYMBIAN( |
|
4663 |
(_L("EapTlsPeapUtils::GetConfigurationL(): aSettings.iDisabledEncapsulatedEAPExpandedTypes.Count()=%d \n"), |
|
4664 |
aSettings.iDisabledEncapsulatedEAPExpandedTypes.Count())); |
|
4665 |
||
4666 |
aSettings.iDisabledEncapsulatedEAPExpandedTypesPresent = ETrue; |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4667 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4668 |
} |
26 | 4669 |
|
4670 |
EAP_TRACE_SETTINGS(&aSettings); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4671 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4672 |
enabledEAPTypes.ResetAndDestroy(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4673 |
disabledEAPTypes.ResetAndDestroy(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4674 |
enabledEAPTypes.Close(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4675 |
disabledEAPTypes.Close(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4676 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4677 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4678 |
} // EapTlsPeapUtils::GetConfigurationL() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4679 |
|
26 | 4680 |
// --------------------------------------------------------- |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4681 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4682 |
void EapTlsPeapUtils::CopySettingsL( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4683 |
RDbNamedDatabase& aDatabase, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4684 |
const TDesC& aTableName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4685 |
const TIndexType aSrcIndexType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4686 |
const TInt aSrcIndex, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4687 |
const eap_type_value_e aSrcTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4688 |
const TIndexType aDestIndexType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4689 |
const TInt aDestIndex, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4690 |
const eap_type_value_e aDestTunnelingType) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4691 |
{ |
26 | 4692 |
EAP_TRACE_DEBUG_SYMBIAN( |
4693 |
(_L("EapTlsPeapUtils::CopySettingsL(): -Start- aSrcIndexType=%d, aSrcIndex=%d, aSrcTunnelingType=0xfe%06x%08x\n"), |
|
4694 |
aSrcIndexType, |
|
4695 |
aSrcIndex, |
|
4696 |
aSrcTunnelingType.get_vendor_id(), |
|
4697 |
aSrcTunnelingType.get_vendor_type())); |
|
4698 |
||
4699 |
EAP_TRACE_DEBUG_SYMBIAN( |
|
4700 |
(_L("EapTlsPeapUtils::CopySettingsL(): -Start- aDestIndexType=%d, aDestTunnelingType=0xfe%06x%08x\n"), |
|
4701 |
aDestIndexType, |
|
4702 |
aDestIndex, |
|
4703 |
aDestTunnelingType.get_vendor_id(), |
|
4704 |
aDestTunnelingType.get_vendor_type())); |
|
4705 |
||
4706 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::CopySettingsL()\n")); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4707 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4708 |
HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4709 |
TPtr sqlStatement = buf->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4710 |
|
26 | 4711 |
_LIT(KSQL, "SELECT * FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); |
4712 |
||
4713 |
sqlStatement.Format(KSQL, |
|
4714 |
&aTableName, |
|
4715 |
&KServiceType, |
|
4716 |
aDestIndexType, |
|
4717 |
&KServiceIndex, |
|
4718 |
aDestIndex, |
|
4719 |
&KTunnelingTypeVendorId, |
|
4720 |
aSrcTunnelingType.get_vendor_id(), |
|
4721 |
&KTunnelingType, |
|
4722 |
aSrcTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4723 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4724 |
RDbView view; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4725 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4726 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited, RDbView::EUpdatable)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4727 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4728 |
// View must be closed when no longer needed |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4729 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4730 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4731 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4732 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4733 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4734 |
CDbColSet* colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4735 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4736 |
|
34 | 4737 |
if (view.FirstL()) |
4738 |
{ |
|
4739 |
do |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4740 |
{ |
34 | 4741 |
view.GetL(); |
4742 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4743 |
if (view.ColUint(colSet->ColNo(KServiceType)) == static_cast<TUint>(aDestIndexType) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4744 |
&& view.ColUint(colSet->ColNo(KServiceIndex)) == static_cast<TUint>(aDestIndex) |
26 | 4745 |
&& view.ColUint(colSet->ColNo(KTunnelingTypeVendorId)) == aDestTunnelingType.get_vendor_id() |
4746 |
&& view.ColUint(colSet->ColNo(KTunnelingType)) == aDestTunnelingType.get_vendor_type()) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4747 |
{ |
34 | 4748 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::CopySettingsL - Delete old records\n") ) ); |
4749 |
view.DeleteL(); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4750 |
} |
34 | 4751 |
} while (view.NextL() != EFalse); |
4752 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4753 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4754 |
view.Close(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4755 |
CleanupStack::PopAndDestroy(2); // view, colset |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4756 |
|
26 | 4757 |
sqlStatement.Format(KSQL, |
4758 |
&aTableName, |
|
4759 |
&KServiceType, |
|
4760 |
aSrcIndexType, |
|
4761 |
&KServiceIndex, |
|
4762 |
aSrcIndex, |
|
4763 |
&KTunnelingTypeVendorId, |
|
4764 |
aSrcTunnelingType.get_vendor_id(), |
|
4765 |
&KTunnelingType, |
|
4766 |
aSrcTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4767 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4768 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited , RDbView::EUpdatable)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4769 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4770 |
// View must be closed when no longer needed |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4771 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4772 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4773 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4774 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4775 |
// Get column set so we get the correct column numbers |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4776 |
colSet = view.ColSetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4777 |
CleanupStack::PushL(colSet); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4778 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4779 |
TDbBookmark bookmark; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4780 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4781 |
if (view.FirstL()) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4782 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4783 |
do { |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4784 |
// Get the next line |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4785 |
view.GetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4786 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4787 |
// Check if it was already copied |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4788 |
if (view.ColUint(colSet->ColNo(KServiceType)) != static_cast<TUint>(aDestIndexType) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4789 |
|| view.ColUint(colSet->ColNo(KServiceIndex)) != static_cast<TUint>(aDestIndex) |
26 | 4790 |
|| view.ColUint(colSet->ColNo(KTunnelingTypeVendorId)) != aDestTunnelingType.get_vendor_id() |
4791 |
|| view.ColUint(colSet->ColNo(KTunnelingType)) != aDestTunnelingType.get_vendor_type()) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4792 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4793 |
bookmark = view.Bookmark(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4794 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4795 |
view.InsertCopyL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4796 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4797 |
view.SetColL(colSet->ColNo(KServiceType), static_cast<TUint>(aDestIndexType)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4798 |
view.SetColL(colSet->ColNo(KServiceIndex), static_cast<TUint>(aDestIndex)); |
26 | 4799 |
view.SetColL(colSet->ColNo(KTunnelingTypeVendorId), aDestTunnelingType.get_vendor_id()); |
4800 |
view.SetColL(colSet->ColNo(KTunnelingType), aDestTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4801 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4802 |
view.PutL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4803 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4804 |
view.GotoL(bookmark); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4805 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4806 |
} while (view.NextL() != EFalse); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4807 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4808 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4809 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4810 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4811 |
(_L("EapTlsPeapUtils::CopySettingsL - Nothing to Copy\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4812 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4813 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4814 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4815 |
view.Close(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4816 |
|
26 | 4817 |
CleanupStack::PopAndDestroy(colSet); |
4818 |
CleanupStack::PopAndDestroy(&view); |
|
4819 |
CleanupStack::PopAndDestroy(buf); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4820 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4821 |
} // EapTlsPeapUtils::CopySettingsL() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4822 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4823 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4824 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4825 |
// EapTlsPeapUtils::DeleteConfigurationL() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4826 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4827 |
// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4828 |
void EapTlsPeapUtils::DeleteConfigurationL( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4829 |
const TIndexType aIndexType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4830 |
const TInt aIndex, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4831 |
const eap_type_value_e aTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4832 |
const eap_type_value_e aEapType) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4833 |
{ |
26 | 4834 |
EAP_TRACE_DEBUG_SYMBIAN( |
4835 |
(_L("EapTlsPeapUtils::DeleteConfigurationL(): -Start- aIndexType=%d, aIndex=%d, aTunnelingType=0xfe%06x%08x, aEapType=0xfe%06x%08x\n"), |
|
4836 |
aIndexType, |
|
4837 |
aIndex, |
|
4838 |
aTunnelingType.get_vendor_id(), |
|
4839 |
aTunnelingType.get_vendor_type(), |
|
4840 |
aEapType.get_vendor_id(), |
|
4841 |
aEapType.get_vendor_type())); |
|
4842 |
||
4843 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::DeleteConfigurationL()\n")); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4844 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4845 |
TPtrC dbname; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4846 |
TPtrC settings; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4847 |
TPtrC usercerts; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4848 |
TPtrC cacerts; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4849 |
TPtrC ciphersuites; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4850 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4851 |
#ifdef USE_FAST_EAP_TYPE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4852 |
TPtrC fastSpecialSettings; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4853 |
#endif |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4854 |
|
26 | 4855 |
if (aEapType == eap_type_tls) |
4856 |
{ |
|
4857 |
dbname.Set(KTlsDatabaseName); |
|
4858 |
settings.Set(KTlsDatabaseTableName); |
|
4859 |
usercerts.Set(KTlsAllowedUserCertsDatabaseTableName); |
|
4860 |
cacerts.Set(KTlsAllowedCACertsDatabaseTableName); |
|
4861 |
ciphersuites.Set(KTlsAllowedCipherSuitesDatabaseTableName); |
|
4862 |
} |
|
4863 |
else if (aEapType == eap_type_peap) |
|
4864 |
{ |
|
4865 |
dbname.Set(KPeapDatabaseName); |
|
4866 |
settings.Set(KPeapDatabaseTableName); |
|
4867 |
usercerts.Set(KPeapAllowedUserCertsDatabaseTableName); |
|
4868 |
cacerts.Set(KPeapAllowedCACertsDatabaseTableName); |
|
4869 |
ciphersuites.Set(KPeapAllowedCipherSuitesDatabaseTableName); |
|
4870 |
} |
|
4871 |
else if (aEapType == eap_type_ttls) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4872 |
{ |
26 | 4873 |
dbname.Set(KTtlsDatabaseName); |
4874 |
settings.Set(KTtlsDatabaseTableName); |
|
4875 |
usercerts.Set(KTtlsAllowedUserCertsDatabaseTableName); |
|
4876 |
cacerts.Set(KTtlsAllowedCACertsDatabaseTableName); |
|
4877 |
ciphersuites.Set(KTtlsAllowedCipherSuitesDatabaseTableName); |
|
4878 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4879 |
#ifdef USE_FAST_EAP_TYPE |
26 | 4880 |
else if (aEapType == eap_type_fast) |
4881 |
{ |
|
4882 |
dbname.Set(KFastDatabaseName); |
|
4883 |
settings.Set(KFastGeneralSettingsDBTableName); // This is general settings for FAST. |
|
4884 |
fastSpecialSettings.Set(KFastSpecialSettingsDBTableName); |
|
4885 |
||
4886 |
usercerts.Set(KFastAllowedUserCertsDatabaseTableName); |
|
4887 |
cacerts.Set(KFastAllowedCACertsDatabaseTableName); |
|
4888 |
ciphersuites.Set(KFastAllowedCipherSuitesDatabaseTableName); |
|
4889 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4890 |
#endif |
36 | 4891 |
else if (aEapType == eap_expanded_type_ttls_plain_pap.get_type()) |
26 | 4892 |
{ |
4893 |
dbname.Set( KTtlsDatabaseName ); |
|
4894 |
settings.Set( KTtlsDatabaseTableName ); |
|
4895 |
} |
|
4896 |
else |
|
4897 |
{ |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4898 |
// Should never happen |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4899 |
User::Leave(KErrArgument); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4900 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4901 |
|
26 | 4902 |
RDbNamedDatabase aDatabase; |
4903 |
RFs aFileServerSession; |
|
4904 |
||
4905 |
TInt error(KErrNone); |
|
4906 |
TFileName aPrivateDatabasePathName; |
|
4907 |
||
34 | 4908 |
error = aFileServerSession.Connect(); |
4909 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::DeleteConfigurationL(): - aFileServerSession.Connect(), error=%d\n"), error)); |
|
4910 |
User::LeaveIfError(error); |
|
4911 |
||
26 | 4912 |
EapPluginTools::CreateDatabaseLC( |
4913 |
aDatabase, |
|
4914 |
aFileServerSession, |
|
4915 |
error, |
|
4916 |
dbname, |
|
4917 |
aPrivateDatabasePathName); |
|
4918 |
||
4919 |
if(error == KErrNone) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4920 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4921 |
// Database was created so it was empty. No need for further actions. |
26 | 4922 |
aDatabase.Destroy(); |
4923 |
CleanupStack::PopAndDestroy(&aDatabase); |
|
4924 |
CleanupStack::PopAndDestroy(&aFileServerSession); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4925 |
return; |
26 | 4926 |
} |
4927 |
else if (error != KErrAlreadyExists) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4928 |
{ |
26 | 4929 |
User::LeaveIfError(error); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4930 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4931 |
|
49 | 4932 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::DeleteConfigurationL(): - calls aDatabase.Open()\n"))); |
26 | 4933 |
|
4934 |
error = aDatabase.Open(aFileServerSession, aPrivateDatabasePathName); |
|
4935 |
||
49 | 4936 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::DeleteConfigurationL(): - Opened private DB for %S. error=%d\n"), |
26 | 4937 |
&dbname, |
4938 |
error)); |
|
4939 |
||
4940 |
User::LeaveIfError(error); |
|
4941 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4942 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4943 |
HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4944 |
TPtr sqlStatement = buf->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4945 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4946 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4947 |
(_L("EapTlsPeapUtils::DeleteConfigurationL - Deleting the tables\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4948 |
|
26 | 4949 |
_LIT(KSQL, "SELECT * FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4950 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4951 |
//--------------------- Deletion 1 ----------------------------// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4952 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4953 |
// For all EAPs delete the settings table. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4954 |
// For EAP-FAST, this is delting the general settings table. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4955 |
|
26 | 4956 |
sqlStatement.Format(KSQL, |
4957 |
&settings, |
|
4958 |
&KServiceType, |
|
4959 |
aIndexType, |
|
4960 |
&KServiceIndex, |
|
4961 |
aIndex, |
|
4962 |
&KTunnelingTypeVendorId, |
|
4963 |
aTunnelingType.get_vendor_id(), |
|
4964 |
&KTunnelingType, |
|
4965 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4966 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4967 |
// Evaluate view |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4968 |
RDbView view; |
26 | 4969 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited)); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4970 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4971 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4972 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4973 |
// Delete rows |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4974 |
if (view.FirstL()) |
34 | 4975 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4976 |
do { |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4977 |
view.DeleteL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4978 |
} while (view.NextL() != EFalse); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4979 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4980 |
|
26 | 4981 |
CleanupStack::PopAndDestroy(&view); |
4982 |
||
4983 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::DeleteConfigurationL(): Deleted %s (general) settings table"), settings.Ptr())); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4984 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4985 |
////////////////////////////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4986 |
// This is only for plain PAP settings. // |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4987 |
////////////////////////////////////////// |
36 | 4988 |
if ( aEapType == eap_expanded_type_ttls_plain_pap.get_type() ) |
26 | 4989 |
{ |
4990 |
CleanupStack::PopAndDestroy(buf); |
|
4991 |
CleanupStack::PopAndDestroy(&aDatabase); |
|
4992 |
CleanupStack::PopAndDestroy(&aFileServerSession); |
|
4993 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::DeleteConfigurationL(): Return PAP"))); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4994 |
// we return here in case of pap because there is nothing to do else. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4995 |
return; |
26 | 4996 |
} |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4997 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4998 |
//--------------------- Deletion 2 ----------------------------// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4999 |
|
26 | 5000 |
// For all EAPs delete the User cert table |
34 | 5001 |
// KSQL2 is "SELECT * FROM %S WHERE %S=%d AND %S=%d AND %S=%d" |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5002 |
|
26 | 5003 |
sqlStatement.Format(KSQL, |
5004 |
&usercerts, |
|
5005 |
&KServiceType, |
|
5006 |
aIndexType, |
|
5007 |
&KServiceIndex, |
|
5008 |
aIndex, |
|
5009 |
&KTunnelingTypeVendorId, |
|
5010 |
aTunnelingType.get_vendor_id(), |
|
5011 |
&KTunnelingType, |
|
5012 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5013 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5014 |
// Evaluate view |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5015 |
|
26 | 5016 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited)); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5017 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5018 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5019 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5020 |
if (view.FirstL()) |
34 | 5021 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5022 |
do { |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5023 |
view.DeleteL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5024 |
} while (view.NextL() != EFalse); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5025 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5026 |
|
26 | 5027 |
CleanupStack::PopAndDestroy(&view); |
5028 |
||
5029 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::DeleteConfigurationL(): Deleted USER certs table"))); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5030 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5031 |
//--------------------- Deletion 3 ----------------------------// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5032 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5033 |
// For all EAPs delete the CA cert table |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5034 |
|
26 | 5035 |
// KSQL3 is "SELECT * FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d" |
5036 |
||
5037 |
sqlStatement.Format(KSQL, |
|
5038 |
&cacerts, |
|
5039 |
&KServiceType, |
|
5040 |
aIndexType, |
|
5041 |
&KServiceIndex, |
|
5042 |
aIndex, |
|
5043 |
&KTunnelingTypeVendorId, |
|
5044 |
aTunnelingType.get_vendor_id(), |
|
5045 |
&KTunnelingType, |
|
5046 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5047 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5048 |
// Evaluate view |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5049 |
|
26 | 5050 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited)); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5051 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5052 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5053 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5054 |
if (view.FirstL()) |
34 | 5055 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5056 |
do { |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5057 |
view.DeleteL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5058 |
} while (view.NextL() != EFalse); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5059 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5060 |
|
26 | 5061 |
CleanupStack::PopAndDestroy(&view); |
5062 |
||
5063 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::DeleteConfigurationL(): Deleted CA certs table"))); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5064 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5065 |
//--------------------- Deletion 4 ----------------------------// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5066 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5067 |
// For all EAPs delete the Cipher suite table |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5068 |
|
26 | 5069 |
// KSQL4 is "SELECT * FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d" |
5070 |
||
5071 |
sqlStatement.Format(KSQL, |
|
5072 |
&ciphersuites, |
|
5073 |
&KServiceType, |
|
5074 |
aIndexType, |
|
5075 |
&KServiceIndex, |
|
5076 |
aIndex, |
|
5077 |
&KTunnelingTypeVendorId, |
|
5078 |
aTunnelingType.get_vendor_id(), |
|
5079 |
&KTunnelingType, |
|
5080 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5081 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5082 |
// Evaluate view |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5083 |
|
26 | 5084 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited)); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5085 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5086 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5087 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5088 |
if (view.FirstL()) |
34 | 5089 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5090 |
do { |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5091 |
view.DeleteL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5092 |
} while (view.NextL() != EFalse); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5093 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5094 |
|
26 | 5095 |
CleanupStack::PopAndDestroy(&view); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5096 |
|
26 | 5097 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::DeleteConfigurationL(): Deleted cipher suits table"))); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5098 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5099 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5100 |
#ifdef USE_FAST_EAP_TYPE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5101 |
|
26 | 5102 |
if(aEapType == eap_type_fast) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5103 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5104 |
//--------------------- Deletion 5 ----------------------------// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5105 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5106 |
// For EAP-FAST, delete the special settings table |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5107 |
|
26 | 5108 |
sqlStatement.Format(KSQL, |
5109 |
&fastSpecialSettings, |
|
5110 |
&KServiceType, |
|
5111 |
aIndexType, |
|
5112 |
&KServiceIndex, |
|
5113 |
aIndex, |
|
5114 |
&KTunnelingTypeVendorId, |
|
5115 |
aTunnelingType.get_vendor_id(), |
|
5116 |
&KTunnelingType, |
|
5117 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5118 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5119 |
// Evaluate view |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5120 |
|
26 | 5121 |
User::LeaveIfError(view.Prepare(aDatabase, TDbQuery(sqlStatement), TDbWindow::EUnlimited)); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5122 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5123 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5124 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5125 |
if (view.FirstL()) |
34 | 5126 |
{ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5127 |
do { |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5128 |
view.DeleteL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5129 |
} while (view.NextL() != EFalse); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5130 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5131 |
|
26 | 5132 |
CleanupStack::PopAndDestroy(&view); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5133 |
|
26 | 5134 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::DeleteConfigurationL(): Deleted EAP-FAST Special settings table"))); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5135 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5136 |
} // End: if(aEapVendorType == eap_type_fast) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5137 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5138 |
#endif // End: #ifdef USE_FAST_EAP_TYPE |
26 | 5139 |
|
5140 |
CleanupStack::PopAndDestroy(buf); |
|
5141 |
CleanupStack::PopAndDestroy(&aDatabase); |
|
5142 |
CleanupStack::PopAndDestroy(&aFileServerSession); |
|
5143 |
||
5144 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::DeleteConfigurationL: End"))); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5145 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5146 |
} // EapTlsPeapUtils::DeleteConfigurationL() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5147 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5148 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5149 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5150 |
// EapTlsPeapUtils::AddExtraCertColumnsL() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5151 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5152 |
// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5153 |
void EapTlsPeapUtils::AddExtraCertColumnsL( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5154 |
RDbNamedDatabase& aDatabase, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5155 |
TDesC& aTableName) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5156 |
{ |
26 | 5157 |
EAP_TRACE_DEBUG_SYMBIAN( |
5158 |
(_L("EapTlsPeapUtils::AddExtraCertColumnsL(): -Start- aTableName=\"%S\"\n"), |
|
5159 |
&aTableName)); |
|
5160 |
||
5161 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::AddExtraCertColumnsL()\n")); |
|
5162 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5163 |
// Check if the EXTRA cert columns are already in the table. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5164 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5165 |
CDbColSet* colSetCertTable = aDatabase.ColSetL(aTableName); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5166 |
User::LeaveIfNull(colSetCertTable); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5167 |
CleanupStack::PushL(colSetCertTable); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5168 |
|
26 | 5169 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::AddExtraCertColumnsL(): - Number of columns in %S table before addition=%d\n"), |
5170 |
&aTableName, |
|
5171 |
colSetCertTable->Count())); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5172 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5173 |
// Check if there is a column for Serial Number, for example. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5174 |
if(colSetCertTable->ColNo(KSerialNumber) == KDbNullColNo) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5175 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5176 |
// The column is missing. Add all the EXTRA columns to the table. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5177 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5178 |
// EXTRA COLUMNS |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5179 |
//// NAME //////////////// TYPE //////////// Constant ///////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5180 |
//| ActualSubjectKeyId | BINARY(20) | KActualSubjectKeyIdentifier |// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5181 |
//| SubjectName | VARCHAR(255) | KSubjectName |// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5182 |
//| IssuerName | VARCHAR(255) | KIssuerName |// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5183 |
//| SerialNumber | VARCHAR(255) | KSerialNumber |// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5184 |
//| Thumbprint | BINARY(64) | KThumbprint |// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5185 |
////////////////////////////////////////////////////////////////////////////// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5186 |
|
26 | 5187 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::AddExtraCertColumnsL(): - EXTRA cert columns missing from the table %S. Adding now.\n"), |
5188 |
&aTableName)); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5189 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5190 |
HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5191 |
TPtr sqlStatement = buf->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5192 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5193 |
_LIT(KSQLAlterTableForBin, "ALTER TABLE %S ADD %S BINARY(%d)"); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5194 |
|
26 | 5195 |
sqlStatement.Format(KSQLAlterTableForBin, |
5196 |
&aTableName, |
|
5197 |
&KActualSubjectKeyIdentifier, |
|
5198 |
KKeyIdentifierLength); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5199 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5200 |
User::LeaveIfError( aDatabase.Execute(sqlStatement)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5201 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5202 |
_LIT(KSQLAlterTableForVarChar, "ALTER TABLE %S ADD %S VARCHAR(%d)"); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5203 |
|
26 | 5204 |
sqlStatement.Format(KSQLAlterTableForVarChar, |
5205 |
&aTableName, |
|
5206 |
&KSubjectName, |
|
5207 |
KGeneralStringMaxLength); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5208 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5209 |
User::LeaveIfError( aDatabase.Execute(sqlStatement)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5210 |
|
26 | 5211 |
sqlStatement.Format(KSQLAlterTableForVarChar, |
5212 |
&aTableName, |
|
5213 |
&KIssuerName, |
|
5214 |
KGeneralStringMaxLength); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5215 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5216 |
User::LeaveIfError( aDatabase.Execute(sqlStatement)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5217 |
|
26 | 5218 |
sqlStatement.Format(KSQLAlterTableForVarChar, |
5219 |
&aTableName, |
|
5220 |
&KSerialNumber, |
|
5221 |
KGeneralStringMaxLength); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5222 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5223 |
User::LeaveIfError( aDatabase.Execute(sqlStatement)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5224 |
|
26 | 5225 |
sqlStatement.Format(KSQLAlterTableForBin, |
5226 |
&aTableName, |
|
5227 |
&KThumbprint, |
|
5228 |
KThumbprintMaxLength); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5229 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5230 |
User::LeaveIfError( aDatabase.Execute(sqlStatement)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5231 |
|
26 | 5232 |
CleanupStack::PopAndDestroy(buf); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5233 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5234 |
|
26 | 5235 |
CleanupStack::PopAndDestroy(colSetCertTable); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5236 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5237 |
CDbColSet* colSetCertTableAfterAdd = aDatabase.ColSetL(aTableName); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5238 |
User::LeaveIfNull(colSetCertTableAfterAdd); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5239 |
|
26 | 5240 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::AddExtraCertColumnsL(): - Number of columns in %S table after addition=%d\n"), |
5241 |
&aTableName, |
|
5242 |
colSetCertTableAfterAdd->Count())); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5243 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5244 |
delete colSetCertTableAfterAdd; |
26 | 5245 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5246 |
} // EapTlsPeapUtils::AddExtraCertColumnsL() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5247 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5248 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5249 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5250 |
// EapTlsPeapUtils::GetEapSettingsDataL() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5251 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5252 |
// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5253 |
void EapTlsPeapUtils::GetEapSettingsDataL( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5254 |
RDbNamedDatabase& aDatabase, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5255 |
const TIndexType aIndexType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5256 |
const TInt aIndex, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5257 |
const eap_type_value_e aTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5258 |
const eap_type_value_e aEapType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5259 |
const TDesC& aDbColumnName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5260 |
eap_variable_data_c * const aDbColumnValue) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5261 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5262 |
EAP_TRACE_DEBUG_SYMBIAN( |
26 | 5263 |
(_L("EapTlsPeapUtils::GetEapSettingsDataL(): -Start- aIndexType=%d, aIndex=%d, aTunnelingType=0xfe%06x%08x, aEapType=0xfe%06x%08x\n"), |
5264 |
aIndexType, |
|
5265 |
aIndex, |
|
5266 |
aTunnelingType.get_vendor_id(), |
|
5267 |
aTunnelingType.get_vendor_type(), |
|
5268 |
aEapType.get_vendor_id(), |
|
5269 |
aEapType.get_vendor_type())); |
|
5270 |
||
5271 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::GetEapSettingsDataL()\n")); |
|
5272 |
||
5273 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::GetEapSettingsDataL Get Column Name:%S \n"), |
|
5274 |
&aDbColumnName)); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5275 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5276 |
TBufC<KMaxEapDbTableNameLength> generalSettingsTableName; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5277 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5278 |
#if defined (USE_FAST_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5279 |
TBufC<KMaxEapDbTableNameLength> specialSettingsTableName; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5280 |
#endif |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5281 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5282 |
// Set the database table name based on the type |
26 | 5283 |
if (aEapType == eap_type_tls) |
5284 |
{ |
|
5285 |
generalSettingsTableName = KTlsDatabaseTableName; |
|
5286 |
} |
|
5287 |
else if (aEapType == eap_type_peap) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5288 |
{ |
26 | 5289 |
generalSettingsTableName = KPeapDatabaseTableName; |
5290 |
} |
|
5291 |
else if (aEapType == eap_type_ttls |
|
36 | 5292 |
|| aEapType == eap_expanded_type_ttls_plain_pap.get_type()) |
26 | 5293 |
{ |
5294 |
generalSettingsTableName = KTtlsDatabaseTableName; |
|
5295 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5296 |
#if defined (USE_FAST_EAP_TYPE) |
26 | 5297 |
else if (aEapType == eap_type_fast) |
5298 |
{ |
|
5299 |
generalSettingsTableName = KFastGeneralSettingsDBTableName; // General settings |
|
5300 |
specialSettingsTableName = KFastSpecialSettingsDBTableName; // Special settings for only FAST |
|
5301 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5302 |
#endif // #if defined (USE_FAST_EAP_TYPE) |
26 | 5303 |
else |
5304 |
{ |
|
5305 |
// Unsupported EAP type |
|
5306 |
// Should never happen |
|
5307 |
||
5308 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::GetEapSettingsDataL(): Unsupported EAP type=0xfe%06x%08x"), |
|
5309 |
aEapType.get_vendor_id(), |
|
5310 |
aEapType.get_vendor_type())); |
|
5311 |
||
5312 |
User::Leave(KErrArgument); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5313 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5314 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5315 |
if(aDbColumnName.Size() <= 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5316 |
{ |
26 | 5317 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::GetEapSettingsDataL(): No Column Name!\n"))); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5318 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5319 |
User::Leave(KErrArgument); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5320 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5321 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5322 |
// Now do the database query |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5323 |
HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5324 |
TPtr sqlStatement = buf->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5325 |
|
26 | 5326 |
_LIT(KSQLQueryRow, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5327 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5328 |
#if defined(USE_FAST_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5329 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5330 |
// Unlike other EAP types, EAP-FAST has some settings in special settings table |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5331 |
// (in KFastSpecialSettingsDBTableName) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5332 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5333 |
if(aEapType == eap_type_fast |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5334 |
&& ((aDbColumnName.Compare(cf_str_EAP_FAST_allow_server_authenticated_provisioning_mode_literal) == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5335 |
|| (aDbColumnName.Compare(cf_str_EAP_FAST_allow_server_unauthenticated_provisioning_mode_ADHP_literal) == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5336 |
|| (aDbColumnName.Compare(KFASTWarnADHPNoPAC) == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5337 |
|| (aDbColumnName.Compare(KFASTWarnADHPNoMatchingPAC) == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5338 |
|| (aDbColumnName.Compare(KFASTWarnNotDefaultServer) == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5339 |
|| (aDbColumnName.Compare(KFASTPACGroupImportReferenceCollection) == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5340 |
|| (aDbColumnName.Compare(KFASTPACGroupDBReferenceCollection) == 0))) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5341 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5342 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5343 |
(_L("EapTlsPeapUtils::GetEapSettingsDataL: This field will be read from EAP-FAST's special table"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5344 |
|
26 | 5345 |
sqlStatement.Format(KSQLQueryRow, |
5346 |
&aDbColumnName, |
|
5347 |
&specialSettingsTableName, |
|
5348 |
&KServiceType, |
|
5349 |
aIndexType, |
|
5350 |
&KServiceIndex, |
|
5351 |
aIndex, |
|
5352 |
&KTunnelingTypeVendorId, |
|
5353 |
aTunnelingType.get_vendor_id(), |
|
5354 |
&KTunnelingType, |
|
5355 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5356 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5357 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5358 |
{ |
26 | 5359 |
sqlStatement.Format(KSQLQueryRow, |
5360 |
&aDbColumnName, |
|
5361 |
&generalSettingsTableName, |
|
5362 |
&KServiceType, |
|
5363 |
aIndexType, |
|
5364 |
&KServiceIndex, |
|
5365 |
aIndex, |
|
5366 |
&KTunnelingTypeVendorId, |
|
5367 |
aTunnelingType.get_vendor_id(), |
|
5368 |
&KTunnelingType, |
|
5369 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5370 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5371 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5372 |
#else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5373 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5374 |
{ |
26 | 5375 |
sqlStatement.Format(KSQLQueryRow, |
5376 |
&aDbColumnName, |
|
5377 |
&generalSettingsTableName, |
|
5378 |
&KServiceType, |
|
5379 |
aIndexType, |
|
5380 |
&KServiceIndex, |
|
5381 |
aIndex, |
|
5382 |
&KTunnelingTypeVendorId, |
|
5383 |
aTunnelingType.get_vendor_id(), |
|
5384 |
&KTunnelingType, |
|
5385 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5386 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5387 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5388 |
#endif // End: #if defined(USE_FAST_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5389 |
|
26 | 5390 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::GetEapSettingsDataL - SQL query formated OK"))); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5391 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5392 |
RDbView view; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5393 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5394 |
User::LeaveIfError(view.Prepare( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5395 |
aDatabase, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5396 |
TDbQuery(sqlStatement), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5397 |
TDbWindow::EUnlimited, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5398 |
RDbView::EReadOnly)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5399 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5400 |
CleanupStack::PopAndDestroy(buf); // We don't need buf or sqlStatement any more. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5401 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5402 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5403 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5404 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5405 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5406 |
eap_status_e status(eap_status_ok); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5407 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5408 |
if (view.FirstL()) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5409 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5410 |
view.GetL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5411 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5412 |
switch (view.ColType(KDefaultColumnInView_One)) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5413 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5414 |
case EDbColText: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5415 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5416 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5417 |
(_L("EapTlsPeapUtils::GetEapSettingsDataL: EDbColText\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5418 |
if ( !view.IsColNull( KDefaultColumnInView_One ) ) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5419 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5420 |
status = aDbColumnValue->set_copy_of_buffer( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5421 |
view.ColDes(KDefaultColumnInView_One).Ptr(), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5422 |
view.ColDes(KDefaultColumnInView_One).Size()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5423 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5424 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5425 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5426 |
aDbColumnValue->reset(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5427 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5428 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5429 |
break; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5430 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5431 |
case EDbColBinary: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5432 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5433 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5434 |
(_L("EapTlsPeapUtils::GetEapSettingsDataL: EDbColBinary\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5435 |
if ( !view.IsColNull( KDefaultColumnInView_One ) ) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5436 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5437 |
status = aDbColumnValue->set_copy_of_buffer( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5438 |
view.ColDes8(KDefaultColumnInView_One).Ptr(), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5439 |
view.ColDes8(KDefaultColumnInView_One).Size()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5440 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5441 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5442 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5443 |
aDbColumnValue->reset(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5444 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5445 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5446 |
break; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5447 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5448 |
case EDbColUint32: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5449 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5450 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5451 |
(_L("EapTlsPeapUtils::GetEapSettingsDataL: EDbColUint32\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5452 |
if ( !view.IsColNull( KDefaultColumnInView_One ) ) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5453 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5454 |
TUint value; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5455 |
value = view.ColUint32(KDefaultColumnInView_One); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5456 |
status = aDbColumnValue->set_copy_of_buffer(&value, sizeof(value)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5457 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5458 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5459 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5460 |
aDbColumnValue->reset(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5461 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5462 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5463 |
break; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5464 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5465 |
case EDbColInt64: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5466 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5467 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5468 |
(_L("EapTlsPeapUtils::GetEapSettingsDataL: EDbColInt64\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5469 |
if ( !view.IsColNull( KDefaultColumnInView_One ) ) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5470 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5471 |
TInt64 value; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5472 |
value = view.ColInt64(KDefaultColumnInView_One); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5473 |
status = aDbColumnValue->set_copy_of_buffer(&value, sizeof(value)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5474 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5475 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5476 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5477 |
aDbColumnValue->reset(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5478 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5479 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5480 |
break; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5481 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5482 |
case EDbColLongBinary: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5483 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5484 |
// This needs special handling. (readstream). Not needed in this DB yet. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5485 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5486 |
(_L("EapTlsPeapUtils::GetEapSettingsDataL: ERROR: EDbColLongBinary not supported in this DB!\n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5487 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5488 |
User::Leave(KErrNotSupported); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5489 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5490 |
break; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5491 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5492 |
default: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5493 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5494 |
(_L("EapTlsPeapUtils::GetEapSettingsDataL: ERROR: Unsupported DB field! \n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5495 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5496 |
User::Leave(KErrNotSupported); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5497 |
break; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5498 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5499 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5500 |
|
26 | 5501 |
CleanupStack::PopAndDestroy( &view ); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5502 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5503 |
if (status != eap_status_ok) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5504 |
{ |
26 | 5505 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::GetEapSettingsDataL: Status=%d\n"), status)); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5506 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5507 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5508 |
EAP_TRACE_DATA_DEBUG_SYMBIAN(("GetEapSettingsDataL:DbColumnValue:", |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5509 |
aDbColumnValue->get_data(aDbColumnValue->get_data_length()), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5510 |
aDbColumnValue->get_data_length())); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5511 |
|
26 | 5512 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::GetEapSettingsDataL: End \n"))); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5513 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5514 |
} // EapTlsPeapUtils::GetEapSettingsDataL() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5515 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5516 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5517 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5518 |
// EapTlsPeapUtils::SetEapSettingsDataL() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5519 |
// --------------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5520 |
// |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5521 |
void EapTlsPeapUtils::SetEapSettingsDataL( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5522 |
RDbNamedDatabase& aDatabase, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5523 |
const TIndexType aIndexType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5524 |
const TInt aIndex, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5525 |
const eap_type_value_e aTunnelingType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5526 |
const eap_type_value_e aEapType, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5527 |
const TDesC& aDbColumnName, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5528 |
const eap_variable_data_c * const aDbColumnValue) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5529 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5530 |
EAP_TRACE_DEBUG_SYMBIAN( |
26 | 5531 |
(_L("EapTlsPeapUtils::SetEapSettingsDataL(): -Start- aIndexType=%d, aIndex=%d, aTunnelingType=0xfe%06x%08x, aEapType=0xfe%06x%08x\n"), |
5532 |
aIndexType, |
|
5533 |
aIndex, |
|
5534 |
aTunnelingType.get_vendor_id(), |
|
5535 |
aTunnelingType.get_vendor_type(), |
|
5536 |
aEapType.get_vendor_id(), |
|
5537 |
aEapType.get_vendor_type())); |
|
5538 |
||
5539 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::SetEapSettingsDataL()\n")); |
|
5540 |
||
5541 |
||
5542 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::SetEapSettingsDataL Set Column Name:%S \n"), |
|
5543 |
&aDbColumnName)); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5544 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5545 |
EAP_TRACE_DATA_DEBUG_SYMBIAN(("SetEapSettingsDataL:DbColumnValue:", |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5546 |
aDbColumnValue->get_data(aDbColumnValue->get_data_length()), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5547 |
aDbColumnValue->get_data_length())); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5548 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5549 |
TBufC<KMaxEapDbTableNameLength> generalSettingsTableName; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5550 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5551 |
#if defined (USE_FAST_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5552 |
TBufC<KMaxEapDbTableNameLength> specialSettingsTableName; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5553 |
#endif |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5554 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5555 |
// Set the database table name based on the type |
26 | 5556 |
if (aEapType == eap_type_tls) |
5557 |
{ |
|
5558 |
generalSettingsTableName = KTlsDatabaseTableName; |
|
5559 |
} |
|
5560 |
else if (aEapType == eap_type_peap) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5561 |
{ |
26 | 5562 |
generalSettingsTableName = KPeapDatabaseTableName; |
5563 |
} |
|
5564 |
else if (aEapType == eap_type_ttls |
|
36 | 5565 |
|| aEapType == eap_expanded_type_ttls_plain_pap.get_type()) |
26 | 5566 |
{ |
5567 |
generalSettingsTableName = KTtlsDatabaseTableName; |
|
5568 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5569 |
#if defined (USE_FAST_EAP_TYPE) |
26 | 5570 |
else if (aEapType == eap_type_fast) |
5571 |
{ |
|
5572 |
generalSettingsTableName = KFastGeneralSettingsDBTableName; // General settings |
|
5573 |
specialSettingsTableName = KFastSpecialSettingsDBTableName; // Special settings for only FAST |
|
5574 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5575 |
#endif // #if defined (USE_FAST_EAP_TYPE) |
26 | 5576 |
else |
5577 |
{ |
|
5578 |
// Unsupported EAP type |
|
5579 |
// Should never happen |
|
5580 |
||
5581 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::SetEapSettingsDataL(): Unsupported EAP-type=0xfe%06x%08x"), |
|
5582 |
aEapType.get_vendor_id(), |
|
5583 |
aEapType.get_vendor_type())); |
|
5584 |
||
5585 |
User::Leave(KErrArgument); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5586 |
} |
26 | 5587 |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5588 |
if(aDbColumnName.Size() <= 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5589 |
{ |
26 | 5590 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::SetEapSettingsDataL(): No Column Name!\n"))); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5591 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5592 |
User::Leave(KErrArgument); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5593 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5594 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5595 |
// Now do the database query |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5596 |
HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5597 |
TPtr sqlStatement = buf->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5598 |
|
26 | 5599 |
_LIT(KSQLQueryRow, "SELECT %S FROM %S WHERE %S=%d AND %S=%d AND %S=%d AND %S=%d"); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5600 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5601 |
#if defined(USE_FAST_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5602 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5603 |
// Unlike other EAP types, EAP-FAST has some settings in special settings table |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5604 |
// (in KFastSpecialSettingsDBTableName) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5605 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5606 |
if(aEapType == eap_type_fast |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5607 |
&& ((aDbColumnName.Compare(cf_str_EAP_FAST_allow_server_authenticated_provisioning_mode_literal) == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5608 |
|| (aDbColumnName.Compare(cf_str_EAP_FAST_allow_server_unauthenticated_provisioning_mode_ADHP_literal) == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5609 |
|| (aDbColumnName.Compare(KFASTWarnADHPNoPAC) == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5610 |
|| (aDbColumnName.Compare(KFASTWarnADHPNoMatchingPAC) == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5611 |
|| (aDbColumnName.Compare(KFASTWarnNotDefaultServer) == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5612 |
|| (aDbColumnName.Compare(KFASTPACGroupImportReferenceCollection) == 0) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5613 |
|| (aDbColumnName.Compare(KFASTPACGroupDBReferenceCollection) == 0))) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5614 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5615 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5616 |
(_L("EapTlsPeapUtils::SetEapSettingsDataL: This field will be read from EAP-FAST's special table"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5617 |
|
26 | 5618 |
sqlStatement.Format(KSQLQueryRow, |
5619 |
&aDbColumnName, |
|
5620 |
&specialSettingsTableName, |
|
5621 |
&KServiceType, |
|
5622 |
aIndexType, |
|
5623 |
&KServiceIndex, |
|
5624 |
aIndex, |
|
5625 |
&KTunnelingTypeVendorId, |
|
5626 |
aTunnelingType.get_vendor_id(), |
|
5627 |
&KTunnelingType, |
|
5628 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5629 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5630 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5631 |
{ |
26 | 5632 |
sqlStatement.Format(KSQLQueryRow, |
5633 |
&aDbColumnName, |
|
5634 |
&generalSettingsTableName, |
|
5635 |
&KServiceType, |
|
5636 |
aIndexType, |
|
5637 |
&KServiceIndex, |
|
5638 |
aIndex, |
|
5639 |
&KTunnelingTypeVendorId, |
|
5640 |
aTunnelingType.get_vendor_id(), |
|
5641 |
&KTunnelingType, |
|
5642 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5643 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5644 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5645 |
#else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5646 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5647 |
{ |
26 | 5648 |
sqlStatement.Format(KSQLQueryRow, |
5649 |
&aDbColumnName, |
|
5650 |
&generalSettingsTableName, |
|
5651 |
&KServiceType, |
|
5652 |
aIndexType, |
|
5653 |
&KServiceIndex, |
|
5654 |
aIndex, |
|
5655 |
&KTunnelingTypeVendorId, |
|
5656 |
aTunnelingType.get_vendor_id(), |
|
5657 |
&KTunnelingType, |
|
5658 |
aTunnelingType.get_vendor_type()); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5659 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5660 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5661 |
#endif // End: #if defined(USE_FAST_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5662 |
|
26 | 5663 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::SetEapSettingsDataL - SQL query formated OK"))); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5664 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5665 |
RDbView view; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5666 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5667 |
User::LeaveIfError(view.Prepare( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5668 |
aDatabase, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5669 |
TDbQuery(sqlStatement), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5670 |
TDbWindow::EUnlimited, |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5671 |
RDbView::EUpdatable)); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5672 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5673 |
CleanupStack::PopAndDestroy(buf); // We don't need buf or sqlStatement any more. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5674 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5675 |
CleanupClosePushL(view); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5676 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5677 |
User::LeaveIfError(view.EvaluateAll()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5678 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5679 |
if (view.FirstL()) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5680 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5681 |
view.UpdateL(); // Here it is update. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5682 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5683 |
if(view.ColCount() == KDefaultColumnInView_One) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5684 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5685 |
// There should be one column (only one) with the specified column name. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5686 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5687 |
HBufC8* dbColVal8 = HBufC8::NewLC(aDbColumnValue->get_data_length()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5688 |
TPtr8 dbColValPtr8 = dbColVal8->Des(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5689 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5690 |
dbColValPtr8.Copy( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5691 |
aDbColumnValue->get_data( aDbColumnValue->get_data_length() ), |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5692 |
aDbColumnValue->get_data_length() ); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5693 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5694 |
switch (view.ColType(KDefaultColumnInView_One)) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5695 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5696 |
case EDbColText: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5697 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5698 |
TPtr dbColValPtr(0,dbColValPtr8.Size()); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5699 |
dbColValPtr.Copy(dbColValPtr8); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5700 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5701 |
view.SetColL(KDefaultColumnInView_One, dbColValPtr); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5702 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5703 |
break; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5704 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5705 |
case EDbColBinary: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5706 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5707 |
view.SetColL(KDefaultColumnInView_One, dbColValPtr8); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5708 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5709 |
break; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5710 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5711 |
case EDbColUint32: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5712 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5713 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5714 |
#if defined (USE_FAST_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5715 |
|
26 | 5716 |
EAP_TRACE_DEBUG_SYMBIAN((_L("WARNING: eap_am_type_tls_peap_symbian_c::authentication_finishedL(): HACK to set Unauth Prov mode set to default (NO)!"))); |
5717 |
||
5718 |
view.SetColL(KDefaultColumnInView_One, EEapDbFalse); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5719 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5720 |
#endif // End: #if defined (USE_FAST_EAP_TYPE) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5721 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5722 |
break; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5723 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5724 |
case EDbColInt64: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5725 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5726 |
// Do some lexical analysis to get TInt64 value here and set it in DB. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5727 |
|
26 | 5728 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::SetEapSettingsDataL(): EDbColInt64 not supported here yet!\n"))); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5729 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5730 |
User::Leave(KErrNotSupported); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5731 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5732 |
break; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5733 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5734 |
case EDbColLongBinary: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5735 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5736 |
// This needs special handling. (readstream). Not needed in this DB yet. |
26 | 5737 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::SetEapSettingsDataL(): EDbColLongBinary not supported in this DB!\n"))); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5738 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5739 |
User::Leave(KErrNotSupported); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5740 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5741 |
break; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5742 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5743 |
default: |
26 | 5744 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::SetEapSettingsDataL: Unsupported DB field! \n"))); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5745 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5746 |
User::Leave(KErrNotSupported); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5747 |
break; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5748 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5749 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5750 |
CleanupStack::PopAndDestroy(dbColVal8); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5751 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5752 |
} // End: if(view.ColCount() == KDefaultColumnInView_One) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5753 |
else |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5754 |
{ |
26 | 5755 |
EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: EapTlsPeapUtils::SetEapSettingsDataL(): Too many columns in DB view, count=%d \n"), |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5756 |
view.ColCount())); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5757 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5758 |
User::Leave(KErrNotFound); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5759 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5760 |
} // End: if (view.FirstL()) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5761 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5762 |
// Now it should go to the DB. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5763 |
view.PutL(); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5764 |
|
26 | 5765 |
CleanupStack::PopAndDestroy( &view ); |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5766 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5767 |
EAP_TRACE_DEBUG_SYMBIAN( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5768 |
(_L("EapTlsPeapUtils::SetEapSettingsDataL: End \n"))); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5769 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5770 |
|
26 | 5771 |
// --------------------------------------------------------- |
5772 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5773 |
/* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5774 |
* Alter table for added column, if doesn't exist |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5775 |
* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5776 |
*/ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5777 |
void EapTlsPeapUtils::AlterTableL( |
26 | 5778 |
RDbNamedDatabase& aDb, |
5779 |
TAlterTableCmd aCmd, |
|
5780 |
const TDesC& aTableName, |
|
5781 |
const TDesC& aColumnName, |
|
5782 |
const TDesC& aColumnDef ) |
|
5783 |
{ |
|
5784 |
EAP_TRACE_DEBUG_SYMBIAN( |
|
5785 |
(_L("EapTlsPeapUtils::AlterTableL(): -Start- aTableName=\"%S\", aColumnName=\"%S\", aColumnDef=\"%S\"\n"), |
|
5786 |
&aTableName, |
|
5787 |
&aColumnName, |
|
5788 |
&aColumnDef)); |
|
5789 |
||
5790 |
EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: EapTlsPeapUtils::AlterTableL()\n")); |
|
5791 |
||
5792 |
CDbColSet* colSet = aDb.ColSetL( aTableName ); |
|
5793 |
User::LeaveIfNull( colSet ); |
|
5794 |
CleanupStack::PushL( colSet ); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5795 |
|
26 | 5796 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::AlterTableL() Number of columns in \"%S\" table is %d.\n" ), |
5797 |
&aTableName, |
|
5798 |
colSet->Count())); |
|
5799 |
||
5800 |
if ( aCmd == EAddColumn ) |
|
5801 |
{ |
|
5802 |
// Check if there is a target column |
|
5803 |
if( colSet->ColNo( aColumnName ) != KDbNullColNo ) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5804 |
{ |
26 | 5805 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::AlterTableL() Column \"%S\" exists already in table \"%S\".\n" ), |
5806 |
&aColumnName, |
|
5807 |
&aTableName)); |
|
5808 |
CleanupStack::PopAndDestroy( colSet ); |
|
5809 |
return; |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5810 |
} |
26 | 5811 |
} |
5812 |
else |
|
5813 |
{ |
|
5814 |
// Check if there is a target column |
|
5815 |
if( colSet->ColNo( aColumnName ) == KDbNullColNo ) |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5816 |
{ |
26 | 5817 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::AlterTableL() Column \"%S\" does not exists already in table \"%S\".\n" ), |
5818 |
&aColumnName, |
|
5819 |
&aTableName)); |
|
5820 |
CleanupStack::PopAndDestroy( colSet ); |
|
5821 |
return; |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5822 |
} |
26 | 5823 |
} |
5824 |
||
5825 |
HBufC* buf = HBufC::NewLC( KMaxSqlQueryLength ); |
|
5826 |
TPtr sqlStatement = buf->Des(); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5827 |
|
26 | 5828 |
_LIT( KSqlAddCol, "ALTER TABLE %S ADD %S %S" ); |
5829 |
_LIT( KSqlRemoveCol, "ALTER TABLE %S DROP %S" ); |
|
5830 |
||
5831 |
if ( aCmd == EAddColumn ) |
|
5832 |
{ |
|
5833 |
sqlStatement.Format(KSqlAddCol, |
|
5834 |
&aTableName, |
|
5835 |
&aColumnName, |
|
5836 |
&aColumnDef); |
|
5837 |
} |
|
5838 |
else |
|
5839 |
{ |
|
5840 |
sqlStatement.Format(KSqlRemoveCol, |
|
5841 |
&aTableName, |
|
5842 |
&aColumnName); |
|
5843 |
} |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5844 |
|
26 | 5845 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::AlterTableL(): sqlStatement=%S\n"), |
5846 |
&sqlStatement)); |
|
5847 |
||
5848 |
User::LeaveIfError( aDb.Execute( sqlStatement ) ); |
|
5849 |
CleanupStack::PopAndDestroy( buf ); |
|
5850 |
CleanupStack::PopAndDestroy( colSet ); |
|
5851 |
||
5852 |
CDbColSet* alteredColSet = aDb.ColSetL( aTableName ); |
|
5853 |
User::LeaveIfNull( alteredColSet ); |
|
5854 |
||
5855 |
EAP_TRACE_DEBUG_SYMBIAN((_L("EapTlsPeapUtils::AlterTableL() Number of columns in %S table after adding is %d.\n" ), |
|
5856 |
&aTableName, |
|
5857 |
alteredColSet->Count())); |
|
5858 |
||
5859 |
delete alteredColSet; |
|
5860 |
||
5861 |
} // EapTlsPeapUtils::AlterTableL() |
|
5862 |
||
5863 |
// --------------------------------------------------------- |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5864 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5865 |
// End of file |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5866 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5867 |