|
1 /* |
|
2 * Copyright (c) 2008 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 "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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 /** |
|
20 @file |
|
21 */ |
|
22 #ifndef __GENERICSERVERSECURITYPOLICY_H__ |
|
23 #define __GENERICSERVERSECURITYPOLICY_H__ |
|
24 |
|
25 const TUint KGenericServerRangeCount = 2; //16; |
|
26 |
|
27 const TInt KGenericServerRanges[KGenericServerRangeCount] = |
|
28 { |
|
29 0, 16 |
|
30 }; |
|
31 /* |
|
32 EGenericCreateHostResolverSubSession, // 0 = Alway fail |
|
33 EGenericCreateRegistrySubSession, // 1 = Local Services |
|
34 EGenericRegistrySearch, // 2 = Always pass |
|
35 EBTRegistryRetrieveDevice, // 3 = Always fail |
|
36 EBTRegistryAddDevice, // 4 = Always pass |
|
37 EBTRegistryModifyBluetoothName, // 5 = Write Device Data |
|
38 EBTRegistryModifyFriendlyName, // 6 = Always pass |
|
39 EBTRegistryModifyNamelessDevice, // 7 = Write Device Data |
|
40 EBTRegistryDeleteDevices, // 8 = Always pass |
|
41 EBTRegistryDeleteLinkKey, // 9 = Write Device Data |
|
42 EBTRegistryCloseView, // 10 = Always pass |
|
43 EBTRegistryUpdateLocalDevice, // 11 = Write Device Data |
|
44 EBTRegistryGetCommPortSettings, // 12 = Always pass |
|
45 EBTHostResolverDeviceRequest, // 13 = Always fail |
|
46 EGenericSetHeapFailure, // 14 = Local Services |
|
47 // If new function enums are added, the following value needs to |
|
48 // increase to be <last function number> + 1. |
|
49 // This defines a final range that extends from the first invalid |
|
50 // function number to KMaxTInt, and protects against attempts to |
|
51 // attack the server with invalid functions. |
|
52 |
|
53 EGenericSubSessionCount+1 // 15 = CPolicyServer::ENotSupported for all other fns. |
|
54 }; |
|
55 */ |
|
56 |
|
57 /** Index numbers into KGenericServerElements[] */ |
|
58 const TInt KPolicyAlwaysFail = 0; |
|
59 const TInt KPolicyLocalServices = 1; |
|
60 const TInt KPolicyAlwaysPass = 2; |
|
61 const TInt KPolicyWriteDeviceData = 3; |
|
62 |
|
63 /**Mapping IPCs to policy element */ |
|
64 const TUint8 KGenericServerElementsIndex[KGenericServerRangeCount] = |
|
65 { |
|
66 KPolicyAlwaysPass, KPolicyAlwaysPass |
|
67 |
|
68 // KPolicyAlwaysFail, /** EGenericCreateHostResolverSubSession */ |
|
69 // KPolicyLocalServices, /** EGenericCreateRegistrySubSession */ |
|
70 /** EGenericCreateCommPortSettingsSubSession */ |
|
71 /** EGenericCreateLocalDeviceSubSession */ |
|
72 // KPolicyAlwaysPass, /** EGenericRegistrySearch */ |
|
73 /** EGenericExtractRegistryDataIntoServer */ |
|
74 /** EGenericRetrieveRegistryData */ |
|
75 /** EGenericCloseSubSession */ |
|
76 /** EGenericCancelRequest */ |
|
77 // KPolicyAlwaysFail, /** EBTRegistryRetrieveDevice */ |
|
78 // KPolicyAlwaysPass, /** EBTRegistryAddDevice */ |
|
79 /** EBTRegistryGetNamelessDevice */ |
|
80 // KPolicyWriteDeviceData, /** EBTRegistryModifyBluetoothName */ |
|
81 // KPolicyAlwaysPass, /** EBTRegistryModifyFriendlyName */ |
|
82 // KPolicyWriteDeviceData, /** EBTRegistryModifyNamelessDevice */ |
|
83 // KPolicyAlwaysPass, /** EBTRegistryDeleteDevices */ |
|
84 // KPolicyWriteDeviceData, /** EBTRegistryDeleteLinkKey */ |
|
85 /** EBTRegistryUnpairView */ |
|
86 // KPolicyAlwaysPass, /** EBTRegistryCloseView */ |
|
87 /** EBTRegistryGetLocalDevice */ |
|
88 // KPolicyWriteDeviceData, /** EBTRegistryUpdateLocalDevice */ |
|
89 // KPolicyAlwaysPass, /** EBTRegistryGetCommPortSettings */ |
|
90 /** EBTRegistryUpdateCommPortSettings */ |
|
91 /** EBTRegistryDeleteCommPortSettings */ |
|
92 // KPolicyAlwaysFail, /** EBTHostResolverDeviceRequest */ |
|
93 /** EBTHostResolverGetNextDeviceRequest */ |
|
94 /** EBTHostResolverDeviceModifyDevice */ |
|
95 /** EBTHostResolverNotifyRequest */ |
|
96 // KPolicyLocalServices, /** EGenericSetHeapFailure */ |
|
97 /** EGenericSubSessionCount */ |
|
98 // CPolicyServer::ENotSupported /** EGenericCreateSecManSubSession */ |
|
99 /** EGenericCreateSecuritySettingsSubSession */ |
|
100 /** EGenericCreateBasebandSecuritySubSession */ |
|
101 /** EBTSecManAccessRequest */ |
|
102 /** EBTSecuritySettingsRegister */ |
|
103 /** EBTSecuritySettingsUnregister */ |
|
104 /** EBTBasebandSecurityLinkKeyRequest */ |
|
105 /** EBTBasebandSecurityNewLinkKey */ |
|
106 /** EBTBasebandSecurityPinRequest */ |
|
107 /** EBTBasebandSecurityNewLinkState */ |
|
108 /** EBTBasebandSecurityHCIRequestHandler */ |
|
109 /** EBTBasebandSecurityNameRequestResponse */ |
|
110 /** ...and onwards to KMaxTInt */ |
|
111 }; |
|
112 |
|
113 /** Individual policy elements */ |
|
114 const CPolicyServer::TPolicyElement KGenericServerElements[] = |
|
115 { |
|
116 /** the EFailClient means that the if the check fails the CheckFailed method with return KErrPermissionDenied */ |
|
117 { |
|
118 _INIT_SECURITY_POLICY_FAIL |
|
119 }, /** policyAlwaysFail */ |
|
120 { |
|
121 _INIT_SECURITY_POLICY_C1(ECapabilityLocalServices), |
|
122 CPolicyServer::EFailClient |
|
123 }, /** policyLocalService */ |
|
124 { |
|
125 _INIT_SECURITY_POLICY_PASS |
|
126 }, /** policyAlwaysPass */ |
|
127 { |
|
128 _INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData), |
|
129 CPolicyServer::EFailClient |
|
130 } /** policyWriteDevData */ |
|
131 }; |
|
132 |
|
133 /** Main policy */ |
|
134 const CPolicyServer::TPolicy KGenericServerPolicy = |
|
135 { |
|
136 CPolicyServer::EAlwaysPass, /** Specifies all connect attempts should pass */ |
|
137 KGenericServerRangeCount, |
|
138 KGenericServerRanges, |
|
139 KGenericServerElementsIndex, |
|
140 KGenericServerElements, |
|
141 }; |
|
142 |
|
143 #endif //__GENERICSERVERSECURITYPOLICY_H__ |