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 |
249 @param none |
247 @param none |
250 @return void |
248 @return void |
251 */ |
249 */ |
252 EXPORT_C void CTLSProvider::CancelRequest() |
250 EXPORT_C void CTLSProvider::CancelRequest() |
253 { |
251 { |
254 if (iTlsProviderImpl) |
252 iTlsProviderImpl->CancelRequest(); |
255 iTlsProviderImpl->CancelRequest(); |
|
256 } |
253 } |
257 |
254 |
258 |
255 |
259 /** |
256 /** |
260 This synchronous method saves the handshake parameters, creates a new implementation |
257 This synchronous method saves the handshake parameters, creates a new implementation |
283 if(TlsSessionPtr()) |
280 if(TlsSessionPtr()) |
284 { |
281 { |
285 ((TlsSessionPtr()->Attributes())->iMasterSecretInput).iClientRandom = (Attributes()->iMasterSecretInput).iClientRandom; |
282 ((TlsSessionPtr()->Attributes())->iMasterSecretInput).iClientRandom = (Attributes()->iMasterSecretInput).iClientRandom; |
286 } |
283 } |
287 |
284 |
288 TBool allowUntrustedCertificates = EFalse; |
|
289 allowUntrustedCertificates = CFeatureDiscovery::IsFeatureSupportedL(NFeature::KFeatureIdFfHttpAllowUntrustedCertificates); |
|
290 |
|
291 // Save old implementation object |
285 // Save old implementation object |
292 CTlsProviderImpl *oldTlsProviderImpl = iTlsProviderImpl; |
286 CTlsProviderImpl *oldTlsProviderImpl = iTlsProviderImpl; |
293 iTlsProviderImpl = NULL; |
287 iTlsProviderImpl = NULL; |
294 CleanupStack::PushL(oldTlsProviderImpl); |
288 CleanupStack::PushL(oldTlsProviderImpl); |
295 CTlsCryptoAttributes* oldAttr = oldTlsProviderImpl->Attributes(); |
289 CTlsCryptoAttributes* oldAttr = oldTlsProviderImpl->Attributes(); |
303 |
297 |
304 CTlsCryptoAttributes* oldAttr = oldTlsProviderImpl->Attributes(); |
298 CTlsCryptoAttributes* oldAttr = oldTlsProviderImpl->Attributes(); |
305 |
299 |
306 Attributes()->iProposedProtocol = oldAttr->iProposedProtocol; |
300 Attributes()->iProposedProtocol = oldAttr->iProposedProtocol; |
307 Attributes()->iProposedCiphers = oldAttr->iProposedCiphers; |
301 Attributes()->iProposedCiphers = oldAttr->iProposedCiphers; |
308 |
302 Attributes()->iDialogNonAttendedMode = oldAttr->iDialogNonAttendedMode; |
309 if( allowUntrustedCertificates ) |
|
310 { |
|
311 Attributes()->iDialogMode = oldAttr->iDialogMode; |
|
312 } |
|
313 else |
|
314 { |
|
315 Attributes()->iDialogNonAttendedMode = oldAttr->iDialogNonAttendedMode; |
|
316 } |
|
317 |
|
318 Attributes()->idomainName = oldAttr->idomainName; |
303 Attributes()->idomainName = oldAttr->idomainName; |
319 |
304 |
320 // Copy NULL ciphersuite setting |
305 // Copy NULL ciphersuite setting |
321 Attributes()->iAllowNullCipherSuites = oldAttr->iAllowNullCipherSuites; |
306 Attributes()->iAllowNullCipherSuites = oldAttr->iAllowNullCipherSuites; |
322 |
307 |
351 { |
336 { |
352 Attributes()->iProposedCiphers = (TlsSessionPtr()->Attributes())->iProposedCiphers; |
337 Attributes()->iProposedCiphers = (TlsSessionPtr()->Attributes())->iProposedCiphers; |
353 (Attributes()->iMasterSecretInput).iClientRandom = ((TlsSessionPtr()->Attributes())->iMasterSecretInput).iClientRandom; |
338 (Attributes()->iMasterSecretInput).iClientRandom = ((TlsSessionPtr()->Attributes())->iMasterSecretInput).iClientRandom; |
354 Attributes()->iProposedProtocol = (TlsSessionPtr()->Attributes())->iProposedProtocol; |
339 Attributes()->iProposedProtocol = (TlsSessionPtr()->Attributes())->iProposedProtocol; |
355 Attributes()->iNegotiatedProtocol = (TlsSessionPtr()->Attributes())->iNegotiatedProtocol; |
340 Attributes()->iNegotiatedProtocol = (TlsSessionPtr()->Attributes())->iNegotiatedProtocol; |
356 if( allowUntrustedCertificates ) |
341 Attributes()->iDialogNonAttendedMode = (TlsSessionPtr()->Attributes())->iDialogNonAttendedMode; |
357 { |
|
358 Attributes()->iDialogMode = (TlsSessionPtr()->Attributes())->iDialogMode; |
|
359 } |
|
360 else |
|
361 { |
|
362 Attributes()->iDialogNonAttendedMode = (TlsSessionPtr()->Attributes())->iDialogNonAttendedMode; |
|
363 } |
|
364 |
|
365 Attributes()->iSessionNameAndID.iServerName = (TlsSessionPtr()->Attributes())->iSessionNameAndID.iServerName; |
342 Attributes()->iSessionNameAndID.iServerName = (TlsSessionPtr()->Attributes())->iSessionNameAndID.iServerName; |
366 Attributes()->iSessionNameAndID.iSessionId = (TlsSessionPtr()->Attributes())->iSessionNameAndID.iSessionId; |
343 Attributes()->iSessionNameAndID.iSessionId = (TlsSessionPtr()->Attributes())->iSessionNameAndID.iSessionId; |
367 |
344 |
368 } |
345 } |
369 iTlsSession = NULL; |
346 iTlsSession = NULL; |
666 @return void |
643 @return void |
667 @internalTechnology |
644 @internalTechnology |
668 */ |
645 */ |
669 EXPORT_C void CTLSSession::CancelRequest() |
646 EXPORT_C void CTLSSession::CancelRequest() |
670 { |
647 { |
671 if (iTlsSessionImpl) |
648 iTlsSessionImpl->CancelRequest(); |
672 iTlsSessionImpl->CancelRequest(); |
|
673 } |
649 } |
674 |
650 |
675 EXPORT_C CTLSSession::~CTLSSession() |
651 EXPORT_C CTLSSession::~CTLSSession() |
676 { |
652 { |
677 delete iTlsSessionImpl; |
653 delete iTlsSessionImpl; |
678 iTlsSessionImpl = NULL; |
654 } |
679 } |
655 |
680 |
|