14 * Description: EAP and WLAN authentication protocols. |
14 * Description: EAP and WLAN authentication protocols. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 /* |
18 /* |
19 * %version: 22 % |
19 * %version: 11.1.2 % |
20 */ |
20 */ |
21 |
21 |
22 #include "EapTraceSymbian.h" |
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 */ |
23 |
55 |
24 |
56 |
25 // Used By UI |
57 |
26 inline CEapType* CEapType::NewL(const TIndexType aIndexType, const TInt aIndex, const TEapExpandedType aEapType) |
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) |
|
63 |
|
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) |
|
66 |
|
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 |
|
70 |
|
71 inline CEapType* CEapType::NewL(const TDesC8& aCue, TIndexType aIndexType, TInt aIndex) |
27 { |
72 { |
28 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapType::NewL(EapGeneric): start"))); |
73 // The EAP type id (aCue) is passed to ECom as resolver parameters |
29 |
74 TEComResolverParams resolverParams; |
30 // The arguments are stored to a iapInfo struct. |
75 resolverParams.SetDataType(aCue); |
31 SIapInfo iapInfo; |
76 |
32 iapInfo.indexType = aIndexType; |
77 // The arguments are stored to a iapInfo struct. |
33 iapInfo.index = aIndex; |
78 SIapInfo iapInfo; |
34 iapInfo.aEapType = aEapType; |
79 iapInfo.indexType = aIndexType; |
35 |
80 iapInfo.index = aIndex; |
36 // This call finds and loads the correct DLL and after that calls the |
81 |
37 // entry function in the interface implementation in the DLL. |
82 // This call finds and loads the correct DLL and after that calls the |
38 TAny* ptr = 0; |
83 // entry function in the interface implementation in the DLL. |
39 |
84 TAny* ptr = REComSession::CreateImplementationL( |
40 const TUid KimplementationUid = { 0x20026FD2 }; |
85 KEapTypeInterfaceUid, |
41 |
86 _FOFF(CEapType, iDtor_ID_Key), |
42 TRAPD( err, ptr = REComSession::CreateImplementationL( |
87 &iapInfo, |
43 KimplementationUid, |
88 resolverParams); |
44 _FOFF(CEapType, iDtor_ID_Key), |
|
45 &iapInfo)); |
|
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)); |
|
51 |
|
52 User::LeaveIfError(err); |
|
53 |
|
54 return (CEapType *) ptr; |
89 return (CEapType *) ptr; |
55 } |
90 } |
56 |
91 |
57 inline CEapType::~CEapType() |
92 inline CEapType::~CEapType() |
58 { |
93 { |
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 |
|
64 // Unload DLL |
94 // Unload DLL |
65 REComSession::DestroyedImplementation(iDtor_ID_Key); |
95 REComSession::DestroyedImplementation(iDtor_ID_Key); |
66 } |
96 } |
67 |
97 |
|
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 |
68 // End of file |
134 // End of file |