52 const TInt KParamIDConfigFlag = 4; |
53 const TInt KParamIDConfigFlag = 4; |
53 const TInt KParamIDFailedAttempts = 5; |
54 const TInt KParamIDFailedAttempts = 5; |
54 const TInt KParamIDBlockedAtTime = 6; |
55 const TInt KParamIDBlockedAtTime = 6; |
55 |
56 |
56 const TInt KParamIDBlockedInOOS = 7; |
57 const TInt KParamIDBlockedInOOS = 7; |
|
58 // ID number for the encrypted security code. |
|
59 const TInt KParamIDCryptoCode = 8; |
|
60 //ID number for the boolean for the configuartion check |
|
61 const TInt KParamIDConfigChecked = 9; |
|
62 |
|
63 // Total number of Param IDs |
|
64 const TInt KTotalParamIDs = 9; |
57 |
65 |
58 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
66 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
59 #define SCP_PARAMETERS_WithFlag { &iConfigFlag, \ |
67 #define SCP_PARAMETERS_WithFlag { &iConfigFlag, \ |
60 &iMaxTimeout, \ |
68 &iMaxTimeout, \ |
61 &iSecCode, \ |
69 &iSecCode, \ |
62 &iEnhSecCode, \ |
70 &iEnhSecCode, \ |
63 &iFailedAttempts, \ |
71 &iFailedAttempts, \ |
64 &iBlockedAtTime, \ |
72 &iBlockedAtTime, \ |
65 &iBlockedInOOS \ |
73 &iBlockedInOOS, \ |
|
74 &iCryptoCode, \ |
|
75 &iConfigChecked \ |
66 }; |
76 }; |
67 |
77 |
68 #define SCP_PARAMIDS_WithFlag { KParamIDConfigFlag, \ |
78 #define SCP_PARAMIDS_WithFlag { KParamIDConfigFlag, \ |
69 KParamIDMaxTimeout, \ |
79 KParamIDMaxTimeout, \ |
70 KParamIDSecCode, \ |
80 KParamIDSecCode, \ |
71 KParamIDEnhSecCode, \ |
81 KParamIDEnhSecCode, \ |
72 KParamIDFailedAttempts, \ |
82 KParamIDFailedAttempts, \ |
73 KParamIDBlockedAtTime, \ |
83 KParamIDBlockedAtTime, \ |
74 KParamIDBlockedInOOS \ |
84 KParamIDBlockedInOOS, \ |
|
85 KParamIDCryptoCode, \ |
|
86 KParamIDConfigChecked \ |
75 }; |
87 }; |
76 |
88 |
77 #define SCP_PARAMTYPES_WithFlag { EParTypeInt, \ |
89 #define SCP_PARAMTYPES_WithFlag { EParTypeInt, \ |
78 EParTypeInt, \ |
90 EParTypeInt, \ |
79 EParTypeDesc, \ |
91 EParTypeDesc, \ |
80 EParTypeDesc, \ |
92 EParTypeDesc, \ |
81 EParTypeInt, \ |
93 EParTypeInt, \ |
82 EParTypeDesc, \ |
94 EParTypeDesc, \ |
83 EParTypeInt \ |
95 EParTypeInt, \ |
|
96 EParTypeDesc, \ |
|
97 EParTypeBool \ |
84 }; |
98 }; |
85 |
99 |
86 //#else // !__SAP_DEVICE_LOCK_ENHANCEMENTS |
100 //#else // !__SAP_DEVICE_LOCK_ENHANCEMENTS |
87 |
101 |
88 // Definitions for the structures that control the parsing |
102 // Definitions for the structures that control the parsing |
153 * If the input is not an exact multiple of a DES block, 0-padding is used. The |
167 * If the input is not an exact multiple of a DES block, 0-padding is used. The |
154 * output buffer must be large enough to store the output blocks. |
168 * output buffer must be large enough to store the output blocks. |
155 */ |
169 */ |
156 void TransformStringL( TBool aEncrypt, TDes& aInput, TDes& aOutput ); |
170 void TransformStringL( TBool aEncrypt, TDes& aInput, TDes& aOutput ); |
157 |
171 |
|
172 /** |
|
173 * Function to check for any ECOM plugin implementing the MDMEncryptionUtilInterface exist in ROM only. |
|
174 * If any plugin is implemented then Encrypts or decrypts the input string in aInput, saving the output in aOutput. |
|
175 * If the input is not an exact multiple of a DES block, 0-padding is used. The |
|
176 * output buffer must be large enough to store the output blocks. |
|
177 * Returns ETrue if plugin is implemented & exists in ROM only. |
|
178 * EFalse if plugin is not implemented. |
|
179 */ |
|
180 TBool NativeTransform(TBool aEncrypt, TDes& aInput, TDes& aOutput); |
158 |
181 |
159 public: // Data |
182 public: // Data |
160 /** Configuration valid -flag */ |
183 /** Configuration valid -flag */ |
161 TInt iConfigFlag; |
184 TInt iConfigFlag; |
162 /** The Autolock max.timeout */ |
185 /** The Autolock max.timeout */ |
165 TSCPSecCode iSecCode; |
188 TSCPSecCode iSecCode; |
166 /** The name of the main configuration file */ |
189 /** The name of the main configuration file */ |
167 TFileName iConfigFileName; |
190 TFileName iConfigFileName; |
168 TInt iBlockedInOOS; |
191 TInt iBlockedInOOS; |
169 |
192 |
|
193 //Flag to check whether Configuration checked already |
|
194 TBool iConfigChecked; |
|
195 |
170 /** A ptr to a connected RFs, not owned */ |
196 /** A ptr to a connected RFs, not owned */ |
171 RFs* iFsSession; |
197 RFs* iFsSession; |
172 |
198 |
173 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
199 //#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS |
174 /** The enchanced security code stored on the server */ |
200 /** The enchanced security code stored on the server */ |
176 /** The amount of consecutive authentication failures */ |
202 /** The amount of consecutive authentication failures */ |
177 TInt iFailedAttempts; |
203 TInt iFailedAttempts; |
178 /** The time since the code has been blocked */ |
204 /** The time since the code has been blocked */ |
179 TBuf<KSCPMaxInt64Length> iBlockedAtTime; |
205 TBuf<KSCPMaxInt64Length> iBlockedAtTime; |
180 //#endif // __SAP_DEVICE_LOCK_ENHANCEMENTS |
206 //#endif // __SAP_DEVICE_LOCK_ENHANCEMENTS |
|
207 // Member to hold the encrypted/decrypted security code from Crpto HW encryption algorithm |
|
208 TSCPCryptoCode iCryptoCode; |
181 |
209 |
182 }; |
210 }; |
183 |
211 |
184 #endif // SCPCONFIGURATION_H |
212 #endif // SCPCONFIGURATION_H |
185 |
213 |