OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2011 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 public: | 46 public: |
47 DtlsTestClient(const std::string& name) | 47 DtlsTestClient(const std::string& name) |
48 : name_(name), | 48 : name_(name), |
49 packet_size_(0), | 49 packet_size_(0), |
50 use_dtls_srtp_(false), | 50 use_dtls_srtp_(false), |
51 ssl_max_version_(rtc::SSL_PROTOCOL_DTLS_10), | 51 ssl_max_version_(rtc::SSL_PROTOCOL_DTLS_10), |
52 negotiated_dtls_(false), | 52 negotiated_dtls_(false), |
53 received_dtls_client_hello_(false), | 53 received_dtls_client_hello_(false), |
54 received_dtls_server_hello_(false) {} | 54 received_dtls_server_hello_(false) {} |
55 void CreateCertificate(rtc::KeyType key_type) { | 55 void CreateCertificate(rtc::KeyType key_type) { |
56 certificate_ = rtc::RTCCertificate::Create( | 56 certificate_ = |
57 rtc::scoped_ptr<rtc::SSLIdentity>( | 57 rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::SSLIdentity>( |
58 rtc::SSLIdentity::Generate(name_, key_type)).Pass()); | 58 rtc::SSLIdentity::Generate(name_, key_type))); |
59 } | 59 } |
60 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate() { | 60 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate() { |
61 return certificate_; | 61 return certificate_; |
62 } | 62 } |
63 void SetupSrtp() { | 63 void SetupSrtp() { |
64 ASSERT(certificate_); | 64 ASSERT(certificate_); |
65 use_dtls_srtp_ = true; | 65 use_dtls_srtp_ = true; |
66 } | 66 } |
67 void SetupMaxProtocolVersion(rtc::SSLProtocolVersion version) { | 67 void SetupMaxProtocolVersion(rtc::SSLProtocolVersion version) { |
68 ASSERT(!transport_); | 68 ASSERT(!transport_); |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 // Each side's remote certificate is the other side's local certificate. | 884 // Each side's remote certificate is the other side's local certificate. |
885 ASSERT_TRUE( | 885 ASSERT_TRUE( |
886 client1_.transport()->GetRemoteSSLCertificate(remote_cert1.accept())); | 886 client1_.transport()->GetRemoteSSLCertificate(remote_cert1.accept())); |
887 ASSERT_EQ(remote_cert1->ToPEMString(), | 887 ASSERT_EQ(remote_cert1->ToPEMString(), |
888 certificate2->ssl_certificate().ToPEMString()); | 888 certificate2->ssl_certificate().ToPEMString()); |
889 ASSERT_TRUE( | 889 ASSERT_TRUE( |
890 client2_.transport()->GetRemoteSSLCertificate(remote_cert2.accept())); | 890 client2_.transport()->GetRemoteSSLCertificate(remote_cert2.accept())); |
891 ASSERT_EQ(remote_cert2->ToPEMString(), | 891 ASSERT_EQ(remote_cert2->ToPEMString(), |
892 certificate1->ssl_certificate().ToPEMString()); | 892 certificate1->ssl_certificate().ToPEMString()); |
893 } | 893 } |
OLD | NEW |