1 /* |
1 /* |
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
46 ESidToPackage, // accessible by all clients |
46 ESidToPackage, // accessible by all clients |
47 ESeparatorMinimumWriteUserData, // accessible by NetworkServices + WriteUserData clients only |
47 ESeparatorMinimumWriteUserData, // accessible by NetworkServices + WriteUserData clients only |
48 ESeparatorMinimumTCB, // accessible by TCB clients only |
48 ESeparatorMinimumTCB, // accessible by TCB clients only |
49 ESeparatorMinimumReadUserData2, // accessible by ReadUserData clients only |
49 ESeparatorMinimumReadUserData2, // accessible by ReadUserData clients only |
50 ESetComponentState, // requests coming from SIF |
50 ESetComponentState, // requests coming from SIF |
|
51 EAddAppRegInfo, // TCB only |
51 ESeparatorEndAll, // not supported from there on |
52 ESeparatorEndAll, // not supported from there on |
52 }; |
53 }; |
53 |
54 |
54 const TUint8 CSisRegistryServer::iElementsIndex[iRangeCount] = |
55 const TUint8 CSisRegistryServer::iElementsIndex[iRangeCount] = |
55 { |
56 { |
62 0, // all clients can have access |
63 0, // all clients can have access |
63 4, // WriteUserData clients only |
64 4, // WriteUserData clients only |
64 2, // Used by SWIS only, so TCB is needed - check on cap and SID. |
65 2, // Used by SWIS only, so TCB is needed - check on cap and SID. |
65 1, // ReadUserData clients only |
66 1, // ReadUserData clients only |
66 5, // requests coming from SIF |
67 5, // requests coming from SIF |
|
68 6, // all clients having TCB |
67 CPolicyServer::ENotSupported, |
69 CPolicyServer::ENotSupported, |
68 }; |
70 }; |
69 |
71 |
70 const CPolicyServer::TPolicyElement CSisRegistryServer::iPolicyElements[] = |
72 const CPolicyServer::TPolicyElement CSisRegistryServer::iPolicyElements[] = |
71 { |
73 { |
73 {_INIT_SECURITY_POLICY_C1(ECapabilityReadUserData), CPolicyServer::EFailClient}, |
75 {_INIT_SECURITY_POLICY_C1(ECapabilityReadUserData), CPolicyServer::EFailClient}, |
74 {_INIT_SECURITY_POLICY_S1(KSwisSecureId, ECapabilityTCB), CPolicyServer::EFailClient}, |
76 {_INIT_SECURITY_POLICY_S1(KSwisSecureId, ECapabilityTCB), CPolicyServer::EFailClient}, |
75 {_INIT_SECURITY_POLICY_S0(KDaemonSecureId), CPolicyServer::EFailClient}, |
77 {_INIT_SECURITY_POLICY_S0(KDaemonSecureId), CPolicyServer::EFailClient}, |
76 {_INIT_SECURITY_POLICY_C2(ECapabilityWriteUserData, ECapabilityNetworkServices), CPolicyServer::EFailClient}, |
78 {_INIT_SECURITY_POLICY_C2(ECapabilityWriteUserData, ECapabilityNetworkServices), CPolicyServer::EFailClient}, |
77 {_INIT_SECURITY_POLICY_S0(KSifServerSecureId), CPolicyServer::EFailClient}, |
79 {_INIT_SECURITY_POLICY_S0(KSifServerSecureId), CPolicyServer::EFailClient}, |
|
80 {_INIT_SECURITY_POLICY_C1(ECapabilityTCB), CPolicyServer::EFailClient}, |
78 }; |
81 }; |
79 |
82 |
80 const CPolicyServer::TPolicy CSisRegistryServer::iPolicy = |
83 const CPolicyServer::TPolicy CSisRegistryServer::iPolicy = |
81 { |
84 { |
82 CPolicyServer::EAlwaysPass, // so that any client can connect |
85 CPolicyServer::EAlwaysPass, // so that any client can connect |
119 CSecurityPolicy::ReleaseResource(); |
122 CSecurityPolicy::ReleaseResource(); |
120 delete iShutdown; |
123 delete iShutdown; |
121 iShutdown = NULL; //required in case the server dies before the session |
124 iShutdown = NULL; //required in case the server dies before the session |
122 } |
125 } |
123 |
126 |
124 CSession2* CSisRegistryServer::NewSessionL(const TVersion& aClientVersion, const RMessage2&) const |
127 CSession2* CSisRegistryServer::NewSessionL(const TVersion& aClientVersion, const RMessage2& aMessage) const |
125 // |
128 // |
126 // Create a new client session. This should really check the version number. |
129 // Create a new client session. This should really check the version number. |
127 // |
130 // |
128 { |
131 { |
129 if (aClientVersion == TVersion(1,0,0)) |
132 if (aClientVersion == TVersion(1,0,0)) |
130 { |
133 { |
131 return new(ELeave) CSisRegistrySession(); |
134 return new(ELeave) CSisRegistrySession(aMessage.SecureId()); |
132 } |
135 } |
133 else |
136 else |
134 { |
137 { |
135 User::Leave(KErrCouldNotConnect); |
138 User::Leave(KErrCouldNotConnect); |
136 return NULL; |
139 return NULL; |