equal
deleted
inserted
replaced
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
14 // |
14 // |
15 |
15 |
16 #include "Tlsprovinterface.h" |
16 #include "Tlsprovinterface.h" |
17 #include "tlsprovider.h" |
17 #include "tlsprovider.h" |
18 #include <badesca.h> |
18 #include <badesca.h> |
|
19 #include <featdiscovery.h> |
|
20 #include <featureuids.h> |
19 |
21 |
20 // |
22 // |
21 // CTlsProvider |
23 // CTlsProvider |
22 // |
24 // |
23 |
25 |
280 if(TlsSessionPtr()) |
282 if(TlsSessionPtr()) |
281 { |
283 { |
282 ((TlsSessionPtr()->Attributes())->iMasterSecretInput).iClientRandom = (Attributes()->iMasterSecretInput).iClientRandom; |
284 ((TlsSessionPtr()->Attributes())->iMasterSecretInput).iClientRandom = (Attributes()->iMasterSecretInput).iClientRandom; |
283 } |
285 } |
284 |
286 |
|
287 TBool allowUntrustedCertificates = EFalse; |
|
288 allowUntrustedCertificates = CFeatureDiscovery::IsFeatureSupportedL(NFeature::KFeatureIdFfHttpAllowUntrustedCertificates); |
|
289 |
285 // Save old implementation object |
290 // Save old implementation object |
286 CTlsProviderImpl *oldTlsProviderImpl = iTlsProviderImpl; |
291 CTlsProviderImpl *oldTlsProviderImpl = iTlsProviderImpl; |
287 iTlsProviderImpl = NULL; |
292 iTlsProviderImpl = NULL; |
288 CleanupStack::PushL(oldTlsProviderImpl); |
293 CleanupStack::PushL(oldTlsProviderImpl); |
289 CTlsCryptoAttributes* oldAttr = oldTlsProviderImpl->Attributes(); |
294 CTlsCryptoAttributes* oldAttr = oldTlsProviderImpl->Attributes(); |
297 |
302 |
298 CTlsCryptoAttributes* oldAttr = oldTlsProviderImpl->Attributes(); |
303 CTlsCryptoAttributes* oldAttr = oldTlsProviderImpl->Attributes(); |
299 |
304 |
300 Attributes()->iProposedProtocol = oldAttr->iProposedProtocol; |
305 Attributes()->iProposedProtocol = oldAttr->iProposedProtocol; |
301 Attributes()->iProposedCiphers = oldAttr->iProposedCiphers; |
306 Attributes()->iProposedCiphers = oldAttr->iProposedCiphers; |
302 Attributes()->iDialogNonAttendedMode = oldAttr->iDialogNonAttendedMode; |
307 |
|
308 if( allowUntrustedCertificates ) |
|
309 { |
|
310 Attributes()->iDialogMode = oldAttr->iDialogMode; |
|
311 } |
|
312 else |
|
313 { |
|
314 Attributes()->iDialogNonAttendedMode = oldAttr->iDialogNonAttendedMode; |
|
315 } |
|
316 |
303 Attributes()->idomainName = oldAttr->idomainName; |
317 Attributes()->idomainName = oldAttr->idomainName; |
304 |
318 |
305 // Copy NULL ciphersuite setting |
319 // Copy NULL ciphersuite setting |
306 Attributes()->iAllowNullCipherSuites = oldAttr->iAllowNullCipherSuites; |
320 Attributes()->iAllowNullCipherSuites = oldAttr->iAllowNullCipherSuites; |
307 |
321 |
336 { |
350 { |
337 Attributes()->iProposedCiphers = (TlsSessionPtr()->Attributes())->iProposedCiphers; |
351 Attributes()->iProposedCiphers = (TlsSessionPtr()->Attributes())->iProposedCiphers; |
338 (Attributes()->iMasterSecretInput).iClientRandom = ((TlsSessionPtr()->Attributes())->iMasterSecretInput).iClientRandom; |
352 (Attributes()->iMasterSecretInput).iClientRandom = ((TlsSessionPtr()->Attributes())->iMasterSecretInput).iClientRandom; |
339 Attributes()->iProposedProtocol = (TlsSessionPtr()->Attributes())->iProposedProtocol; |
353 Attributes()->iProposedProtocol = (TlsSessionPtr()->Attributes())->iProposedProtocol; |
340 Attributes()->iNegotiatedProtocol = (TlsSessionPtr()->Attributes())->iNegotiatedProtocol; |
354 Attributes()->iNegotiatedProtocol = (TlsSessionPtr()->Attributes())->iNegotiatedProtocol; |
341 Attributes()->iDialogNonAttendedMode = (TlsSessionPtr()->Attributes())->iDialogNonAttendedMode; |
355 if( allowUntrustedCertificates ) |
|
356 { |
|
357 Attributes()->iDialogMode = (TlsSessionPtr()->Attributes())->iDialogMode; |
|
358 } |
|
359 else |
|
360 { |
|
361 Attributes()->iDialogNonAttendedMode = (TlsSessionPtr()->Attributes())->iDialogNonAttendedMode; |
|
362 } |
|
363 |
342 Attributes()->iSessionNameAndID.iServerName = (TlsSessionPtr()->Attributes())->iSessionNameAndID.iServerName; |
364 Attributes()->iSessionNameAndID.iServerName = (TlsSessionPtr()->Attributes())->iSessionNameAndID.iServerName; |
343 Attributes()->iSessionNameAndID.iSessionId = (TlsSessionPtr()->Attributes())->iSessionNameAndID.iSessionId; |
365 Attributes()->iSessionNameAndID.iSessionId = (TlsSessionPtr()->Attributes())->iSessionNameAndID.iSessionId; |
344 |
366 |
345 } |
367 } |
346 iTlsSession = NULL; |
368 iTlsSession = NULL; |