sl@0
|
1 |
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// e32\euser\us_secure.cpp
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#include <u32exec.h>
|
sl@0
|
19 |
|
sl@0
|
20 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
21 |
EXPORT_C TInt PlatSec::EmitDiagnostic(TPlatSecDiagnostic& aDiagnostic, const char* aContextText)
|
sl@0
|
22 |
{
|
sl@0
|
23 |
if(aContextText == KSuppressPlatSecDiagnosticMagicValue)
|
sl@0
|
24 |
return Exec::PlatSecDiagnostic(NULL);
|
sl@0
|
25 |
aDiagnostic.iContextText = aContextText;
|
sl@0
|
26 |
if(aContextText)
|
sl@0
|
27 |
aDiagnostic.iContextTextLength=User::StringLength((const TUint8*)aContextText);
|
sl@0
|
28 |
return Exec::PlatSecDiagnostic(&aDiagnostic);
|
sl@0
|
29 |
}
|
sl@0
|
30 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
31 |
EXPORT_C TInt PlatSec::EmitDiagnostic(TPlatSecDiagnostic& /*aDiagnostic*/, const char* /*aContextText*/)
|
sl@0
|
32 |
{
|
sl@0
|
33 |
return Exec::PlatSecDiagnostic(NULL);
|
sl@0
|
34 |
}
|
sl@0
|
35 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
36 |
|
sl@0
|
37 |
EXPORT_C TInt PlatSec::EmitDiagnostic()
|
sl@0
|
38 |
{
|
sl@0
|
39 |
return Exec::PlatSecDiagnostic(NULL);
|
sl@0
|
40 |
}
|
sl@0
|
41 |
|
sl@0
|
42 |
EXPORT_C TSecureId RProcess::SecureId() const
|
sl@0
|
43 |
{
|
sl@0
|
44 |
SSecurityInfo info;
|
sl@0
|
45 |
Exec::ProcessSecurityInfo(iHandle,info);
|
sl@0
|
46 |
return info.iSecureId;
|
sl@0
|
47 |
}
|
sl@0
|
48 |
|
sl@0
|
49 |
EXPORT_C TVendorId RProcess::VendorId() const
|
sl@0
|
50 |
{
|
sl@0
|
51 |
SSecurityInfo info;
|
sl@0
|
52 |
Exec::ProcessSecurityInfo(iHandle,info);
|
sl@0
|
53 |
return info.iVendorId;
|
sl@0
|
54 |
}
|
sl@0
|
55 |
|
sl@0
|
56 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
57 |
EXPORT_C TBool RProcess::DoHasCapability(TCapability aCapability, const char* aDiagnostic) const
|
sl@0
|
58 |
{
|
sl@0
|
59 |
SSecurityInfo info;
|
sl@0
|
60 |
Exec::ProcessSecurityInfo(iHandle,info);
|
sl@0
|
61 |
TCapabilitySet& caps = (TCapabilitySet&)info.iCaps;
|
sl@0
|
62 |
if(caps.HasCapability(aCapability))
|
sl@0
|
63 |
return ETrue;
|
sl@0
|
64 |
return KErrNone==PlatSec::CapabilityCheckFail(iHandle,aCapability,aDiagnostic);
|
sl@0
|
65 |
}
|
sl@0
|
66 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
67 |
EXPORT_C TBool RProcess::DoHasCapability(TCapability aCapability, const char* /*aDiagnostic*/) const
|
sl@0
|
68 |
{
|
sl@0
|
69 |
return DoHasCapability(aCapability);
|
sl@0
|
70 |
}
|
sl@0
|
71 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
72 |
|
sl@0
|
73 |
EXPORT_C TBool RProcess::DoHasCapability(TCapability aCapability) const
|
sl@0
|
74 |
{
|
sl@0
|
75 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
76 |
return DoHasCapability(aCapability, NULL);
|
sl@0
|
77 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
78 |
SSecurityInfo info;
|
sl@0
|
79 |
Exec::ProcessSecurityInfo(iHandle,info);
|
sl@0
|
80 |
TCapabilitySet& caps = (TCapabilitySet&)info.iCaps;
|
sl@0
|
81 |
if(caps.HasCapability(aCapability))
|
sl@0
|
82 |
return ETrue;
|
sl@0
|
83 |
return (PlatSec::EmitDiagnostic() == KErrNone);
|
sl@0
|
84 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
85 |
}
|
sl@0
|
86 |
|
sl@0
|
87 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
88 |
EXPORT_C TBool RProcess::DoHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const
|
sl@0
|
89 |
{
|
sl@0
|
90 |
SSecurityInfo info;
|
sl@0
|
91 |
Exec::ProcessSecurityInfo(iHandle,info);
|
sl@0
|
92 |
TCapabilitySet& caps = (TCapabilitySet&)info.iCaps;
|
sl@0
|
93 |
if(caps.HasCapability(aCapability1) && caps.HasCapability(aCapability2))
|
sl@0
|
94 |
return ETrue;
|
sl@0
|
95 |
TCapabilitySet missing(aCapability1,aCapability2);
|
sl@0
|
96 |
missing.Remove(caps);
|
sl@0
|
97 |
return KErrNone==PlatSec::CapabilityCheckFail(iHandle,missing,aDiagnostic);
|
sl@0
|
98 |
}
|
sl@0
|
99 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
100 |
EXPORT_C TBool RProcess::DoHasCapability(TCapability aCapability1, TCapability aCapability2, const char* /*aDiagnostic*/) const
|
sl@0
|
101 |
{
|
sl@0
|
102 |
return DoHasCapability(aCapability1, aCapability2);
|
sl@0
|
103 |
}
|
sl@0
|
104 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
105 |
|
sl@0
|
106 |
EXPORT_C TBool RProcess::DoHasCapability(TCapability aCapability1, TCapability aCapability2) const
|
sl@0
|
107 |
{
|
sl@0
|
108 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
109 |
return DoHasCapability(aCapability1, aCapability2, NULL);
|
sl@0
|
110 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
111 |
SSecurityInfo info;
|
sl@0
|
112 |
Exec::ProcessSecurityInfo(iHandle, info);
|
sl@0
|
113 |
TCapabilitySet& caps = (TCapabilitySet&)info.iCaps;
|
sl@0
|
114 |
if(caps.HasCapability(aCapability1) && caps.HasCapability(aCapability2))
|
sl@0
|
115 |
return ETrue;
|
sl@0
|
116 |
return (PlatSec::EmitDiagnostic() == KErrNone);
|
sl@0
|
117 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
118 |
}
|
sl@0
|
119 |
|
sl@0
|
120 |
EXPORT_C TSecureId RThread::SecureId() const
|
sl@0
|
121 |
{
|
sl@0
|
122 |
SSecurityInfo info;
|
sl@0
|
123 |
Exec::ThreadSecurityInfo(iHandle,info);
|
sl@0
|
124 |
return info.iSecureId;
|
sl@0
|
125 |
}
|
sl@0
|
126 |
|
sl@0
|
127 |
EXPORT_C TVendorId RThread::VendorId() const
|
sl@0
|
128 |
{
|
sl@0
|
129 |
SSecurityInfo info;
|
sl@0
|
130 |
Exec::ThreadSecurityInfo(iHandle,info);
|
sl@0
|
131 |
return info.iVendorId;
|
sl@0
|
132 |
}
|
sl@0
|
133 |
|
sl@0
|
134 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
135 |
EXPORT_C TBool RThread::DoHasCapability(TCapability aCapability, const char* aDiagnostic) const
|
sl@0
|
136 |
{
|
sl@0
|
137 |
SSecurityInfo info;
|
sl@0
|
138 |
Exec::ThreadSecurityInfo(iHandle,info);
|
sl@0
|
139 |
TCapabilitySet& caps = (TCapabilitySet&)info.iCaps;
|
sl@0
|
140 |
if(caps.HasCapability(aCapability))
|
sl@0
|
141 |
return ETrue;
|
sl@0
|
142 |
return KErrNone==PlatSec::CapabilityCheckFail(iHandle,aCapability,aDiagnostic);
|
sl@0
|
143 |
}
|
sl@0
|
144 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
145 |
EXPORT_C TBool RThread::DoHasCapability(TCapability aCapability, const char* /*aDiagnostic*/) const
|
sl@0
|
146 |
{
|
sl@0
|
147 |
return DoHasCapability(aCapability);
|
sl@0
|
148 |
}
|
sl@0
|
149 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
150 |
|
sl@0
|
151 |
EXPORT_C TBool RThread::DoHasCapability(TCapability aCapability) const
|
sl@0
|
152 |
{
|
sl@0
|
153 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
154 |
return DoHasCapability(aCapability, NULL);
|
sl@0
|
155 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
156 |
SSecurityInfo info;
|
sl@0
|
157 |
Exec::ThreadSecurityInfo(iHandle, info);
|
sl@0
|
158 |
TCapabilitySet& caps = (TCapabilitySet&)info.iCaps;
|
sl@0
|
159 |
if(caps.HasCapability(aCapability))
|
sl@0
|
160 |
return ETrue;
|
sl@0
|
161 |
return (PlatSec::EmitDiagnostic() == KErrNone);
|
sl@0
|
162 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
163 |
}
|
sl@0
|
164 |
|
sl@0
|
165 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
166 |
EXPORT_C TBool RThread::DoHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const
|
sl@0
|
167 |
{
|
sl@0
|
168 |
SSecurityInfo info;
|
sl@0
|
169 |
Exec::ThreadSecurityInfo(iHandle,info);
|
sl@0
|
170 |
TCapabilitySet& caps = (TCapabilitySet&)info.iCaps;
|
sl@0
|
171 |
if(caps.HasCapability(aCapability1) && caps.HasCapability(aCapability2))
|
sl@0
|
172 |
return ETrue;
|
sl@0
|
173 |
TCapabilitySet missing(aCapability1,aCapability2);
|
sl@0
|
174 |
missing.Remove(caps);
|
sl@0
|
175 |
return KErrNone==PlatSec::CapabilityCheckFail(iHandle,missing,aDiagnostic);
|
sl@0
|
176 |
}
|
sl@0
|
177 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
178 |
EXPORT_C TBool RThread::DoHasCapability(TCapability aCapability1, TCapability aCapability2, const char* /*aDiagnostic*/) const
|
sl@0
|
179 |
{
|
sl@0
|
180 |
return DoHasCapability(aCapability1, aCapability2);
|
sl@0
|
181 |
}
|
sl@0
|
182 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
183 |
|
sl@0
|
184 |
EXPORT_C TBool RThread::DoHasCapability(TCapability aCapability1, TCapability aCapability2) const
|
sl@0
|
185 |
{
|
sl@0
|
186 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
187 |
return DoHasCapability(aCapability1, aCapability2, NULL);
|
sl@0
|
188 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
189 |
SSecurityInfo info;
|
sl@0
|
190 |
Exec::ThreadSecurityInfo(iHandle, info);
|
sl@0
|
191 |
TCapabilitySet& caps = (TCapabilitySet&)info.iCaps;
|
sl@0
|
192 |
if(caps.HasCapability(aCapability1) && caps.HasCapability(aCapability2))
|
sl@0
|
193 |
return ETrue;
|
sl@0
|
194 |
return (PlatSec::EmitDiagnostic() == KErrNone);
|
sl@0
|
195 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
196 |
}
|
sl@0
|
197 |
|
sl@0
|
198 |
|
sl@0
|
199 |
EXPORT_C TSecureId RMessagePtr2::SecureId() const
|
sl@0
|
200 |
{
|
sl@0
|
201 |
SSecurityInfo info;
|
sl@0
|
202 |
Exec::MessageSecurityInfo(iHandle,info);
|
sl@0
|
203 |
return info.iSecureId;
|
sl@0
|
204 |
}
|
sl@0
|
205 |
|
sl@0
|
206 |
EXPORT_C TVendorId RMessagePtr2::VendorId() const
|
sl@0
|
207 |
{
|
sl@0
|
208 |
SSecurityInfo info;
|
sl@0
|
209 |
Exec::MessageSecurityInfo(iHandle,info);
|
sl@0
|
210 |
return info.iVendorId;
|
sl@0
|
211 |
}
|
sl@0
|
212 |
|
sl@0
|
213 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
214 |
EXPORT_C TBool RMessagePtr2::DoHasCapability(TCapability aCapability, const char* aDiagnostic) const
|
sl@0
|
215 |
{
|
sl@0
|
216 |
SSecurityInfo info;
|
sl@0
|
217 |
Exec::MessageSecurityInfo(iHandle,info);
|
sl@0
|
218 |
TCapabilitySet& caps = (TCapabilitySet&)info.iCaps;
|
sl@0
|
219 |
if(caps.HasCapability(aCapability))
|
sl@0
|
220 |
return ETrue;
|
sl@0
|
221 |
return KErrNone==PlatSec::CapabilityCheckFail(*this,aCapability,aDiagnostic);
|
sl@0
|
222 |
}
|
sl@0
|
223 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
224 |
EXPORT_C TBool RMessagePtr2::DoHasCapability(TCapability aCapability, const char* /*aDiagnostic*/) const
|
sl@0
|
225 |
{
|
sl@0
|
226 |
return DoHasCapability(aCapability);
|
sl@0
|
227 |
}
|
sl@0
|
228 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
229 |
|
sl@0
|
230 |
EXPORT_C TBool RMessagePtr2::DoHasCapability(TCapability aCapability) const
|
sl@0
|
231 |
{
|
sl@0
|
232 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
233 |
return DoHasCapability(aCapability, NULL);
|
sl@0
|
234 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
235 |
SSecurityInfo info;
|
sl@0
|
236 |
Exec::MessageSecurityInfo(iHandle,info);
|
sl@0
|
237 |
TCapabilitySet& caps = (TCapabilitySet&)info.iCaps;
|
sl@0
|
238 |
if (caps.HasCapability(aCapability))
|
sl@0
|
239 |
return ETrue;
|
sl@0
|
240 |
return (PlatSec::EmitDiagnostic() == KErrNone);
|
sl@0
|
241 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
242 |
}
|
sl@0
|
243 |
|
sl@0
|
244 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
245 |
EXPORT_C TBool RMessagePtr2::DoHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic) const
|
sl@0
|
246 |
{
|
sl@0
|
247 |
SSecurityInfo info;
|
sl@0
|
248 |
Exec::MessageSecurityInfo(iHandle,info);
|
sl@0
|
249 |
TCapabilitySet& caps = (TCapabilitySet&)info.iCaps;
|
sl@0
|
250 |
if(caps.HasCapability(aCapability1) && caps.HasCapability(aCapability2))
|
sl@0
|
251 |
return ETrue;
|
sl@0
|
252 |
TCapabilitySet missing(aCapability1,aCapability2);
|
sl@0
|
253 |
missing.Remove(caps);
|
sl@0
|
254 |
return KErrNone==PlatSec::CapabilityCheckFail(*this,missing,aDiagnostic);
|
sl@0
|
255 |
}
|
sl@0
|
256 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
257 |
EXPORT_C TBool RMessagePtr2::DoHasCapability(TCapability aCapability1, TCapability aCapability2, const char* /*aDiagnostic*/) const
|
sl@0
|
258 |
{
|
sl@0
|
259 |
return DoHasCapability(aCapability1, aCapability2);
|
sl@0
|
260 |
}
|
sl@0
|
261 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
262 |
|
sl@0
|
263 |
EXPORT_C TBool RMessagePtr2::DoHasCapability(TCapability aCapability1, TCapability aCapability2) const
|
sl@0
|
264 |
{
|
sl@0
|
265 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
266 |
return DoHasCapability(aCapability1, aCapability2, NULL);
|
sl@0
|
267 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
268 |
SSecurityInfo info;
|
sl@0
|
269 |
Exec::MessageSecurityInfo(iHandle,info);
|
sl@0
|
270 |
TCapabilitySet& caps = (TCapabilitySet&)info.iCaps;
|
sl@0
|
271 |
if(caps.HasCapability(aCapability1) && caps.HasCapability(aCapability2))
|
sl@0
|
272 |
return ETrue;
|
sl@0
|
273 |
return (PlatSec::EmitDiagnostic() == KErrNone);
|
sl@0
|
274 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
275 |
}
|
sl@0
|
276 |
|
sl@0
|
277 |
EXPORT_C TSecureId User::CreatorSecureId()
|
sl@0
|
278 |
{
|
sl@0
|
279 |
SSecurityInfo info;
|
sl@0
|
280 |
Exec::CreatorSecurityInfo(info);
|
sl@0
|
281 |
return info.iSecureId;
|
sl@0
|
282 |
}
|
sl@0
|
283 |
|
sl@0
|
284 |
EXPORT_C TVendorId User::CreatorVendorId()
|
sl@0
|
285 |
{
|
sl@0
|
286 |
SSecurityInfo info;
|
sl@0
|
287 |
Exec::CreatorSecurityInfo(info);
|
sl@0
|
288 |
return info.iVendorId;
|
sl@0
|
289 |
}
|
sl@0
|
290 |
|
sl@0
|
291 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
292 |
EXPORT_C TBool User::DoCreatorHasCapability(TCapability aCapability, const char* aDiagnostic)
|
sl@0
|
293 |
{
|
sl@0
|
294 |
SSecurityInfo info;
|
sl@0
|
295 |
Exec::CreatorSecurityInfo(info);
|
sl@0
|
296 |
TCapabilitySet& caps = (TCapabilitySet&)info.iCaps;
|
sl@0
|
297 |
if(caps.HasCapability(aCapability))
|
sl@0
|
298 |
return ETrue;
|
sl@0
|
299 |
return KErrNone==PlatSec::CreatorCapabilityCheckFail(aCapability,aDiagnostic);
|
sl@0
|
300 |
}
|
sl@0
|
301 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
302 |
EXPORT_C TBool User::DoCreatorHasCapability(TCapability aCapability, const char* /*aDiagnostic*/)
|
sl@0
|
303 |
{
|
sl@0
|
304 |
return DoCreatorHasCapability(aCapability);
|
sl@0
|
305 |
}
|
sl@0
|
306 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
307 |
|
sl@0
|
308 |
EXPORT_C TBool User::DoCreatorHasCapability(TCapability aCapability)
|
sl@0
|
309 |
{
|
sl@0
|
310 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
311 |
return DoCreatorHasCapability(aCapability, NULL);
|
sl@0
|
312 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
313 |
SSecurityInfo info;
|
sl@0
|
314 |
Exec::CreatorSecurityInfo(info);
|
sl@0
|
315 |
TCapabilitySet& caps = (TCapabilitySet&)info.iCaps;
|
sl@0
|
316 |
if(caps.HasCapability(aCapability))
|
sl@0
|
317 |
return ETrue;
|
sl@0
|
318 |
return (PlatSec::EmitDiagnostic() == KErrNone);
|
sl@0
|
319 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
320 |
}
|
sl@0
|
321 |
|
sl@0
|
322 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
323 |
EXPORT_C TBool User::DoCreatorHasCapability(TCapability aCapability1, TCapability aCapability2, const char* aDiagnostic)
|
sl@0
|
324 |
{
|
sl@0
|
325 |
SSecurityInfo info;
|
sl@0
|
326 |
Exec::CreatorSecurityInfo(info);
|
sl@0
|
327 |
TCapabilitySet& caps = (TCapabilitySet&)info.iCaps;
|
sl@0
|
328 |
if(caps.HasCapability(aCapability1) && caps.HasCapability(aCapability2))
|
sl@0
|
329 |
return ETrue;
|
sl@0
|
330 |
TCapabilitySet missing(aCapability1,aCapability2);
|
sl@0
|
331 |
missing.Remove(caps);
|
sl@0
|
332 |
return KErrNone==PlatSec::CreatorCapabilityCheckFail(missing,aDiagnostic);
|
sl@0
|
333 |
}
|
sl@0
|
334 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
335 |
EXPORT_C TBool User::DoCreatorHasCapability(TCapability aCapability1, TCapability aCapability2, const char* /*aDiagnostic*/)
|
sl@0
|
336 |
{
|
sl@0
|
337 |
return DoCreatorHasCapability(aCapability1, aCapability2);
|
sl@0
|
338 |
}
|
sl@0
|
339 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
340 |
|
sl@0
|
341 |
EXPORT_C TBool User::DoCreatorHasCapability(TCapability aCapability1, TCapability aCapability2)
|
sl@0
|
342 |
{
|
sl@0
|
343 |
#ifndef __REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
344 |
return DoCreatorHasCapability(aCapability1, aCapability2, NULL);
|
sl@0
|
345 |
#else //__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
346 |
SSecurityInfo info;
|
sl@0
|
347 |
Exec::CreatorSecurityInfo(info);
|
sl@0
|
348 |
TCapabilitySet& caps = (TCapabilitySet&)info.iCaps;
|
sl@0
|
349 |
if(caps.HasCapability(aCapability1) && caps.HasCapability(aCapability2))
|
sl@0
|
350 |
return ETrue;
|
sl@0
|
351 |
return (PlatSec::EmitDiagnostic() == KErrNone);
|
sl@0
|
352 |
#endif //!__REMOVE_PLATSEC_DIAGNOSTICS__
|
sl@0
|
353 |
}
|