Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: talk/app/webrtc/webrtcsession.cc

Issue 1151943005: Ability to specify KeyType (RSA, ECDSA) for SSLIdentity generation in libjingle (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressing ASAN, LSAN issues in unittests Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 } 513 }
514 for (size_t i = 0; i < saved_candidates_.size(); ++i) { 514 for (size_t i = 0; i < saved_candidates_.size(); ++i) {
515 delete saved_candidates_[i]; 515 delete saved_candidates_[i];
516 } 516 }
517 delete identity(); 517 delete identity();
518 } 518 }
519 519
520 bool WebRtcSession::Initialize( 520 bool WebRtcSession::Initialize(
521 const PeerConnectionFactoryInterface::Options& options, 521 const PeerConnectionFactoryInterface::Options& options,
522 const MediaConstraintsInterface* constraints, 522 const MediaConstraintsInterface* constraints,
523 DTLSIdentityServiceInterface* dtls_identity_service, 523 const PeerConnectionInterface::RTCConfiguration& rtc_configuration,
524 const PeerConnectionInterface::RTCConfiguration& rtc_configuration) { 524 DtlsIdentityStoreInterface* dtls_identity_store,
525 rtc::KeyType key_type) {
525 bundle_policy_ = rtc_configuration.bundle_policy; 526 bundle_policy_ = rtc_configuration.bundle_policy;
526 rtcp_mux_policy_ = rtc_configuration.rtcp_mux_policy; 527 rtcp_mux_policy_ = rtc_configuration.rtcp_mux_policy;
527 SetSslMaxProtocolVersion(options.ssl_max_version); 528 SetSslMaxProtocolVersion(options.ssl_max_version);
528 529
529 // TODO(perkj): Take |constraints| into consideration. Return false if not all 530 // TODO(perkj): Take |constraints| into consideration. Return false if not all
530 // mandatory constraints can be fulfilled. Note that |constraints| 531 // mandatory constraints can be fulfilled. Note that |constraints|
531 // can be null. 532 // can be null.
532 bool value; 533 bool value;
533 534
534 if (options.disable_encryption) { 535 if (options.disable_encryption) {
535 dtls_enabled_ = false; 536 dtls_enabled_ = false;
536 } else { 537 } else {
537 // Enable DTLS by default if |dtls_identity_service| is valid. 538 // Enable DTLS by default if we have a |dtls_identity_store|.
538 dtls_enabled_ = (dtls_identity_service != NULL); 539 dtls_enabled_ = (dtls_identity_store != nullptr);
539 // |constraints| can override the default |dtls_enabled_| value. 540 // |constraints| can override the default |dtls_enabled_| value.
540 if (FindConstraint( 541 if (FindConstraint(
541 constraints, 542 constraints,
542 MediaConstraintsInterface::kEnableDtlsSrtp, 543 MediaConstraintsInterface::kEnableDtlsSrtp,
543 &value, NULL)) { 544 &value, NULL)) {
544 dtls_enabled_ = value; 545 dtls_enabled_ = value;
545 } 546 }
546 } 547 }
547 548
548 // Enable creation of RTP data channels if the kEnableRtpDataChannels is set. 549 // Enable creation of RTP data channels if the kEnableRtpDataChannels is set.
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 JsepSessionDescription::kMaxVideoCodecHeight, 655 JsepSessionDescription::kMaxVideoCodecHeight,
655 JsepSessionDescription::kDefaultVideoCodecFramerate, 656 JsepSessionDescription::kDefaultVideoCodecFramerate,
656 JsepSessionDescription::kDefaultVideoCodecPreference); 657 JsepSessionDescription::kDefaultVideoCodecPreference);
657 channel_manager_->SetDefaultVideoEncoderConfig( 658 channel_manager_->SetDefaultVideoEncoderConfig(
658 cricket::VideoEncoderConfig(default_codec)); 659 cricket::VideoEncoderConfig(default_codec));
659 660
660 webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( 661 webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory(
661 signaling_thread(), 662 signaling_thread(),
662 channel_manager_, 663 channel_manager_,
663 mediastream_signaling_, 664 mediastream_signaling_,
664 dtls_identity_service, 665 dtls_identity_store,
665 this, 666 this,
666 id(), 667 id(),
667 data_channel_type_, 668 data_channel_type_,
668 dtls_enabled_)); 669 dtls_enabled_,
670 key_type));
669 671
670 webrtc_session_desc_factory_->SignalIdentityReady.connect( 672 webrtc_session_desc_factory_->SignalIdentityReady.connect(
671 this, &WebRtcSession::OnIdentityReady); 673 this, &WebRtcSession::OnIdentityReady);
672 674
673 if (options.disable_encryption) { 675 if (options.disable_encryption) {
674 webrtc_session_desc_factory_->SetSdesPolicy(cricket::SEC_DISABLED); 676 webrtc_session_desc_factory_->SetSdesPolicy(cricket::SEC_DISABLED);
675 } 677 }
676 port_allocator()->set_candidate_filter( 678 port_allocator()->set_candidate_filter(
677 ConvertIceTransportTypeToCandidateFilter(rtc_configuration.type)); 679 ConvertIceTransportTypeToCandidateFilter(rtc_configuration.type));
678 return true; 680 return true;
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1898 metrics_observer_->IncrementCounter(kBestConnections_IPv6); 1900 metrics_observer_->IncrementCounter(kBestConnections_IPv6);
1899 } else { 1901 } else {
1900 ASSERT(false); 1902 ASSERT(false);
1901 } 1903 }
1902 return; 1904 return;
1903 } 1905 }
1904 } 1906 }
1905 } 1907 }
1906 1908
1907 } // namespace webrtc 1909 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698