equal
deleted
inserted
replaced
1 // Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2003-2009 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> |
|
21 |
19 |
22 // |
20 // |
23 // CTlsProvider |
21 // CTlsProvider |
24 // |
22 // |
25 |
23 |
282 if(TlsSessionPtr()) |
280 if(TlsSessionPtr()) |
283 { |
281 { |
284 ((TlsSessionPtr()->Attributes())->iMasterSecretInput).iClientRandom = (Attributes()->iMasterSecretInput).iClientRandom; |
282 ((TlsSessionPtr()->Attributes())->iMasterSecretInput).iClientRandom = (Attributes()->iMasterSecretInput).iClientRandom; |
285 } |
283 } |
286 |
284 |
287 TBool allowUntrustedCertificates = EFalse; |
|
288 allowUntrustedCertificates = CFeatureDiscovery::IsFeatureSupportedL(NFeature::KFeatureIdFfHttpAllowUntrustedCertificates); |
|
289 |
|
290 // Save old implementation object |
285 // Save old implementation object |
291 CTlsProviderImpl *oldTlsProviderImpl = iTlsProviderImpl; |
286 CTlsProviderImpl *oldTlsProviderImpl = iTlsProviderImpl; |
292 iTlsProviderImpl = NULL; |
287 iTlsProviderImpl = NULL; |
293 CleanupStack::PushL(oldTlsProviderImpl); |
288 CleanupStack::PushL(oldTlsProviderImpl); |
294 CTlsCryptoAttributes* oldAttr = oldTlsProviderImpl->Attributes(); |
289 CTlsCryptoAttributes* oldAttr = oldTlsProviderImpl->Attributes(); |
302 |
297 |
303 CTlsCryptoAttributes* oldAttr = oldTlsProviderImpl->Attributes(); |
298 CTlsCryptoAttributes* oldAttr = oldTlsProviderImpl->Attributes(); |
304 |
299 |
305 Attributes()->iProposedProtocol = oldAttr->iProposedProtocol; |
300 Attributes()->iProposedProtocol = oldAttr->iProposedProtocol; |
306 Attributes()->iProposedCiphers = oldAttr->iProposedCiphers; |
301 Attributes()->iProposedCiphers = oldAttr->iProposedCiphers; |
307 |
302 Attributes()->iDialogNonAttendedMode = oldAttr->iDialogNonAttendedMode; |
308 if( allowUntrustedCertificates ) |
|
309 { |
|
310 Attributes()->iDialogMode = oldAttr->iDialogMode; |
|
311 } |
|
312 else |
|
313 { |
|
314 Attributes()->iDialogNonAttendedMode = oldAttr->iDialogNonAttendedMode; |
|
315 } |
|
316 |
|
317 Attributes()->idomainName = oldAttr->idomainName; |
303 Attributes()->idomainName = oldAttr->idomainName; |
318 |
304 |
319 // Copy NULL ciphersuite setting |
305 // Copy NULL ciphersuite setting |
320 Attributes()->iAllowNullCipherSuites = oldAttr->iAllowNullCipherSuites; |
306 Attributes()->iAllowNullCipherSuites = oldAttr->iAllowNullCipherSuites; |
321 |
307 |
350 { |
336 { |
351 Attributes()->iProposedCiphers = (TlsSessionPtr()->Attributes())->iProposedCiphers; |
337 Attributes()->iProposedCiphers = (TlsSessionPtr()->Attributes())->iProposedCiphers; |
352 (Attributes()->iMasterSecretInput).iClientRandom = ((TlsSessionPtr()->Attributes())->iMasterSecretInput).iClientRandom; |
338 (Attributes()->iMasterSecretInput).iClientRandom = ((TlsSessionPtr()->Attributes())->iMasterSecretInput).iClientRandom; |
353 Attributes()->iProposedProtocol = (TlsSessionPtr()->Attributes())->iProposedProtocol; |
339 Attributes()->iProposedProtocol = (TlsSessionPtr()->Attributes())->iProposedProtocol; |
354 Attributes()->iNegotiatedProtocol = (TlsSessionPtr()->Attributes())->iNegotiatedProtocol; |
340 Attributes()->iNegotiatedProtocol = (TlsSessionPtr()->Attributes())->iNegotiatedProtocol; |
355 if( allowUntrustedCertificates ) |
341 Attributes()->iDialogNonAttendedMode = (TlsSessionPtr()->Attributes())->iDialogNonAttendedMode; |
356 { |
|
357 Attributes()->iDialogMode = (TlsSessionPtr()->Attributes())->iDialogMode; |
|
358 } |
|
359 else |
|
360 { |
|
361 Attributes()->iDialogNonAttendedMode = (TlsSessionPtr()->Attributes())->iDialogNonAttendedMode; |
|
362 } |
|
363 |
|
364 Attributes()->iSessionNameAndID.iServerName = (TlsSessionPtr()->Attributes())->iSessionNameAndID.iServerName; |
342 Attributes()->iSessionNameAndID.iServerName = (TlsSessionPtr()->Attributes())->iSessionNameAndID.iServerName; |
365 Attributes()->iSessionNameAndID.iSessionId = (TlsSessionPtr()->Attributes())->iSessionNameAndID.iSessionId; |
343 Attributes()->iSessionNameAndID.iSessionId = (TlsSessionPtr()->Attributes())->iSessionNameAndID.iSessionId; |
366 |
344 |
367 } |
345 } |
368 iTlsSession = NULL; |
346 iTlsSession = NULL; |