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

Side by Side Diff: webrtc/p2p/base/faketransportcontroller.h

Issue 2641633002: Only set certificate on DTLS transport if fingerprint is found in SDP. (Closed)
Patch Set: Fix tests by making FakeTransportController::Connect put fingerprints in transport descriptions. Created 3 years, 11 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
« no previous file with comments | « webrtc/base/sslfingerprint.cc ('k') | webrtc/p2p/base/jseptransport.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2009 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 } 610 }
611 611
612 // Simulate the exchange of transport descriptions, and the gathering and 612 // Simulate the exchange of transport descriptions, and the gathering and
613 // exchange of ICE candidates. 613 // exchange of ICE candidates.
614 void Connect(FakeTransportController* dest) { 614 void Connect(FakeTransportController* dest) {
615 for (const std::string& transport_name : transport_names_for_testing()) { 615 for (const std::string& transport_name : transport_names_for_testing()) {
616 TransportDescription local_desc( 616 TransportDescription local_desc(
617 std::vector<std::string>(), 617 std::vector<std::string>(),
618 rtc::CreateRandomString(cricket::ICE_UFRAG_LENGTH), 618 rtc::CreateRandomString(cricket::ICE_UFRAG_LENGTH),
619 rtc::CreateRandomString(cricket::ICE_PWD_LENGTH), 619 rtc::CreateRandomString(cricket::ICE_PWD_LENGTH),
620 cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_NONE, nullptr); 620 cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_NONE,
621 certificate_for_testing()
622 ? rtc::SSLFingerprint::CreateFromCertificate(
623 certificate_for_testing())
624 : nullptr);
621 TransportDescription remote_desc( 625 TransportDescription remote_desc(
622 std::vector<std::string>(), 626 std::vector<std::string>(),
623 rtc::CreateRandomString(cricket::ICE_UFRAG_LENGTH), 627 rtc::CreateRandomString(cricket::ICE_UFRAG_LENGTH),
624 rtc::CreateRandomString(cricket::ICE_PWD_LENGTH), 628 rtc::CreateRandomString(cricket::ICE_PWD_LENGTH),
625 cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_NONE, nullptr); 629 cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_NONE,
630 dest->certificate_for_testing()
631 ? rtc::SSLFingerprint::CreateFromCertificate(
632 dest->certificate_for_testing())
633 : nullptr);
626 std::string err; 634 std::string err;
627 SetLocalTransportDescription(transport_name, local_desc, 635 SetLocalTransportDescription(transport_name, local_desc,
628 cricket::CA_OFFER, &err); 636 cricket::CA_OFFER, &err);
629 dest->SetRemoteTransportDescription(transport_name, local_desc, 637 dest->SetRemoteTransportDescription(transport_name, local_desc,
630 cricket::CA_OFFER, &err); 638 cricket::CA_OFFER, &err);
631 dest->SetLocalTransportDescription(transport_name, remote_desc, 639 dest->SetLocalTransportDescription(transport_name, remote_desc,
632 cricket::CA_ANSWER, &err); 640 cricket::CA_ANSWER, &err);
633 SetRemoteTransportDescription(transport_name, remote_desc, 641 SetRemoteTransportDescription(transport_name, remote_desc,
634 cricket::CA_ANSWER, &err); 642 cricket::CA_ANSWER, &err);
635 } 643 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 bool asymmetric = false; 693 bool asymmetric = false;
686 local->SetDestination(remote, asymmetric); 694 local->SetDestination(remote, asymmetric);
687 } 695 }
688 } 696 }
689 } 697 }
690 }; 698 };
691 699
692 } // namespace cricket 700 } // namespace cricket
693 701
694 #endif // WEBRTC_P2P_BASE_FAKETRANSPORTCONTROLLER_H_ 702 #endif // WEBRTC_P2P_BASE_FAKETRANSPORTCONTROLLER_H_
OLDNEW
« no previous file with comments | « webrtc/base/sslfingerprint.cc ('k') | webrtc/p2p/base/jseptransport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698