14 * Description: EAP and WLAN authentication protocols. |
14 * Description: EAP and WLAN authentication protocols. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 /* |
18 /* |
19 * %version: 11.1.2 % |
19 * %version: 22 % |
20 */ |
20 */ |
21 |
21 |
22 /* The meaning and bit positions used in "opaque_data" field in ECOM implementation |
22 #include "EapTraceSymbian.h" |
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 |
23 |
56 |
24 |
|
25 // Used By UI |
|
26 inline CEapType* CEapType::NewL(const TIndexType aIndexType, const TInt aIndex, const TEapExpandedType aEapType) |
|
27 { |
|
28 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapType::NewL(EapGeneric): start"))); |
57 |
29 |
58 const TUint8 KNotInsideTunnel = 0x01; // Only the last bit position is 1. (0000 0001) |
30 // The arguments are stored to a iapInfo struct. |
59 const TUint8 KNotOutsideTunnel = 0x02; // Only the 2nd last bit positions is 1. (0000 0010) |
31 SIapInfo iapInfo; |
|
32 iapInfo.indexType = aIndexType; |
|
33 iapInfo.index = aIndex; |
|
34 iapInfo.aEapType = aEapType; |
60 |
35 |
61 const TUint8 KNotInsidePEAP = 0x04; // Only the 3rd last bit position is 1. (0000 0100) |
36 // This call finds and loads the correct DLL and after that calls the |
62 const TUint8 KNotOutsidePEAP = 0x08; // Only the 4th last bit positions is 1. (0000 1000) |
37 // entry function in the interface implementation in the DLL. |
|
38 TAny* ptr = 0; |
63 |
39 |
64 const TUint8 KNotInsideTTLS = 0x10; // Only the 5th last bit position is 1. (0001 0000) |
40 const TUid KimplementationUid = { 0x20026FD2 }; |
65 const TUint8 KNotOutsideTTLS = 0x20; // Only the 6th last bit position is 1. (0010 0000) |
|
66 |
41 |
67 const TUint8 KNotInsideFAST = 0x40; // Only the 7th last bit position is 1. (0100 0000) |
42 TRAPD( err, ptr = REComSession::CreateImplementationL( |
68 const TUint8 KNotOutsideFAST = 0x80; // Only the first bit position is 1. (1000 0000) |
43 KimplementationUid, |
|
44 _FOFF(CEapType, iDtor_ID_Key), |
|
45 &iapInfo)); |
69 |
46 |
|
47 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapType::NewL(EapGeneric): CreateImplementationL(Uid=0x%08x), err=%d, returns ptr=0x%08x\n"), |
|
48 KimplementationUid.iUid, |
|
49 err, |
|
50 ptr)); |
70 |
51 |
71 inline CEapType* CEapType::NewL(const TDesC8& aCue, TIndexType aIndexType, TInt aIndex) |
52 User::LeaveIfError(err); |
72 { |
53 |
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); |
|
89 return (CEapType *) ptr; |
54 return (CEapType *) ptr; |
90 } |
55 } |
91 |
56 |
92 inline CEapType::~CEapType() |
57 inline CEapType::~CEapType() |
93 { |
58 { |
|
59 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapType::~CEapType(): this=0x%08x"), |
|
60 this)); |
|
61 |
|
62 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapType::~CEapType()")); |
|
63 |
94 // Unload DLL |
64 // Unload DLL |
95 REComSession::DestroyedImplementation(iDtor_ID_Key); |
65 REComSession::DestroyedImplementation(iDtor_ID_Key); |
96 } |
66 } |
97 |
67 |
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 |
|
134 // End of file |
68 // End of file |