|
1 /* |
|
2 * Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: EAP and WLAN authentication protocols. |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 7 % |
|
20 */ |
|
21 |
|
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 */ |
|
55 |
|
56 #include "EapTraceSymbian.h" |
|
57 |
|
58 |
|
59 const TUint8 KNotInsideTunnel = 0x01; // Only the last bit position is 1. (0000 0001) |
|
60 const TUint8 KNotOutsideTunnel = 0x02; // Only the 2nd last bit positions is 1. (0000 0010) |
|
61 |
|
62 const TUint8 KNotInsidePEAP = 0x04; // Only the 3rd last bit position is 1. (0000 0100) |
|
63 const TUint8 KNotOutsidePEAP = 0x08; // Only the 4th last bit positions is 1. (0000 1000) |
|
64 |
|
65 const TUint8 KNotInsideTTLS = 0x10; // Only the 5th last bit position is 1. (0001 0000) |
|
66 const TUint8 KNotOutsideTTLS = 0x20; // Only the 6th last bit position is 1. (0010 0000) |
|
67 |
|
68 const TUint8 KNotInsideFAST = 0x40; // Only the 7th last bit position is 1. (0100 0000) |
|
69 const TUint8 KNotOutsideFAST = 0x80; // Only the first bit position is 1. (1000 0000) |
|
70 |
|
71 // Used By Server |
|
72 inline CEapTypePlugin* CEapTypePlugin::NewL(const TDesC8& aCue, TIndexType aIndexType, TInt aIndex, abs_eap_am_tools_c * const aTools) |
|
73 { |
|
74 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTypePlugin::NewL(): start"))); |
|
75 |
|
76 // The EAP type id (aCue) is passed to ECom as resolver parameters |
|
77 TEComResolverParams resolverParams; |
|
78 resolverParams.SetDataType(aCue); |
|
79 |
|
80 // The arguments are stored to a iapInfo struct. |
|
81 SPluginInfo iapInfo; |
|
82 iapInfo.indexType = aIndexType; |
|
83 iapInfo.index = aIndex; |
|
84 iapInfo.aEapType = aCue; |
|
85 iapInfo.aTools = aTools; |
|
86 |
|
87 EAP_TRACE_DATA_DEBUG_SYMBIAN(("CEapTypePlugin::NewL(): resolverParams.DataType()", |
|
88 resolverParams.DataType().Ptr(), |
|
89 resolverParams.DataType().Size())); |
|
90 |
|
91 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTypePlugin::NewL(): iapInfo.aEapType=0xfe%06x%08x\n"), |
|
92 iapInfo.aEapType.GetVendorId(), |
|
93 iapInfo.aEapType.GetVendorType())); |
|
94 |
|
95 // This call finds and loads the correct DLL and after that calls the |
|
96 // entry function in the interface implementation in the DLL. |
|
97 TAny* ptr = 0; |
|
98 |
|
99 TRAPD( err, ptr = REComSession::CreateImplementationL( |
|
100 KEapTypeInterfaceUid, |
|
101 _FOFF(CEapTypePlugin, iDtor_ID_Key), |
|
102 &iapInfo, |
|
103 resolverParams)); |
|
104 |
|
105 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTypePlugin::NewL(): ends, err=%d, returns ptr=0x%08x\n"), |
|
106 err, |
|
107 ptr)); |
|
108 |
|
109 User::LeaveIfError(err); |
|
110 |
|
111 return (CEapTypePlugin *) ptr; |
|
112 } |
|
113 |
|
114 inline CEapTypePlugin::~CEapTypePlugin() |
|
115 { |
|
116 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTypePlugin::~CEapTypePlugin(): this=0x%08x"), |
|
117 this)); |
|
118 |
|
119 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTypePlugin::~CEapTypePlugin()")); |
|
120 |
|
121 // Unload DLL |
|
122 REComSession::DestroyedImplementation(iDtor_ID_Key); |
|
123 } |
|
124 |
|
125 inline TBool CEapTypePlugin::IsDisallowedOutsidePEAP(const CImplementationInformation& aImplInfo) |
|
126 { |
|
127 |
|
128 const TUint8 pluginOpaqueData = *(aImplInfo.OpaqueData().Ptr()); |
|
129 |
|
130 if(pluginOpaqueData & KNotOutsidePEAP) |
|
131 { |
|
132 return ETrue; |
|
133 } |
|
134 return EFalse; |
|
135 |
|
136 } |
|
137 |
|
138 inline TBool CEapTypePlugin::IsDisallowedInsidePEAP(const CImplementationInformation& aImplInfo) |
|
139 { |
|
140 const TUint8 pluginOpaqueData = *(aImplInfo.OpaqueData().Ptr()); |
|
141 |
|
142 if(pluginOpaqueData & KNotInsidePEAP) |
|
143 { |
|
144 return ETrue; |
|
145 } |
|
146 return EFalse; |
|
147 |
|
148 } |
|
149 |
|
150 inline TBool CEapTypePlugin::IsDisallowedInsideTTLS(const CImplementationInformation& aImplInfo) |
|
151 { |
|
152 const TUint8 pluginOpaqueData = *(aImplInfo.OpaqueData().Ptr()); |
|
153 |
|
154 if(pluginOpaqueData & KNotInsideTTLS) |
|
155 { |
|
156 return ETrue; |
|
157 } |
|
158 return EFalse; |
|
159 } |
|
160 |
|
161 // End of file |