|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Name : sipsecplugincontext.cpp |
|
15 // Part of : SIPSec/DigestPlugin |
|
16 // Version : SIP/6.0 |
|
17 // |
|
18 |
|
19 |
|
20 |
|
21 #include "sipsecplugincontext.h" |
|
22 #include "siprequest.h" |
|
23 #include "sipresponse.h" |
|
24 #include "sipsecdigestcache.h" |
|
25 #include "MSIPSecSecurityMechanismObserver.h" |
|
26 #include "sipsecurityserverheader.h" |
|
27 |
|
28 const TInt KSIPSecHeaderOffset = _FOFF( CSIPHeaderBase,iLink ); |
|
29 |
|
30 // ============================ MEMBER FUNCTIONS ============================== |
|
31 |
|
32 |
|
33 // ---------------------------------------------------------------------------- |
|
34 // TSIPSecPluginContext::TSIPSecPluginContext |
|
35 // ---------------------------------------------------------------------------- |
|
36 // |
|
37 TSIPSecPluginContext::TSIPSecPluginContext( CSIPSecDigestPlugin& aPlugin, |
|
38 const CUri8& aRemoteTarget, |
|
39 const TDesC8& aOutboundProxy, |
|
40 MSIPSecUser& aUser, |
|
41 TRegistrationId aRegistrationId, |
|
42 TTransactionId aTransactionId ) : |
|
43 iPlugin( aPlugin ), |
|
44 iRemoteTarget( aRemoteTarget ), |
|
45 iOutboundProxy( aOutboundProxy ), |
|
46 iUser( aUser ), |
|
47 iRegistrationId( aRegistrationId ), |
|
48 iTransactionId( aTransactionId ) |
|
49 { |
|
50 } |
|
51 |
|
52 // ---------------------------------------------------------------------------- |
|
53 // TSIPSecPluginContext::AlsoTrustedUser |
|
54 // ---------------------------------------------------------------------------- |
|
55 // |
|
56 TBool TSIPSecPluginContext::AlsoTrustedUser() |
|
57 { |
|
58 return ETrue; |
|
59 } |
|
60 |
|
61 // ---------------------------------------------------------------------------- |
|
62 // TSIPSecPluginContext::RemoteTarget |
|
63 // ---------------------------------------------------------------------------- |
|
64 // |
|
65 const CUri8& TSIPSecPluginContext::RemoteTarget() const |
|
66 { |
|
67 return iRemoteTarget; |
|
68 } |
|
69 |
|
70 // ---------------------------------------------------------------------------- |
|
71 // TSIPSecPluginContext::OutboundProxy |
|
72 // ---------------------------------------------------------------------------- |
|
73 // |
|
74 const TDesC8& TSIPSecPluginContext::OutboundProxy() const |
|
75 { |
|
76 return iOutboundProxy; |
|
77 } |
|
78 |
|
79 // ---------------------------------------------------------------------------- |
|
80 // TSIPSecPluginContext::SIPSecUser |
|
81 // ---------------------------------------------------------------------------- |
|
82 // |
|
83 MSIPSecUser& TSIPSecPluginContext::SIPSecUser() |
|
84 { |
|
85 return iUser; |
|
86 } |
|
87 |
|
88 // ---------------------------------------------------------------------------- |
|
89 // TSIPSecPluginContext::Plugin |
|
90 // ---------------------------------------------------------------------------- |
|
91 // |
|
92 CSIPSecDigestPlugin& TSIPSecPluginContext::Plugin() const |
|
93 { |
|
94 return iPlugin; |
|
95 } |
|
96 |
|
97 // ---------------------------------------------------------------------------- |
|
98 // TSIPSecPluginContext::RegistrationId |
|
99 // ---------------------------------------------------------------------------- |
|
100 // |
|
101 TRegistrationId TSIPSecPluginContext::RegistrationId() const |
|
102 { |
|
103 return iRegistrationId; |
|
104 } |
|
105 |
|
106 // ---------------------------------------------------------------------------- |
|
107 // TSIPSecPluginContext::TransactionId |
|
108 // ---------------------------------------------------------------------------- |
|
109 // |
|
110 TTransactionId TSIPSecPluginContext::TransactionId() const |
|
111 { |
|
112 return iTransactionId; |
|
113 } |
|
114 |
|
115 // ============================ MEMBER FUNCTIONS =============================== |
|
116 |
|
117 // ---------------------------------------------------------------------------- |
|
118 // TSIPSecPluginCtxRequest::TSIPSecPluginCtxRequest |
|
119 // ---------------------------------------------------------------------------- |
|
120 // |
|
121 TSIPSecPluginCtxRequest::TSIPSecPluginCtxRequest( CSIPSecDigestPlugin& aPlugin, |
|
122 const CUri8& aRemoteTarget, |
|
123 const TDesC8& aOutboundProxy, |
|
124 CSIPRequest& aSIPRequest, |
|
125 MSIPSecUser& aUser, |
|
126 TRegistrationId aRegistrationId, |
|
127 TTransactionId aTransactionId ) : |
|
128 TSIPSecPluginContext( aPlugin, |
|
129 aRemoteTarget, |
|
130 aOutboundProxy, |
|
131 aUser, |
|
132 aRegistrationId, |
|
133 aTransactionId ), |
|
134 iSIPRequest( aSIPRequest ) |
|
135 { |
|
136 } |
|
137 |
|
138 // ---------------------------------------------------------------------------- |
|
139 // TSIPSecPluginCtxRequest::SIPRequest |
|
140 // ---------------------------------------------------------------------------- |
|
141 // |
|
142 CSIPRequest& TSIPSecPluginCtxRequest::SIPRequest() |
|
143 { |
|
144 return iSIPRequest; |
|
145 } |
|
146 |
|
147 |
|
148 |
|
149 // ============================ MEMBER FUNCTIONS ============================== |
|
150 |
|
151 // ---------------------------------------------------------------------------- |
|
152 // TSIPSecPluginCtxResponse::TSIPSecPluginCtxResponse |
|
153 // ---------------------------------------------------------------------------- |
|
154 // |
|
155 TSIPSecPluginCtxResponse::TSIPSecPluginCtxResponse( |
|
156 CSIPSecDigestPlugin& aPlugin, |
|
157 const CUri8& aRemoteTarget, |
|
158 const TDesC8& aOutboundProxy, |
|
159 CSIPResponse& aSIPResponse, |
|
160 CSIPSecDigestCache& aCache, |
|
161 MSIPSecSecurityMechanismObserver& aObserver, |
|
162 MSIPSecUser& aUser, |
|
163 TRegistrationId aRegistrationId, |
|
164 TTransactionId aTransactionId ) : |
|
165 |
|
166 TSIPSecPluginContext( aPlugin, |
|
167 aRemoteTarget, |
|
168 aOutboundProxy, |
|
169 aUser, |
|
170 aRegistrationId, |
|
171 aTransactionId ), |
|
172 iCache( aCache ), |
|
173 iObserver( aObserver ), |
|
174 iSIPResponse( aSIPResponse ) |
|
175 { |
|
176 } |
|
177 |
|
178 // ---------------------------------------------------------------------------- |
|
179 // TSIPSecPluginCtxResponse::Cache |
|
180 // ---------------------------------------------------------------------------- |
|
181 // |
|
182 CSIPSecDigestCache& TSIPSecPluginCtxResponse::Cache() |
|
183 { |
|
184 return iCache; |
|
185 } |
|
186 |
|
187 // ---------------------------------------------------------------------------- |
|
188 // TSIPSecPluginCtxResponse::Observer |
|
189 // ---------------------------------------------------------------------------- |
|
190 // |
|
191 MSIPSecSecurityMechanismObserver& TSIPSecPluginCtxResponse::Observer() |
|
192 { |
|
193 return iObserver; |
|
194 } |
|
195 |
|
196 |
|
197 // ---------------------------------------------------------------------------- |
|
198 // TSIPSecPluginCtxResponse::SIPResponse |
|
199 // ---------------------------------------------------------------------------- |
|
200 // |
|
201 CSIPResponse& TSIPSecPluginCtxResponse::SIPResponse() |
|
202 { |
|
203 return iSIPResponse; |
|
204 } |
|
205 |
|
206 |
|
207 |
|
208 // ============================ MEMBER FUNCTIONS ============================== |
|
209 |
|
210 // ---------------------------------------------------------------------------- |
|
211 // TSIPSecPluginCtxVerify::TSIPSecPluginCtxVerify |
|
212 // ---------------------------------------------------------------------------- |
|
213 // |
|
214 TSIPSecPluginCtxVerify::TSIPSecPluginCtxVerify( |
|
215 CSIPSecDigestPlugin& aPlugin, |
|
216 const CUri8& aRemoteTarget, |
|
217 const TDesC8& aOutboundProxy, |
|
218 CSIPRequest& aSIPRequest, |
|
219 CSIPSecurityVerifyHeader& aVerifyHeader, |
|
220 RPointerArray<CSIPSecurityServerHeader>& aServerHeaders, |
|
221 MSIPSecUser& aUser, |
|
222 TRegistrationId aRegistrationId ) : |
|
223 TSIPSecPluginCtxRequest( aPlugin, |
|
224 aRemoteTarget, |
|
225 aOutboundProxy, |
|
226 aSIPRequest, |
|
227 aUser, |
|
228 aRegistrationId, |
|
229 KEmptyTransactionId ), |
|
230 iVerifyHeader( aVerifyHeader ), |
|
231 iServerHeaders( KSIPSecHeaderOffset ) |
|
232 { |
|
233 for ( TInt i = 0; i < aServerHeaders.Count() ; ++i ) |
|
234 { |
|
235 iServerHeaders.AddLast( *aServerHeaders[ i ] ); |
|
236 } |
|
237 } |
|
238 |
|
239 // ---------------------------------------------------------------------------- |
|
240 // TSIPSecPluginCtxVerify::SecurityVerifyHeader |
|
241 // ---------------------------------------------------------------------------- |
|
242 // |
|
243 CSIPSecurityVerifyHeader& TSIPSecPluginCtxVerify::SecurityVerifyHeader() |
|
244 { |
|
245 return iVerifyHeader; |
|
246 } |
|
247 |
|
248 // ---------------------------------------------------------------------------- |
|
249 // TSIPSecPluginCtxVerify::SecurityServerHeaders |
|
250 // ---------------------------------------------------------------------------- |
|
251 // |
|
252 TSglQue<CSIPHeaderBase>& TSIPSecPluginCtxVerify::SecurityServerHeaders() |
|
253 { |
|
254 return iServerHeaders; |
|
255 } |
|
256 |
|
257 |
|
258 |
|
259 // ============================ MEMBER FUNCTIONS ============================== |
|
260 |
|
261 // ---------------------------------------------------------------------------- |
|
262 // TSIPSecPluginCtxInfo::TSIPSecPluginCtxInfo |
|
263 // ---------------------------------------------------------------------------- |
|
264 // |
|
265 TSIPSecPluginCtxInfo::TSIPSecPluginCtxInfo( |
|
266 CSIPSecDigestPlugin& aPlugin, |
|
267 const CUri8& aRemoteTarget, |
|
268 const TDesC8& aOutboundProxy, |
|
269 CSIPResponse& aSIPResponse, |
|
270 CSIPAuthenticationInfoHeader& aAuthInfo, |
|
271 CSIPSecDigestCache& aCache, |
|
272 MSIPSecSecurityMechanismObserver& aObserver, |
|
273 MSIPSecUser& aUser, |
|
274 TRegistrationId aRegistrationId ) : |
|
275 TSIPSecPluginCtxResponse( aPlugin, aRemoteTarget, aOutboundProxy, |
|
276 aSIPResponse, aCache, aObserver, aUser, |
|
277 aRegistrationId, KEmptyTransactionId ), |
|
278 iAuthInfo( aAuthInfo ) |
|
279 { |
|
280 } |
|
281 |
|
282 // ---------------------------------------------------------------------------- |
|
283 // TSIPSecPluginCtxInfo::AuthenticationInfoHeader |
|
284 // ---------------------------------------------------------------------------- |
|
285 // |
|
286 CSIPAuthenticationInfoHeader& TSIPSecPluginCtxInfo::AuthenticationInfoHeader() |
|
287 { |
|
288 return iAuthInfo; |
|
289 } |
|
290 |
|
291 // ---------------------------------------------------------------------------- |
|
292 // TSIPSecPluginCtxInfo::AlsoTrustedUser |
|
293 // Let only the exact SIPSec user to process the Authentication-Info. |
|
294 // ---------------------------------------------------------------------------- |
|
295 // |
|
296 TBool TSIPSecPluginCtxInfo::AlsoTrustedUser() |
|
297 { |
|
298 return EFalse; |
|
299 } |
|
300 |
|
301 // End of File |