author | Pat Downey <patd@symbian.org> |
Wed, 01 Sep 2010 12:23:57 +0100 | |
branch | RCL_3 |
changeset 46 | c74b3d9f6b9e |
parent 45 | bad0cc58d154 |
permissions | -rw-r--r-- |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies). |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: EAP and WLAN authentication protocols. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
2
1c7bc153c08e
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
18 |
/* |
46 | 19 |
* %version: 11.1.2 % |
2
1c7bc153c08e
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
20 |
*/ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
|
46 | 22 |
/* The meaning and bit positions used in "opaque_data" field in ECOM implementation |
23 |
||
24 |
0 0 0 0 0 0 0 0 ---->All 0 means allowed both inside (encapsulated EAP) and outside (Outer EAP) |
|
25 |
| | | | | | | | |
|
26 |
| | | | | | | |_____ 1 means NOT_INSIDE_TUNNEL (NOT allowed as encapsulated EAP) |
|
27 |
| | | | | | | |
|
28 |
| | | | | | |_______ 1 means NOT_OUTSIDE_TUNNEL (only allowed as encapsulated EAP, NOT as outer EAP) |
|
29 |
| | | | | | |
|
30 |
| | | | | |_________ 1 means NOT_INSIDE_PEAP |
|
31 |
| | | | | |
|
32 |
| | | | |___________ 1 means NOT_OUTSIDE_PEAP |
|
33 |
| | | | |
|
34 |
| | | |_____________ 1 means NOT_INSIDE_TTLS |
|
35 |
| | | |
|
36 |
| | |_______________ 1 means NOT_OUTSIDE_TTLS |
|
37 |
| | |
|
38 |
| |_________________ 1 means NOT_INSIDE_FAST |
|
39 |
| |
|
40 |
|___________________ 1 means NOT_OUTSIDE_FAST |
|
41 |
||
42 |
||
43 |
// For historical reasons NOT_OUTSIDE_PEAP is used instead of NOT_OUTSIDE_TUNNEL |
|
44 |
// Both of these convey the same meaning. It means if an EAP is not allowed outside PEAP |
|
45 |
// (DisallowedOutsidePEAP), it can be used only as an encapsulated EAP. |
|
46 |
// EAP-MSCHAPv2 is an example for this. |
|
47 |
||
48 |
// The bits can be ORed. |
|
49 |
// "NOT_OUTSIDE|NOT_OUTSIDE_PEAP" is 0x0A (0000 1010). |
|
50 |
// "NOT_OUTSIDE|NOT_OUTSIDE_PEAP|NOT_INSIDE_PEAP|NOT_INSIDE_FAST" is 0x4E (0100 1110). |
|
51 |
// "NOT_INSIDE|NOT_INSIDE_PEAP|NOT_INSIDE_TTLS|NOT_INSIDE_FAST" is 0x55 (0101 0101). |
|
52 |
// "NOT_INSIDE|NOT_INSIDE_PEAP|NOT_INSIDE_TTLS|NOT_INSIDE_FAST|NOT_OUTSIDE_PEAP|NOT_OUTSIDE" is 0x5F (0101 1111). |
|
53 |
||
54 |
*/ |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
|
46 | 57 |
|
58 |
const TUint8 KNotInsideTunnel = 0x01; // Only the last bit position is 1. (0000 0001) |
|
59 |
const TUint8 KNotOutsideTunnel = 0x02; // Only the 2nd last bit positions is 1. (0000 0010) |
|
60 |
||
61 |
const TUint8 KNotInsidePEAP = 0x04; // Only the 3rd last bit position is 1. (0000 0100) |
|
62 |
const TUint8 KNotOutsidePEAP = 0x08; // Only the 4th last bit positions is 1. (0000 1000) |
|
45
bad0cc58d154
Revision: 201029
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
63 |
|
46 | 64 |
const TUint8 KNotInsideTTLS = 0x10; // Only the 5th last bit position is 1. (0001 0000) |
65 |
const TUint8 KNotOutsideTTLS = 0x20; // Only the 6th last bit position is 1. (0010 0000) |
|
45
bad0cc58d154
Revision: 201029
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
66 |
|
46 | 67 |
const TUint8 KNotInsideFAST = 0x40; // Only the 7th last bit position is 1. (0100 0000) |
68 |
const TUint8 KNotOutsideFAST = 0x80; // Only the first bit position is 1. (1000 0000) |
|
69 |
||
45
bad0cc58d154
Revision: 201029
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
2
diff
changeset
|
70 |
|
46 | 71 |
inline CEapType* CEapType::NewL(const TDesC8& aCue, TIndexType aIndexType, TInt aIndex) |
72 |
{ |
|
73 |
// The EAP type id (aCue) is passed to ECom as resolver parameters |
|
74 |
TEComResolverParams resolverParams; |
|
75 |
resolverParams.SetDataType(aCue); |
|
76 |
||
77 |
// The arguments are stored to a iapInfo struct. |
|
78 |
SIapInfo iapInfo; |
|
79 |
iapInfo.indexType = aIndexType; |
|
80 |
iapInfo.index = aIndex; |
|
81 |
||
82 |
// This call finds and loads the correct DLL and after that calls the |
|
83 |
// entry function in the interface implementation in the DLL. |
|
84 |
TAny* ptr = REComSession::CreateImplementationL( |
|
85 |
KEapTypeInterfaceUid, |
|
86 |
_FOFF(CEapType, iDtor_ID_Key), |
|
87 |
&iapInfo, |
|
88 |
resolverParams); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
return (CEapType *) ptr; |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
91 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
92 |
inline CEapType::~CEapType() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
93 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
94 |
// Unload DLL |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
95 |
REComSession::DestroyedImplementation(iDtor_ID_Key); |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
97 |
|
46 | 98 |
inline TBool CEapType::IsDisallowedOutsidePEAP(const CImplementationInformation& aImplInfo) |
99 |
{ |
|
100 |
||
101 |
const TUint8 pluginOpaqueData = *(aImplInfo.OpaqueData().Ptr()); |
|
102 |
||
103 |
if(pluginOpaqueData & KNotOutsidePEAP) |
|
104 |
{ |
|
105 |
return ETrue; |
|
106 |
} |
|
107 |
return EFalse; |
|
108 |
||
109 |
} |
|
110 |
||
111 |
inline TBool CEapType::IsDisallowedInsidePEAP(const CImplementationInformation& aImplInfo) |
|
112 |
{ |
|
113 |
const TUint8 pluginOpaqueData = *(aImplInfo.OpaqueData().Ptr()); |
|
114 |
||
115 |
if(pluginOpaqueData & KNotInsidePEAP) |
|
116 |
{ |
|
117 |
return ETrue; |
|
118 |
} |
|
119 |
return EFalse; |
|
120 |
||
121 |
} |
|
122 |
||
123 |
inline TBool CEapType::IsDisallowedInsideTTLS(const CImplementationInformation& aImplInfo) |
|
124 |
{ |
|
125 |
const TUint8 pluginOpaqueData = *(aImplInfo.OpaqueData().Ptr()); |
|
126 |
||
127 |
if(pluginOpaqueData & KNotInsideTTLS) |
|
128 |
{ |
|
129 |
return ETrue; |
|
130 |
} |
|
131 |
return EFalse; |
|
132 |
} |
|
133 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
134 |
// End of file |